Ejemplo n.º 1
0
 protected function buildPage()
 {
     // theme
     $this->template->assign('theme', $this->theme->getTheme());
     $this->template->assign('themes', $this->theme->getThemes());
     // force to be a specific page
     $page = is_null($this->fake_page) ? $this->page : $this->fake_page;
     // infos
     $this->template->assign('app_name', (new Setting('app_name'))->getValueOrDefault());
     $this->template->assign('app_title', (new Setting('app_title'))->getValueOrDefault());
     $this->template->assign('app_description', (new Setting('app_description'))->getValueOrDefault());
     $this->template->assign('app_copyright', (new Setting('app_copyright'))->getValueOrDefault());
     $this->template->assign('app_robots', (new Setting('app_robots'))->getValueOrDefault());
     $this->template->assign('app_version', TextHelper::niceVersion(self::VERSION));
     $this->template->assign('app_api_version', TextHelper::niceVersion(\Picker\API::VERSION));
     $this->template->assign('app_full_version', self::VERSION);
     $this->template->assign('app_full_api_version', \Picker\API::VERSION);
     // user infos
     $this->template->assign('user_isLogged', $this->auth->isLogged());
     $this->template->assign('user_email', Session::Get(Authentification::SESSION_USER_EMAIL));
     // navbar
     if (!isset($this->modules[Menu::NAVBAR])) {
         $m = new Menu();
         $m->item('./', 'Home');
         $this->modules[Menu::NAVBAR] = $m;
     }
     $this->template->assign(Menu::NAVBAR, $this->modules[Menu::NAVBAR]->generate($this->url . $page));
     // navbar right
     if (isset($this->modules[Menu::NAVBAR_RIGHT])) {
         $this->template->assign(Menu::NAVBAR_RIGHT, $this->modules[Menu::NAVBAR_RIGHT]->generate($this->url . $page));
     }
     // javascript
     if (isset($this->modules['script_file'])) {
         $this->template->assign('script_files', $this->modules['script_file']);
     }
     if (isset($this->modules['script'])) {
         $this->template->assign('scripts', $this->modules['script']);
     }
 }