Example #1
0
 public function deleteAction()
 {
     $mdlPost = new Blog_Post();
     $id = $this->_request->getParam('id');
     $post = $mdlPost->openPost($id);
     $mdlPost->deletePageById($id);
     $this->_request->setParam('id', $post->blogId);
     $this->_forward('edit', 'blog');
 }
 public function blogAction()
 {
     if ($this->moduleData->blog > 0) {
         $mdlBlog = new Blog_Blog();
         $mdlPost = new Blog_Post();
         $page = Digitalus_Builder::getPage();
         $params = $page->getParams();
         if (isset($params['openPost']) && $params['openPost'] > 0) {
             $openPost = $mdlPost->openPost($params['openPost']);
             $this->view->openPost = $openPost;
             $this->view->blog = $mdlBlog->find($openPost->blogId)->current();
         } else {
             $this->view->blog = $mdlBlog->find($this->moduleData->blog)->current();
             $this->view->posts = $mdlPost->getPosts($this->moduleData->blog);
         }
     }
 }