Beispiel #1
0
 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);
 }
Beispiel #2
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);
 }
Beispiel #3
0
 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);
 }
Beispiel #4
0
 public function indexAction()
 {
     $name = Comm\Arg::post('name');
     $alias = Comm\Arg::post('alias');
     Model\Category::create($name, $alias);
     Comm\Response::json(100000, '操作成功', null, false);
 }
Beispiel #5
0
 public function indexAction()
 {
     $category_id = Comm\Arg::post('category_id');
     $title = Comm\Arg::post('title');
     $content = Comm\Arg::post('content');
     Model\Article::create($category_id, $title, $content);
     Comm\Response::json(100000, '发表成功', ['href' => Comm\View::path('manage/article/index')], false);
 }
Beispiel #6
0
 public function indexAction()
 {
     $name = Comm\Arg::post('name');
     $desc = Comm\Arg::post('desc');
     $page_count = Comm\Arg::post('page_count', FILTER_VALIDATE_INT);
     $comment_duoshuo = Comm\Arg::post('comment_duoshuo');
     $timezone = Comm\Arg::post('timezone');
     Model\Blog::save(array('name' => $name, 'desc' => $desc, 'page_count' => $page_count, 'comment_duoshuo' => $comment_duoshuo, 'timezone' => $timezone));
     Comm\Response::json(100000, '操作成功', null, false);
 }
Beispiel #7
0
 public function indexAction()
 {
     $id = Comm\Arg::post('id', FILTER_VALIDATE_INT);
     $article = Model\Article::show($id);
     if (!$article) {
         throw new Exception\Msg('发布文章为空');
     }
     $result = Model\Publish::article($article);
     Comm\Response::json(100000, 'succ', ['result' => $result], false);
 }
Beispiel #8
0
 public function indexAction()
 {
     $publishs = Comm\Arg::post('publish', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
     $datas = array();
     foreach ($publishs as $publish) {
         $publis_arr = explode('-', $publish);
         if (isset($publis_arr[1]) && ctype_digit($publis_arr[0]) && ctype_digit($publis_arr[1])) {
             $type = $publis_arr[0];
             $connection_id = $publis_arr[1];
         }
         $datas[] = array('type' => $type, 'connection_id' => $connection_id);
     }
     $result = Model\Publish\Task::createBatch($datas);
     $msg = _('添加发布任务成功');
     Comm\Response::json(100000, $msg, ['result' => $result], false);
 }
Beispiel #9
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);
 }
Beispiel #10
0
 public function indexAction()
 {
     $domain = Comm\Arg::post('domain');
     Model\Publish::domain($domain);
     Comm\Response::json(100000, '操作成功', null, false);
 }
Beispiel #11
0
 public function indexAction()
 {
     $id = Comm\Arg::post('id');
     $result = Model\Article::destory($id);
     Comm\Response::json(100000, _('删除成功'), null, false);
 }
Beispiel #12
0
 public function indexAction()
 {
     $ids = isset($_POST['ids']) ? $_POST['ids'] : array();
     Model\Category::destroyByUserBatch($ids);
     Comm\Response::json(100000, '操作成功', null, false);
 }
Beispiel #13
0
 public function indexAction()
 {
     $theme_id = Comm\Arg::post('id');
     $result = Model\Theme\Main::destory($theme_id);
     Comm\Response::json(100000, '操作成功', ['result' => $result], false);
 }
Beispiel #14
0
 public function indexAction()
 {
     $theme_id = Comm\Arg::post('theme_id');
     $result = Model\Blog::save(array('theme_id' => $theme_id));
     Comm\Response::json(100000, '操作成功', ['result' => $result], false);
 }
Beispiel #15
0
 public function indexAction()
 {
     $id = Comm\Arg::post('id', FILTER_VALIDATE_INT);
     $result = Model\Theme\Resource::destory($id);
     Comm\Response::json(100000, _('操作成功'), ['result' => $result], false);
 }
Beispiel #16
0
 public function indexAction()
 {
     $id = Comm\Arg::post('id', FILTER_VALIDATE_INT);
     $result = Model\Theme\Resource::unlock($id);
     Comm\Response::json(100000, 'succ', null, false);
 }