コード例 #1
0
ファイル: Bug409Test.php プロジェクト: nicholasryan/CorePlus
 protected function tearDown()
 {
     $this->blog->delete();
     $this->article->delete();
 }
コード例 #2
0
 /**
  * Delete a blog article
  */
 public function article_delete()
 {
     $view = $this->getView();
     $request = $this->getPageRequest();
     $article = new BlogArticleModel($request->getParameter(0));
     if (!$article->exists()) {
         return View::ERROR_NOTFOUND;
     }
     $blog = $article->getLink('Blog');
     if (!$blog->exists()) {
         return View::ERROR_NOTFOUND;
     }
     $manager = \Core\user()->checkAccess('p:/blog/manage_all');
     $editor = \Core\user()->checkAccess($blog->get('manage_articles_permission ')) || $manager;
     if (!$editor) {
         return View::ERROR_ACCESSDENIED;
     }
     if (!$request->isPost()) {
         return View::ERROR_BADREQUEST;
     }
     $article->delete();
     \Core\go_back();
 }