private function build_form() { $picture_yes = '<i class="fa fa-success fa-2x" title="' . LangLoader::get_message('yes', 'common') . '"></i>'; $picture_no = '<i class="fa fa-error fa-2x" title="' . LangLoader::get_message('no', 'common') . '"></i>'; $picture_unknown = '<i class="fa fa-question fa-2x" title="' . LangLoader::get_message('unknown', 'main') . '"></i>'; $default_lang_config = LangsManager::get_lang(LangsManager::get_default_lang())->get_configuration(); $default_theme_config = ThemesManager::get_theme(ThemesManager::get_default_theme())->get_configuration(); $editors = AppContext::get_content_formatting_service()->get_available_editors(); $default_editor = $editors[ContentFormattingConfig::load()->get_default_editor()]; $server_configuration = new ServerConfiguration(); $general_config = GeneralConfig::load(); $server_environment_config = ServerEnvironmentConfig::load(); $sessions_config = SessionsConfig::load(); $maintenance_config = MaintenanceConfig::load(); $url_rewriting_available = false; $url_rewriting_known = true; try { $url_rewriting_available = $server_configuration->has_url_rewriting(); } catch (UnsupportedOperationException $ex) { $url_rewriting_known = false; } $summerization = "---------------------------------System report---------------------------------\n-----------------------------generated by PHPBoost-----------------------------\nSERVER CONFIGURATION-----------------------------------------------------------\nphp version\t\t\t: " . ServerConfiguration::get_phpversion() . "\ndbms version\t\t\t: " . PersistenceContext::get_dbms_utils()->get_dbms_version() . "\ngd library\t\t\t: " . (int) $server_configuration->has_gd_library() . "\nurl rewriting\t\t\t: " . ($url_rewriting_known ? (int) $url_rewriting_available : 'N/A') . "\napcu cache\t\t\t: " . (int) DataStoreFactory::is_apc_available() . "\nPHPBOOST CONFIGURATION---------------------------------------------------------\nphpboost version\t\t: " . Environment::get_phpboost_version() . "\nserver url\t\t\t: " . $general_config->get_site_url() . "\nsite path\t\t\t: " . $general_config->get_site_path() . "\ndefault theme\t\t\t: " . $default_theme_config->get_name() . " (" . LangLoader::get_message('version', 'admin') . " " . $default_theme_config->get_version() . ")\ndefault language\t\t: " . $default_lang_config->get_name() . "\ndefault editor\t\t\t: " . $default_editor . "\nhome page\t\t\t: " . Environment::get_home_page() . "\nurl rewriting\t\t\t: " . (int) $server_environment_config->is_url_rewriting_enabled() . "\napcu cache\t\t\t: " . (int) DataStoreFactory::is_apc_enabled() . "\noutput gzip\t\t\t: " . (int) $server_environment_config->is_output_gziping_enabled() . "\nsession cookie name\t\t: " . $sessions_config->get_cookie_name() . "\nsession duration\t\t: " . $sessions_config->get_session_duration() . "\nactive session duration\t\t: " . $sessions_config->get_active_session_duration() . "\nDIRECTORIES AUTHORIZATIONS-----------------------------------------------------\n"; $form = new HTMLForm('system-report', '', false); $this->get_advises($form); $fieldset = new FormFieldsetHTML('report', $this->admin_lang['server']); $form->add_fieldset($fieldset); $fieldset->add_field(new FormFieldFree('php_version', $this->admin_lang['php_version'], ServerConfiguration::get_phpversion())); $fieldset->add_field(new FormFieldFree('dbms_version', $this->admin_lang['dbms_version'], PersistenceContext::get_dbms_utils()->get_dbms_version())); $fieldset->add_field(new FormFieldFree('gd_library', $this->admin_lang['gd_library'], $server_configuration->has_gd_library() ? $picture_yes : $picture_no)); $fieldset->add_field(new FormFieldFree('url_rewriting', $this->admin_lang['url_rewriting'], $url_rewriting_known ? $url_rewriting_available ? $picture_yes : $picture_no : $picture_unknown)); $fieldset->add_field(new FormFieldFree('apcu_cache', LangLoader::get_message('apcu_cache', 'admin-cache-common'), DataStoreFactory::is_apc_available() ? $picture_yes : $picture_no)); $fieldset = new FormFieldsetHTML('report', $this->admin_lang['phpboost_config']); $form->add_fieldset($fieldset); $fieldset->add_field(new FormFieldFree('kernel_version', $this->admin_lang['kernel_version'], Environment::get_phpboost_version())); $fieldset->add_field(new FormFieldFree('site_url', LangLoader::get_message('advanced-config.site_url', 'admin-config-common'), $general_config->get_site_url())); $fieldset->add_field(new FormFieldFree('site_path', LangLoader::get_message('advanced-config.site_path', 'admin-config-common'), $general_config->get_site_path())); $fieldset->add_field(new FormFieldFree('default_theme', LangLoader::get_message('general-config.default_theme', 'admin-config-common'), $default_theme_config->get_name() . " (" . LangLoader::get_message('version', 'admin') . " " . $default_theme_config->get_version() . ")")); $fieldset->add_field(new FormFieldFree('default_language', LangLoader::get_message('general-config.default_language', 'admin-config-common'), $default_lang_config->get_name())); $fieldset->add_field(new FormFieldFree('default_editor', LangLoader::get_message('content.config.default-formatting-language', 'admin-contents-common'), $default_editor)); $fieldset->add_field(new FormFieldFree('start_page', LangLoader::get_message('general-config.start_page', 'admin-config-common'), Environment::get_home_page())); $fieldset->add_field(new FormFieldFree('phpboost_url_rewriting', $this->admin_lang['url_rewriting'], $server_environment_config->is_url_rewriting_enabled() ? $picture_yes : $picture_no)); $fieldset->add_field(new FormFieldFree('phpboost_apcu_cache', LangLoader::get_message('apcu_cache', 'admin-cache-common'), DataStoreFactory::is_apc_enabled() ? $picture_yes : $picture_no)); $fieldset->add_field(new FormFieldFree('output_gz', $this->admin_lang['output_gz'], $server_environment_config->is_output_gziping_enabled() ? $picture_yes : $picture_no)); $fieldset->add_field(new FormFieldFree('cookie_name', LangLoader::get_message('advanced-config.cookie-name', 'admin-config-common'), $sessions_config->get_cookie_name())); $fieldset->add_field(new FormFieldFree('session_length', LangLoader::get_message('advanced-config.cookie-duration', 'admin-config-common'), $sessions_config->get_session_duration())); $fieldset->add_field(new FormFieldFree('session_guest_length', LangLoader::get_message('advanced-config.active-session-duration', 'admin-config-common'), $sessions_config->get_active_session_duration())); $fieldset = new FormFieldsetHTML('directories_auth', $this->admin_lang['directories_auth']); $form->add_fieldset($fieldset); $directories_summerization = ''; foreach (PHPBoostFoldersPermissions::get_permissions() as $key => $folder) { $fieldset->add_field(new FormFieldFree(str_replace('/', '_', $key), $key, $folder->is_writable() ? $picture_yes : $picture_no)); $directories_summerization .= $key . str_repeat(' ', 5 - strlen($key) / 8) . ": " . (int) $folder->is_writable() . "\n"; } $fieldset = new FormFieldsetHTML('summerization', $this->admin_lang['system_report_summerization']); $form->add_fieldset($fieldset); $fieldset->add_field(new FormFieldLabel($this->admin_lang['system_report_summerization_explain'])); $fieldset->add_field(new FormFieldMultiLineTextEditor('summerization', '', $summerization . $directories_summerization, array('rows' => 20, 'cols' => 15, 'class' => 'system-report'))); $this->form = $form; }
protected function create_view() { $columns_disabled = ThemesManager::get_theme(AppContext::get_current_user()->get_theme())->get_columns_disabled(); $columns_disabled->set_disable_right_columns(true); $columns_disabled->set_disable_left_columns(true); $columns_disabled->set_disable_top_central(true); $columns_disabled->set_disable_bottom_central(true); $this->view = new FileTemplate('user/UserError403Controller.tpl'); }
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); }
public function get_content() { $user = AppContext::get_current_user(); $theme_id = AppContext::get_request()->get_string('switchtheme', ''); if (!empty($theme_id)) { $theme = ThemesManager::get_theme($theme_id); if ($theme !== null) { if ($theme->is_activated() && $theme->check_auth()) { $user->update_theme($theme->get_id()); } } $query_string = preg_replace('`switchtheme=[^&]+`', '', QUERY_STRING); AppContext::get_response()->redirect(trim(HOST . SCRIPT . (!empty($query_string) ? '?' . $query_string : ''))); } $tpl = new FileTemplate('ThemesSwitcher/themeswitcher.tpl'); $tpl->add_lang(LangLoader::get('themeswitcher_common', 'ThemesSwitcher')); foreach (ThemesManager::get_activated_and_authorized_themes_map() as $id => $theme) { $selected = $user->get_theme() == $id ? ' selected="selected"' : ''; $tpl->assign_block_vars('themes', array('NAME' => $theme->get_configuration()->get_name(), 'IDNAME' => $id, 'SELECTED' => $selected)); } $tpl->put('DEFAULT_THEME', UserAccountsConfig::load()->get_default_theme()); return $tpl; }
* it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ if (defined('PHPBOOST') !== true) { exit; } load_module_lang('forum'); //Chargement de la langue du module. $config = ForumConfig::load(); require_once PATH_TO_ROOT . '/forum/forum_defines.php'; //Supprime les menus suivant configuration du site. $columns_disabled = ThemesManager::get_theme(AppContext::get_current_user()->get_theme())->get_columns_disabled(); if ($config->is_left_column_disabled()) { $columns_disabled->set_disable_left_columns(true); } if ($config->is_right_column_disabled()) { $columns_disabled->set_disable_right_columns(true); } //Fonction du forum. require_once PATH_TO_ROOT . '/forum/forum_functions.php';
protected function display_menus(Template $template) { $menus = MenusCache::load()->get_menus(); $columns_disabled = ThemesManager::get_theme(AppContext::get_current_user()->get_theme())->get_columns_disabled(); foreach ($menus as $cached_menu) { $menu = $cached_menu->get_menu(); if ($menu->check_auth() && !$columns_disabled->menus_column_is_disabled($menu->get_block())) { $display = false; $filters = $menu->get_filters(); $nbr_filters = count($filters); foreach ($filters as $filter) { if ($nbr_filters > 1 && $filter->get_pattern() != '/' || $filter->match() && !$display) { $display = true; } } if ($display) { $menu_content = $cached_menu->has_cached_string() ? $cached_menu->get_cached_string() : $menu->display(); $block = $menu->get_block(); switch ($block) { case Menu::BLOCK_POSITION__HEADER: $template->put('C_MENUS_HEADER_CONTENT', true); $template->assign_block_vars('menus_header', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__SUB_HEADER: $template->put('C_MENUS_SUB_HEADER_CONTENT', true); $template->assign_block_vars('menus_sub_header', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__LEFT: $template->put('C_MENUS_LEFT_CONTENT', true); $template->assign_block_vars('menus_left', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__RIGHT: $template->put('C_MENUS_RIGHT_CONTENT', true); $template->assign_block_vars('menus_right', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__TOP_CENTRAL: $template->put('C_MENUS_TOPCENTRAL_CONTENT', true); $template->assign_block_vars('menus_top_central', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__BOTTOM_CENTRAL: $template->put('C_MENUS_BOTTOM_CENTRAL_CONTENT', true); $template->assign_block_vars('menus_bottom_central', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__TOP_FOOTER: $template->put('C_MENUS_TOP_FOOTER_CONTENT', true); $template->assign_block_vars('menus_top_footer', array('MENU' => $menu_content)); break; case Menu::BLOCK_POSITION__FOOTER: $template->put('C_MENUS_FOOTER_CONTENT', true); $template->assign_block_vars('menus_footer', array('MENU' => $menu_content)); } } } } }
private function get_picture_theme() { $theme_id = $this->user_accounts_config->get_default_theme(); $picture = ThemesManager::get_theme($theme_id)->get_configuration()->get_first_picture(); return TPL_PATH_TO_ROOT . '/templates/' . $theme_id . '/' . $picture; }
$menu_template->put_all(array('L_ENABLED' => LangLoader::get_message('enabled', 'common'), 'L_DISABLED' => LangLoader::get_message('disabled', 'common'), 'I_HEADER' => Menu::BLOCK_POSITION__HEADER, 'I_SUBHEADER' => Menu::BLOCK_POSITION__SUB_HEADER, 'I_TOPCENTRAL' => Menu::BLOCK_POSITION__TOP_CENTRAL, 'I_BOTTOMCENTRAL' => Menu::BLOCK_POSITION__BOTTOM_CENTRAL, 'I_TOPFOOTER' => Menu::BLOCK_POSITION__TOP_FOOTER, 'I_FOOTER' => Menu::BLOCK_POSITION__FOOTER, 'I_LEFT' => Menu::BLOCK_POSITION__LEFT, 'I_RIGHT' => Menu::BLOCK_POSITION__RIGHT, 'U_TOKEN' => AppContext::get_session()->get_token())); foreach ($menus_blocks as $block_id => $menus) { // For each block $i = 0; $max = count($menus); foreach ($menus as $menu) { // For each Menu in this block $menu_tpl = clone $menu_template; $id = $menu->get_id(); $enabled = $menu->is_enabled(); if (!$enabled) { $block_id = Menu::BLOCK_POSITION__NOT_ENABLED; } $edit_link = menu_admin_link($menu, 'edit'); $del_link = menu_admin_link($menu, 'delete'); $mini = in_array($block_id, array(Menu::BLOCK_POSITION__LEFT, Menu::BLOCK_POSITION__NOT_ENABLED, Menu::BLOCK_POSITION__RIGHT)); $vertical_position = in_array($block_id, array(Menu::BLOCK_POSITION__LEFT, Menu::BLOCK_POSITION__RIGHT)); $menu_tpl->put_all(array('NAME' => $menu->get_formated_title(), 'IDMENU' => $id, 'CONTENTS' => $menu->admin_display(), 'ACTIV' => $enabled ? 'disable' : 'enable', 'UNACTIV' => $enabled ? 'enable' : 'disable', 'C_MENU_ACTIVATED' => $enabled, 'C_EDIT' => !empty($edit_link), 'C_DEL' => !empty($del_link), 'C_UP' => $block_id != Menu::BLOCK_POSITION__NOT_ENABLED && $i > 0, 'C_DOWN' => $block_id != Menu::BLOCK_POSITION__NOT_ENABLED && $i < $max - 1, 'C_VERTICAL' => $vertical_position, 'C_HORIZONTAL' => !$vertical_position, 'L_DEL' => LangLoader::get_message('delete', 'common'), 'L_EDIT' => LangLoader::get_message('edit', 'common'), 'L_ACTIVATE' => LangLoader::get_message('enable', 'common'), 'L_UNACTIVATE' => LangLoader::get_message('disable', 'common'), 'L_MOVE_UP' => $LANG['move_up'], 'L_MOVE_DOWN' => $LANG['move_down'], 'U_EDIT' => menu_admin_link($menu, 'edit'), 'U_DELETE' => menu_admin_link($menu, 'delete'), 'U_UP' => menu_admin_link($menu, 'up'), 'U_DOWN' => menu_admin_link($menu, 'down'), 'U_MOVE' => menu_admin_link($menu, 'move'))); $tpl->assign_block_vars(get_block($block_id), array('MENU' => $menu_tpl->render())); $i++; } } foreach (ThemesManager::get_activated_themes_map() as $theme => $properties) { $configuration = $properties->get_configuration(); $selected = empty($name_theme) ? AppContext::get_current_user()->get_theme() == $theme : $name_theme == $theme ? ' selected="selected"' : ''; $tpl->assign_block_vars('themes', array('NAME' => $configuration->get_name(), 'IDNAME' => $theme, 'SELECTED' => $selected)); } $columns_disable = ThemesManager::get_theme($name_theme)->get_columns_disabled(); $tpl->put_all(array('NAME_THEME' => $name_theme, 'CHECKED_RIGHT_COLUMN' => !$columns_disable->right_columns_is_disabled() ? 'checked="checked"' : '', 'CHECKED_LEFT_COLUMN' => !$columns_disable->left_columns_is_disabled() ? 'checked="checked"' : '', 'CHECKED_FOOTER_COLUMN' => !$columns_disable->footer_is_disabled() ? 'checked="checked"' : '', 'CHECKED_TOP_FOOTER_COLUMN' => !$columns_disable->top_footer_is_disabled() ? 'checked="checked"' : '', 'CHECKED_BOTTOM_CENTRAL_COLUMN' => !$columns_disable->bottom_central_is_disabled() ? 'checked="checked"' : '', 'CHECKED_TOP_CENTRAL_COLUMN' => !$columns_disable->top_central_is_disabled() ? 'checked="checked"' : '', 'CHECKED_SUB_HEADER_COLUMN' => !$columns_disable->sub_header_is_disabled() ? 'checked="checked"' : '', 'CHECKED_HEADER_COLUMN' => !$columns_disable->header_is_disabled() ? 'checked="checked"' : '', 'C_RIGHT_COLUMN' => $columns_disable->right_columns_is_disabled(), 'C_LEFT_COLUMN' => $columns_disable->left_columns_is_disabled(), 'C_FOOTER_COLUMN' => $columns_disable->footer_is_disabled(), 'C_TOP_FOOTER_COLUMN' => $columns_disable->top_footer_is_disabled(), 'C_BOTTOM_CENTRAL_COLUMN' => $columns_disable->bottom_central_is_disabled(), 'C_TOP_CENTRAL_COLUMN' => $columns_disable->top_central_is_disabled(), 'C_SUB_HEADER_COLUMN' => $columns_disable->sub_header_is_disabled(), 'C_HEADER_COLUMN' => $columns_disable->header_is_disabled(), 'L_MENUS_MANAGEMENT' => $LANG['menus_management'], 'START_PAGE' => Environment::get_home_page(), 'L_INDEX' => $LANG['home'], 'L_CONFIRM_DEL_MENU' => LangLoader::get_message('confirm.delete', 'status-messages-common'), 'L_MOVETO' => $LANG['moveto'], 'L_GUEST' => $LANG['guest'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_HEADER' => $LANG['menu_header'], 'L_SUB_HEADER' => $LANG['menu_subheader'], 'L_LEFT_MENU' => $LANG['menu_left'], 'L_RIGHT_MENU' => $LANG['menu_right'], 'L_TOP_CENTRAL_MENU' => $LANG['menu_top_central'], 'L_BOTTOM_CENTRAL_MENU' => $LANG['menu_bottom_central'], 'L_TOP_FOOTER' => $LANG['menu_top_footer'], 'L_FOOTER' => $LANG['menu_footer'], 'L_ADD_MENU' => $LANG['menus_add'], 'L_ADD_CONTENT_MENUS' => $LANG['menus_content_add'], 'L_ADD_LINKS_MENUS' => $LANG['menus_links_add'], 'L_ADD_FEED_MENUS' => $LANG['menus_feed_add'], 'L_VALID_POSTIONS' => $LANG['valid_position_menus'], 'L_THEME_MANAGEMENT' => $LANG['theme_management'], 'I_HEADER' => Menu::BLOCK_POSITION__HEADER, 'I_SUBHEADER' => Menu::BLOCK_POSITION__SUB_HEADER, 'I_TOPCENTRAL' => Menu::BLOCK_POSITION__TOP_CENTRAL, 'I_BOTTOMCENTRAL' => Menu::BLOCK_POSITION__BOTTOM_CENTRAL, 'I_TOPFOOTER' => Menu::BLOCK_POSITION__TOP_FOOTER, 'I_FOOTER' => Menu::BLOCK_POSITION__FOOTER, 'I_LEFT' => Menu::BLOCK_POSITION__LEFT, 'I_RIGHT' => Menu::BLOCK_POSITION__RIGHT, 'L_MENUS_AVAILABLE' => count($menus_blocks[Menu::BLOCK_POSITION__NOT_ENABLED]) ? $LANG['available_menus'] : $LANG['no_available_menus'], 'L_SUBMIT' => $LANG['submit'], 'L_RESET' => $LANG['reset'], 'U_TOKEN' => AppContext::get_session()->get_token())); $tpl->display(); require_once PATH_TO_ROOT . '/admin/admin_footer.php';
while ($row = $result->fetch()) { if (!empty($row['user_id'])) { $group_color = User::get_group_color($row['groups'], $row['level']); $com_pseudo = '<a href="' . UserUrlBuilder::profile($row['user_id'])->rel() . '" title="' . $row['display_name'] . '" class="' . UserService::get_level_class($row['level']) . '"' . (!empty($group_color) ? ' style="color:' . $group_color . '"' : '') . '>' . TextHelper::wordwrap_html($row['display_name'], 13) . '</a>'; } else { $com_pseudo = '<span style="font-style:italic;">' . (!empty($row['display_name']) ? TextHelper::wordwrap_html($row['display_name'], 13) : $LANG['guest']) . '</span>'; } $tpl->assign_block_vars('comments_list', array('CONTENT' => FormatingHelper::second_parse($row['message']), 'U_PSEUDO' => $com_pseudo, 'U_LINK' => Url::to_rel($row['path']) . '#com' . $row['id'])); $i++; } $result->dispose(); //Advises $advises_form = new HTMLForm('advises_list', '', false); AdminServerSystemReportController::get_advises($advises_form); //Header logo $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(); $tpl->put_all(array('L_QUICK_ACCESS' => $LANG['quick_access'], 'L_ADD_CONTENT' => $LANG['add_content'], 'L_MODULES_MANAGEMENT' => $LANG['modules_management'], 'L_ADD_ARTICLES' => $LANG['add_articles'], 'L_ADD_NEWS' => $LANG['add_news'], 'L_CUSTOMIZE_SITE' => $LANG['customize_site'], 'L_ADD_TEMPLATE' => $LANG['add_template'], 'L_MENUS_MANAGEMENT' => $LANG['menus_management'], 'L_CUSTOMIZE_TEMPLATE' => $LANG['customize_template'], 'L_SITE_MANAGEMENT' => $LANG['site_management'], 'L_GENERAL_CONFIG' => $LANG['general_config'], 'L_EMPTY_CACHE' => $LANG['empty_cache'], 'L_SAVE_DATABASE' => $LANG['save_database'], 'L_WELCOME_TITLE' => $LANG['welcome_title'], 'L_WELCOME_DESC' => $LANG['welcome_desc'], 'WRITING_PAD_CONTENT' => WritingPadConfig::load()->get_content(), 'C_HEADER_LOGO' => !empty($header_logo_path), 'HEADER_LOGO' => Url::to_rel($header_logo_path), 'C_NO_COM' => $i == 0, 'C_UNREAD_ALERTS' => (bool) AdministratorAlertService::get_number_unread_alerts(), 'L_INDEX_ADMIN' => $LANG['administration'], 'L_ADMIN_ALERTS' => $LANG['administrator_alerts'], 'L_NO_UNREAD_ALERT' => $LANG['no_unread_alert'], 'L_UNREAD_ALERT' => $LANG['unread_alerts'], 'L_DISPLAY_ALL_ALERTS' => $LANG['display_all_alerts'], 'L_ADMINISTRATOR_ALERTS' => $LANG['administrator_alerts'], 'L_QUICK_LINKS' => $LANG['quick_links'], 'L_ACTION_USERS_MANAGEMENT' => $LANG['action.members_management'], 'L_ACTION_MENUS_MANAGEMENT' => $LANG['action.menus_management'], 'L_ACTION_MODULES_MANAGEMENT' => $LANG['action.modules_management'], 'L_ACTION_THEMES_MANAGEMENT' => $LANG['action.themes_management'], 'L_ACTION_LANGS_MANAGEMENT' => $LANG['action.langs_management'], 'L_NO_COMMENT' => LangLoader::get_message('no_item_now', 'common'), 'L_LAST_COMMENTS' => $LANG['last_comments'], 'L_VIEW_ALL_COMMENTS' => $LANG['view_all_comments'], 'L_WRITING_PAD' => $LANG['writing_pad'], 'L_STATS' => $LANG['stats'], 'L_USER_ONLINE' => $LANG['user_online'], 'L_USER_IP' => $LANG['user_ip'], 'L_LOCALISATION' => $LANG['localisation'], 'L_LAST_UPDATE' => $LANG['last_update'], 'L_WEBSITE_UPDATES' => $LANG['website_updates'], 'L_BY' => $LANG['by'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset'], 'ADVISES' => $advises_form->display())); //Liste des personnes en lignes. $result = PersistenceContext::get_querier()->select("SELECT s.user_id, s.ip, s.timestamp, s.location_script, s.location_title, m.display_name, m.groups, m.level\nFROM " . DB_TABLE_SESSIONS . " s\nLEFT JOIN " . DB_TABLE_MEMBER . " m ON s.user_id = m.user_id\nWHERE s.timestamp > :timestamp\nORDER BY s.timestamp DESC", array('timestamp' => time() - SessionsConfig::load()->get_active_session_duration())); while ($row = $result->fetch()) { //On vérifie que la session ne correspond pas à un robot. $robot = Robots::get_robot_by_ip($row['ip']); switch ($row['level']) { case User::MEMBER_LEVEL: $class = 'member'; break; case User::MODERATOR_LEVEL: $class = 'modo'; break;
private function get_picture_theme($theme_id = null) { $theme_id = $theme_id !== null ? $theme_id : $this->user_accounts_config->get_default_theme(); $picture = ThemesManager::get_theme($theme_id)->get_configuration()->get_first_picture(); return Url::to_rel('/templates/' . $theme_id . '/' . $picture); }
public static function init_session() { Session::gc(); $session_data = Session::start(); AppContext::set_session($session_data); AppContext::init_current_user(); $current_user = AppContext::get_current_user(); $user_accounts_config = UserAccountsConfig::load(); $user_theme = ThemesManager::get_theme($current_user->get_theme()); $default_theme = $user_accounts_config->get_default_theme(); if ($user_theme === null || (!$user_theme->check_auth() || !$user_theme->is_activated()) && $user_theme->get_id() !== $default_theme) { AppContext::get_current_user()->update_theme($default_theme); } $user_lang = LangsManager::get_lang($current_user->get_locale()); $default_lang = $user_accounts_config->get_default_lang(); if ($user_lang === null || (!$user_lang->check_auth() || !$user_lang->is_activated()) && $user_lang->get_id() !== $default_lang) { AppContext::get_current_user()->update_lang($default_lang); } }
/** * @desc Get the number of the installed version * @return string version */ private function get_installed_version() { switch ($this->type) { case self::KERNEL_TYPE: return GeneralConfig::load()->get_phpboost_major_version(); case self::MODULE_TYPE: if (ModulesManager::is_module_installed($this->id)) { return ModulesManager::get_module($this->id)->get_configuration()->get_version(); } return '0'; case self::TEMPLATE_TYPE: if (ThemesManager::get_theme_existed($this->id)) { return ThemesManager::get_theme($this->id)->get_configuration()->get_version(); } return '0'; default: return '0'; } }
private function get_picture_theme($user_theme) { $picture = ThemesManager::get_theme($user_theme)->get_configuration()->get_first_picture(); return TPL_PATH_TO_ROOT . '/templates/' . $user_theme . '/' . $picture; }
private function get_header_logo_path($theme) { if ($theme == 'all') { return $this->config->get_header_logo_path_all_themes(); } else { $theme = ThemesManager::get_theme($theme); $customize_interface = $theme->get_customize_interface(); return $customize_interface->get_header_logo_path(); } }