Пример #1
0
 /**
  * Show pages
  * As default display public area pages
  * Display all child pages of a given page
  * If the page is the home of the area, then you also view the home
  *
  * @param   integer $id_area Area ID
  * @param   string  $lang language code
  * @param   string  $xfrom page URL of origin
  * @return  void
  */
 public function index($id_area, $lang = '', $xfrom = 'home')
 {
     $area = new Area_model();
     list($id_area, $areas) = $area->get_my_areas($id_area);
     // initialize parameters
     $lang = empty($lang) ? X4Route_core::$lang : $lang;
     $xfrom = str_replace('§', '/', urldecode($xfrom));
     // load dictionary
     $this->dict->get_wordarray(array('pages'));
     $view = new X4View_core('container');
     // content
     $view->content = new X4View_core('pages/pages');
     //$view->page = $this->get_page('pages');
     // content
     $mod = new Page_model($id_area, $lang);
     $view->content->id_area = $id_area;
     $view->content->lang = $lang;
     $view->content->xfrom = $xfrom;
     $view->content->area = $mod->get_var($id_area, 'areas', 'name');
     $obj = $mod->get_page($xfrom);
     $view->content->page = $obj ? $obj : new Page_obj($id_area, $lang);
     $page = $this->get_page('pages');
     $navbar = array($this->site->get_bredcrumb($page), array('areas' => 'index'));
     $view->content->navbar = $navbar;
     // referer
     $view->content->referer = urlencode('pages/index/' . $id_area . '/' . $lang . '/' . $xfrom);
     // pages to show
     $view->content->pages = $mod->get_pages($xfrom, $view->content->page->deep);
     // available menus
     $mod = new Menu_model();
     $view->content->menus = $mod->get_menus($id_area, '', 'id');
     // language switcher
     $lang = new Language_model();
     $view->content->langs = $lang->get_languages();
     // area switcher
     $view->content->areas = $areas;
     $view->render(TRUE);
 }
Пример #2
0
 /**
  * Show areas map (tree view)
  *
  * @param   integer $id_area Area ID
  * @param   string  $lang language code
  * @return  void
  */
 public function map($id_area, $lang)
 {
     // load the dictionary
     $this->dict->get_wordarray(array('areas'));
     // content
     $view = new X4View_core('areas/map');
     $mod = new Page_model($id_area, $lang);
     $view->area = $mod->get_by_id($id_area, 'areas');
     $view->lang = $lang;
     $view->map = $this->site->get_map($mod->get_page('home'), false, false);
     $view->render(TRUE);
 }