Exemplo n.º 1
0
 public function showAction()
 {
     $request = $this->getRequest();
     $lang = $request->getParam('lang');
     $pageId = $this->getParam('page_id');
     $pages = Modules_Page_Services_Page::getParents($pageId, $lang);
     $this->view->pages = $pages;
     $this->view->lang = $lang;
 }
Exemplo n.º 2
0
 /**
  * @param array $links
  * @param string $lang
  * @return array
  */
 public static function filter($links, $lang)
 {
     /**
      * Get the view instance
      */
     $view = Gio_Core_View::getInstance();
     $pages = Modules_Page_Services_Page::getTree($lang);
     if (count($pages) > 0) {
         foreach ($pages as $page) {
             $links['page_page_details'][] = array('title' => $page['name'], 'text' => str_repeat('---', $page['depth']) . ' ' . $page['name'], 'href' => $view->url('page_page_details', $page));
         }
     }
     return $links;
 }
Exemplo n.º 3
0
 public static function factory()
 {
     $request = Gio_Core_Request::getInstance();
     $config = Gio_Core_Module::getConfig('page');
     $param = isset($config['url']['param']) ? $config['url']['param'] : 'page_id';
     $category = null;
     switch ($param) {
         case 'slug':
             $page = Modules_Page_Services_Page::getBySlug($request->getParam($param));
             break;
     }
     if (null == $page) {
         $page = Modules_Page_Services_Page::getById($request->getParam('page_id'));
     }
     return $page;
 }
Exemplo n.º 4
0
 public function showAction()
 {
     $pageId = $this->getParam('page_id');
     $page = Modules_Page_Services_Page::getById($pageId);
     $this->view->page = $page;
 }
Exemplo n.º 5
0
 /**
  * Update pages's order
  * 
  * @return void
  */
 public function orderAction()
 {
     $this->setNoRender();
     $this->disableLayout();
     $request = $this->getRequest();
     if (!$request->isPost()) {
         $this->getResponse()->setBody('RESULT_NOT_OK');
         return;
     }
     $response = 'RESULT_NOT_OK';
     $data = $request->getPost('data');
     $json = new Services_JSON();
     $data = $json->decode($data);
     foreach ($data as $page) {
         Modules_Page_Services_Page::updateOrder(array('page_id' => $page->id, 'parent_id' => $page->parent_id, 'left_id' => $page->left_id, 'right_id' => $page->right_id));
     }
     $this->getResponse()->setBody('RESULT_OK');
 }