Esempio n. 1
0
 public function previewRevisionAction()
 {
     SxCms_Acl::requireAcl('page', 'page.revision.preview');
     $system = new Zend_Session_Namespace('System');
     $revisionId = (int) $this->_getParam('id');
     $mvc = Zend_Layout::getMvcInstance();
     $mvc->getView()->setScriptPath(APPLICATION_PATH . '/modules/default/views/scripts');
     $proxy = new SxCms_Page_Proxy();
     $page = $proxy->getPageByRevisionId($revisionId, $system->lng);
     $this->view->page = $page;
     $this->_helper->layout->setLayoutPath(APPLICATION_PATH . '/modules/default/views/scripts');
     $this->_helper->layout->setLayout($page->getLayout());
     if ($page->getType() == SxCms_Page::SUMMARY) {
         $children = $proxy->getPagesByParentId($page->getId(), null, $system->lng, true);
         $this->view->children = $children;
         $this->renderScript('index/summary.phtml');
         return;
     }
     $this->renderScript('index/content.phtml');
 }
Esempio n. 2
0
 public function submenuAction()
 {
     if (false == ($page = $this->_getParam('page'))) {
         return;
     }
     if (!$page->getId()) {
         return;
     }
     $pageProxy = new SxCms_Page_Proxy();
     $cTree = array();
     $tree = $pageProxy->getPagesByParentId($page->getId());
     $breadcrumbs = $page->getBreadcrumbs($this->_getParam('lng', 'nl'), true, false);
     $active = array();
     $active[] = $page->getId();
     if (isset($breadcrumbs[1])) {
         $active[] = $breadcrumbs[1]['page_id'];
         $tree = $pageProxy->getPagesByParentId($breadcrumbs[1]['page_id'], null, $this->_getParam('lng', 'nl'), true, true);
         $cTree = array($breadcrumbs[1]['page_id'] => $tree);
     }
     if (isset($breadcrumbs[0])) {
         $active[] = $breadcrumbs[0]['page_id'];
         $tree = $pageProxy->getPagesByParentId($breadcrumbs[0]['page_id'], null, $this->_getParam('lng', 'nl'), true, true);
     }
     $section = $pageProxy->getPageById($breadcrumbs[0]['page_id'], $this->_getParam('lng', 'nl'));
     $submenus = array();
     foreach ($tree as $item) {
         $object = $item;
         if ($object->isInNavigation() === true && $object->getDatePublished() <= strftime('%Y-%m-%d %H:%M:%S') && ($object->getDateExpired() >= strftime('%Y-%m-%d %H:%M:%S') || is_null($object->getDateExpired()))) {
             $submenus[] = $item;
         }
     }
     $this->view->submenus = $submenus;
     $this->view->subsubmenus = $cTree;
     $this->view->active = $active;
     $this->view->section = $section;
 }