예제 #1
0
 /**
  *
  * @param type $pageId
  */
 public static function getPath($pageId, $path = null)
 {
     $page = new Knowledgeroot_Page($pageId);
     $parent = $page->getParent();
     if ($path == null) {
         $path = array(0 => $page);
     }
     if ($parent == 0) {
         // reverse sort by key
         krsort($path);
         return $path;
     } else {
         $path[] = new Knowledgeroot_Page($parent);
         return Knowledgeroot_Page_Path::getPath($parent, $path);
     }
 }
예제 #2
0
 public function deleteAction()
 {
     // check for non root page
     if (!Knowledgeroot_Acl::iAmAllowed('page_' . $this->_getParam('id'), 'delete')) {
         $this->_redirect('page/' . $this->_getParam('id'));
     }
     $page = new Knowledgeroot_Page($this->_getParam('id'));
     $parent = $page->getParent();
     $page->delete();
     $this->_redirect('page/' . $parent);
 }