def publishTemplate(): e = Event('web.publishTemplate') t_id = request.form['tid'] view = request.form['view'] key = request.form['k'] user = utils.getKey(key) t = Template() if t.isOwner(t_id, user): t.load(t_id) t.createDefaultView() res = getMessage(t_id, True) else: res = getErrorMessage('User is not the owner of the Template') e.save() return res
def addControl(): e = Event('web.addControl') c_id = request.form['cid'] t_id = request.form['tid'] order = request.form['order'] title = request.form['title'] help = request.form['help'] view = request.form['view'] slug = request.form['slug'] typex = request.form['typex'] key = request.form['k'] user = utils.getKey(key) t = Template() if t.isOwner(t_id, user): res = t.addControl(c_id, t_id, title, help, order, view, slug, typex) else: res = getErrorMessage('User is not the owner of the Template') e.save() return res