示例#1
0
 public function indexAction()
 {
     $alias_id = Comm\Arg::post('alias_id', FILTER_VALIDATE_INT);
     $name = Comm\Arg::post('name');
     $id = Model\Theme\Main::create($alias_id, $name);
     Comm\Response::json(100000, '操作成功', ['id' => $id], false);
 }
示例#2
0
 public function indexAction()
 {
     //获取用户设置
     $blog = Model\Blog::show();
     $use_theme_id = isset($blog['data']['theme_id']) ? $blog['data']['theme_id'] : 0;
     //获取主题列表
     $themes = Model\Theme\Main::userTpls();
     $this->viewDisplay(array('themes' => $themes, 'use_theme_id' => $use_theme_id));
 }
示例#3
0
 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));
 }
示例#4
0
 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);
 }
示例#5
0
 public function indexAction()
 {
     $theme_id = Comm\Arg::post('id');
     $result = Model\Theme\Main::destory($theme_id);
     Comm\Response::json(100000, '操作成功', ['result' => $result], false);
 }