public function indexAction() { $id = Comm\Arg::post('id', FILTER_VALIDATE_INT); $content = Comm\Arg::post('content'); $result = Model\Theme\Resource::update($id, $content); Comm\Response::json(100000, '保存成功', ['result' => $result], false); }
public function indexAction() { $tpl_id = Comm\Arg::post('tpl_id', FILTER_VALIDATE_INT); $resource_name = Comm\Arg::post('resource_name'); $result = Model\Theme\Resource::addResource($tpl_id, $resource_name); Comm\Response::json(100000, '保存成功', ['result' => $result], false); }
/** * Fetch a template and its modification time from database * * @param string $name template name * @param string $source template source * @param integer $mtime template modification timestamp (epoch) * @return void */ protected function fetch($name, &$source, &$mtime) { $result = Model\Theme\Resource::showByName($this->_tpl_id, $name); if ($result) { $source = $result['content']; $mtime = strtotime($result['update_time']); } else { $source = null; $mtime = null; } }
public function indexAction() { $id = \Comm\Arg::get('id', FILTER_VALIDATE_INT); //获取模板基础内容 $theme = Model\Theme\Main::show($id); if (empty($theme)) { throw new \Exception\Msg('指定模板不存在'); } //权限验证 Model\User::validateAuth($theme['user_id']); //获取资源内容 $resource = Model\Theme\Resource::showByTheme($theme); $this->viewDisplay(array('theme' => $theme, 'resource' => $resource)); }
public function indexAction() { $id = Comm\Arg::get('id', FILTER_VALIDATE_INT); $result = Model\Theme\Resource::show($id); if (empty($result)) { throw new Exception\Msg('指定模板资源不存在'); } //判断是否为只读 $main = Model\Theme\Main::show($result['tpl_id']); try { Model\User::validateAuth($main['user_id']); $readonly = false; } catch (Exception $e) { $readonly = true; } Comm\Response::json(100000, 'succ', array('content' => $result['content'], 'readonly' => $readonly), false); }
public function indexAction() { $id = Comm\Arg::post('id', FILTER_VALIDATE_INT); $result = Model\Theme\Resource::destory($id); Comm\Response::json(100000, _('操作成功'), ['result' => $result], false); }
public function indexAction() { $id = Comm\Arg::post('id', FILTER_VALIDATE_INT); $result = Model\Theme\Resource::unlock($id); Comm\Response::json(100000, 'succ', null, false); }