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 save() { $this->general_config->set_site_name($this->form->get_value('site_name')); $this->general_config->set_site_slogan($this->form->get_value('site_slogan')); $this->general_config->set_site_description($this->form->get_value('site_description')); $module_home_page = $this->form->get_value('start_page')->get_raw_value(); $this->general_config->set_module_home_page($module_home_page); if ($module_home_page == 'other') { $this->general_config->set_other_home_page($this->form->get_value('other_start_page')); } else { $this->general_config->set_other_home_page(''); } GeneralConfig::save(); $this->graphical_environment_config->set_visit_counter_enabled($this->form->get_value('visit_counter')); $this->graphical_environment_config->set_page_bench_enabled($this->form->get_value('page_bench')); $this->graphical_environment_config->set_display_theme_author($this->form->get_value('display_theme_author')); GraphicalEnvironmentConfig::save(); $this->user_accounts_config->set_default_lang($this->form->get_value('default_language')->get_raw_value()); $this->user_accounts_config->set_default_theme($this->form->get_value('default_theme')->get_raw_value()); UserAccountsConfig::save(); }