Example #1
0
 function actionDeleteArticle($params = '')
 {
     if (!empty($params['article_id'])) {
         $objBlog = new BlogModel();
         if ($objBlog->safeToDeleteArticle($params['article_id'])) {
             $objBlog->deleteArticle($params['article_id']);
             $this->messages[] = array('type' => 'success', 'message' => 'Blog article has been deleted.');
         } else {
             $this->messages[] = array('type' => 'error', 'message' => 'Cannot delete article.');
         }
     } else {
         $this->messages[] = array('type' => 'error', 'message' => 'Unknown article to delete.');
     }
     $this->actionArticles();
 }