protected function display_counter(Template $template)
 {
     //If the counter is to be displayed, we display it
     if (GraphicalEnvironmentConfig::load()->is_visit_counter_enabled()) {
         $compteur = PersistenceContext::get_querier()->select_single_row(DB_TABLE_VISIT_COUNTER, array('ip AS nbr_ip', 'total'), 'WHERE id = 1');
         $compteur_total = !empty($compteur['nbr_ip']) ? $compteur['nbr_ip'] : '1';
         $compteur_day = !empty($compteur['total']) ? $compteur['total'] : '1';
         $template->put_all(array('L_VISIT' => self::$main_lang['guest_s'], 'L_TODAY' => LangLoader::get_message('today', 'date-common'), 'C_COMPTEUR' => true, 'COMPTEUR_TOTAL' => $compteur_total, 'COMPTEUR_DAY' => $compteur_day));
     }
 }
 public function display($content)
 {
     $template = new FileTemplate('admin/body.tpl');
     $template->add_lang(self::$lang);
     $theme = ThemesManager::get_theme(AppContext::get_current_user()->get_theme());
     $customize_interface = $theme->get_customize_interface();
     $header_logo_path = $customize_interface->get_header_logo_path();
     $template->put_all(array('SITE_NAME' => GeneralConfig::load()->get_site_name(), 'SITE_SLOGAN' => GeneralConfig::load()->get_site_slogan(), 'C_HEADER_LOGO' => !empty($header_logo_path), 'HEADER_LOGO' => Url::to_rel($header_logo_path), 'PHPBOOST_VERSION' => GeneralConfig::load()->get_phpboost_major_version(), 'CONTENT' => $content, 'L_INDEX_SUPPORT' => self::$lang['index.support'], 'L_INDEX_FAQ' => self::$lang['index.faq'], 'L_INDEX_DOCUMENTATION' => self::$lang['index.documentation'], 'L_POWERED_BY' => self::$lang['powered_by'], 'L_PHPBOOST_RIGHT' => self::$lang['phpboost_right'], 'L_ADMINISTRATION' => self::$lang['index.administration'], 'L_INDEX_SITE' => self::$lang['index.site'], 'L_EXTEND_MENU' => self::$lang['index.extend_menu'], 'L_DISCONNECT' => self::$lang['index.disconnect'], 'L_ADMIN_MAIN_MENU' => self::$lang['admin.main_menu'], 'L_NEED_HELP' => self::$lang['admin.need_help']));
     if (GraphicalEnvironmentConfig::load()->is_page_bench_enabled()) {
         $template->put_all(array('C_DISPLAY_BENCH' => true, 'BENCH' => AppContext::get_bench()->to_string(), 'REQ' => PersistenceContext::get_querier()->get_executed_requests_count(), 'MEMORY_USED' => AppContext::get_bench()->get_memory_php_used(), 'L_REQ' => self::$lang['sql_req'], 'L_ACHIEVED' => self::$lang['achieved'], 'L_UNIT_SECOND' => LangLoader::get_message('unit.seconds', 'date-common')));
     }
     if (GraphicalEnvironmentConfig::load()->get_display_theme_author()) {
         $theme_configuration = ThemesManager::get_theme(AppContext::get_current_user()->get_theme())->get_configuration();
         $template->put_all(array('C_DISPLAY_AUTHOR_THEME' => true, 'L_THEME' => self::$lang['theme'], 'L_THEME_NAME' => $theme_configuration->get_name(), 'L_BY' => strtolower(self::$lang['by']), 'L_THEME_AUTHOR' => $theme_configuration->get_author_name(), 'U_THEME_AUTHOR_LINK' => $theme_configuration->get_author_link()));
     }
     $template->put('subheader_menu', self::get_subheader_tpl());
     $this->display_page($template);
 }
 private function init_graphical_config()
 {
     $graphical_environment_config = GraphicalEnvironmentConfig::load();
     $graphical_environment_config->set_page_bench_enabled($this->distribution_config['bench']);
     GraphicalEnvironmentConfig::save();
 }
 private function load_config()
 {
     $this->general_config = GeneralConfig::load();
     $this->graphical_environment_config = GraphicalEnvironmentConfig::load();
     $this->user_accounts_config = UserAccountsConfig::load();
 }