public function moveAction() { // acl checks if (!Knowledgeroot_Acl::iAmAllowed('page_' . $this->_getParam('id'), 'edit')) { $this->_redirect('page/' . $this->_getParam('id')); } // using blank layout $this->_helper->layout->setLayout('blank'); if ($this->_getParam('target') !== null) { // acl checks // check for new root page if ($this->_getParam('target') == 0 && !Knowledgeroot_Acl::iAmAllowed('manageRootPages', 'new')) { $this->_redirect(''); } // check if user has page new rights on target if (!Knowledgeroot_Acl::iAmAllowed('page_' . $this->_getParam('target'), 'new')) { $this->_redirect('page/' . $this->_getParam('id')); } // check if page note the page itself if ($this->_getParam('target') == $this->_getParam('id')) { $this->_redirect(''); } $page = new Knowledgeroot_Page($this->_getParam('id')); $page->setParent($this->_getParam('target')); $page->save(); $this->view->pageid = $this->_getParam('id'); $this->view->target = $this->_getParam('target'); } else { $this->view->pageid = $this->_getParam('id'); } }
/** * restore page version */ public function restore() { if ($this->version === null) { return; } $page = new Knowledgeroot_Page($this->getId()); // restore page $page->setName($this->getName()); $page->setDescription($this->getDescription()); $page->setAlias($this->getAlias()); $page->setIcon($this->getIcon()); $page->setSubtitle($this->getSubtitle()); $page->setTooltip($this->getTooltip()); $page->setShowContentDescription($this->getShowContentDescription()); $page->setShowTableOfContent($this->getShowTableOfContent()); $page->setContentCollapse($this->getContentCollapse()); // save $page->save(); }