Ejemplo n.º 1
0
 public function deletePage($id)
 {
     $where = $this->getAdapter()->quoteInto('id = ?', $id);
     $this->delete($where);
     $properties = new PagesProperties(array(Properties::KEY => $id));
     $properties->deleteAllProperties();
     $this->cacheRemove('Pages_getPages_' . $this->_user);
 }
Ejemplo n.º 2
0
 public function deleteAction()
 {
     // Get, check and setup the parameters
     $page_id = $this->getRequest()->getParam("id");
     // Do we own the page ?
     $pages = new Pages();
     if (!($page = $pages->getPage($page_id))) {
         throw new Stuffpress_Exception("Unknown page with id {$page_id}");
     }
     if ($page['user_id'] != $this->_application->user->id) {
         throw new Stuffpress_AccessDeniedException("Not the owner of page {$page_id}");
     }
     $pages->deletePage($page_id);
     // Delete the page properties
     $properties = new PagesProperties(array(Properties::KEY => $page_id));
     $properties->deleteAllProperties();
     return $this->_helper->json->sendJson(false);
 }