public function get_search_form($args) { global $LANG; $tpl = new FileTemplate('forum/forum_search_form.tpl'); require_once PATH_TO_ROOT . '/forum/forum_functions.php'; require_once PATH_TO_ROOT . '/forum/forum_defines.php'; load_module_lang('forum'); //Chargement de la langue du module. $search = $args['search']; $idcat = !empty($args['ForumIdcat']) ? NumberHelper::numeric($args['ForumIdcat']) : -1; $time = !empty($args['ForumTime']) ? NumberHelper::numeric($args['ForumTime']) : 0; $where = !empty($args['ForumWhere']) ? TextHelper::strprotect($args['ForumWhere']) : 'all'; //Liste des catégories. $search_category_children_options = new SearchCategoryChildrensOptions(); $search_category_children_options->add_authorizations_bits(Category::READ_AUTHORIZATIONS); $categories_tree = ForumService::get_categories_manager()->get_select_categories_form_field('cats', '', $idcat, $search_category_children_options); $method = new ReflectionMethod('AbstractFormFieldChoice', 'get_options'); $method->setAccessible(true); $categories_tree_options = $method->invoke($categories_tree); $cat_list = ''; foreach ($categories_tree_options as $option) { if ($option->get_raw_value()) { $cat = ForumService::get_categories_manager()->get_categories_cache()->get_category($option->get_raw_value()); if (!$cat->get_url()) { $cat_list .= $option->display()->render(); } } } $date_lang = LangLoader::get('date-common'); $tpl->put_all(array('L_DATE' => $date_lang['date'], 'L_DAY' => $date_lang['day'], 'L_DAYS' => $date_lang['days'], 'L_MONTH' => $date_lang['month'], 'L_MONTHS' => $date_lang['month'], 'L_YEAR' => $date_lang['year'], 'IS_SELECTED_30000' => $time == 30000 ? ' selected="selected"' : '', 'IS_SELECTED_1' => $time == 1 ? ' selected="selected"' : '', 'IS_SELECTED_7' => $time == 7 ? ' selected="selected"' : '', 'IS_SELECTED_15' => $time == 15 ? ' selected="selected"' : '', 'IS_SELECTED_30' => $time == 30 ? ' selected="selected"' : '', 'IS_SELECTED_180' => $time == 180 ? ' selected="selected"' : '', 'IS_SELECTED_360' => $time == 360 ? ' selected="selected"' : '', 'L_OPTIONS' => $LANG['options'], 'L_TITLE' => $LANG['title'], 'L_CONTENTS' => $LANG['content'], 'IS_TITLE_CHECKED' => $where == 'title' ? ' checked="checked"' : '', 'IS_CONTENTS_CHECKED' => $where == 'contents' ? ' checked="checked"' : '', 'IS_ALL_CHECKED' => $where == 'all' ? ' checked="checked"' : '', 'L_CATEGORY' => $LANG['category'], 'L_ALL_CATS' => $LANG['all'], 'IS_ALL_CATS_SELECTED' => $idcat == '-1' ? ' selected="selected"' : '', 'CATS' => $cat_list)); return $tpl->render(); }
public function execute(HTTPRequestCustom $request) { $lang = LangLoader::get('common'); $is_admin = AppContext::get_current_user()->check_level(User::ADMIN_LEVEL); $number_admins = UserService::count_admin_members(); $suggestions = array(); try { $result = PersistenceContext::get_querier()->select("SELECT user_id, display_name, level, groups FROM " . DB_TABLE_MEMBER . " WHERE display_name LIKE '" . str_replace('*', '%', $request->get_value('value', '')) . "%'"); while ($row = $result->fetch()) { $user_group_color = User::get_group_color($row['groups'], $row['level']); $suggestion = ''; if ($is_admin) { $edit_link = new LinkHTMLElement(UserUrlBuilder::edit_profile($row['user_id']), '', array('title' => $lang['edit']), 'fa fa-edit'); if ($row['level'] != User::ADMIN_LEVEL || $row['level'] == User::ADMIN_LEVEL && $number_admins > 1) { $delete_link = new LinkHTMLElement(AdminMembersUrlBuilder::delete($row['user_id']), '', array('title' => $lang['delete'], 'data-confirmation' => 'delete-element'), 'fa fa-delete'); } else { $delete_link = new LinkHTMLElement('', '', array('title' => $lang['delete'], 'onclick' => 'return false;'), 'fa fa-delete icon-disabled'); } $suggestion .= $edit_link->display() . ' ' . $delete_link->display() . ' '; } $profile_link = new LinkHTMLElement(UserUrlBuilder::profile($row['user_id'])->rel(), $row['display_name'], array('style' => !empty($user_group_color) ? 'color:' . $user_group_color : ''), UserService::get_level_class($row['level'])); $suggestion .= $profile_link->display(); $suggestions[] = $suggestion; } $result->dispose(); } catch (Exception $e) { } return new JSONResponse(array('suggestions' => $suggestions)); }
private function init() { $this->tpl = new StringTemplate('# INCLUDE MSG # # INCLUDE FORM #'); $this->lang = LangLoader::get('admin-maintain-common'); $this->tpl->add_lang($this->lang); $this->maintenance_config = MaintenanceConfig::load(); }
private function init() { $this->lang = LangLoader::get('user-common'); $this->tpl = new StringTemplate('# INCLUDE MSG # # INCLUDE FORM #'); $this->tpl->add_lang($this->lang); $this->user_accounts_config = UserAccountsConfig::load(); }
private function init() { $this->current_user = AppContext::get_current_user(); $this->lang = LangLoader::get('common', 'shoutbox'); $this->view = new FileTemplate('shoutbox/ShoutboxHomeController.tpl'); $this->view->add_lang($this->lang); }
private function build_form() { $form = new HTMLForm(__CLASS__); //Configuration $fieldset = new FormFieldsetHTML('configuration_fieldset', LangLoader::get_message('configuration', 'admin-common')); $form->add_fieldset($fieldset); $fieldset->add_field(new FormFieldNumberEditor('items_number_per_page', $this->lang['calendar.config.items_number_per_page'], $this->config->get_items_number_per_page(), array('min' => 1, 'max' => 50, 'required' => true), array(new FormFieldConstraintIntegerRange(1, 50)))); $fieldset->add_field(new FormFieldCheckbox('comments_enabled', LangLoader::get_message('config.comments_enabled', 'admin-common'), $this->config->are_comments_enabled())); $fieldset->add_field(new FormFieldColorPicker('event_color', $this->lang['calendar.config.event_color'], $this->config->get_event_color(), array(), array(new FormFieldConstraintRegex('`^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$`i')))); $fieldset->add_field(new FormFieldCheckbox('members_birthday_enabled', $this->lang['calendar.config.members_birthday_enabled'], $this->config->is_members_birthday_enabled(), array('events' => array('click' => ' if (HTMLForms.getField("members_birthday_enabled").getValue()) { HTMLForms.getField("birthday_color").enable(); } else { HTMLForms.getField("birthday_color").disable(); }')))); $user_born_field = ExtendedFieldsCache::load()->get_extended_field_by_field_name('user_born'); if (!empty($user_born_field) && !$user_born_field['display']) { $fieldset->add_field(new FormFieldHTML('user_born_disabled_msg', MessageHelper::display($this->lang['calendar.error.e_user_born_field_disabled'], MessageHelper::WARNING)->render())); } $fieldset->add_field(new FormFieldColorPicker('birthday_color', $this->lang['calendar.config.birthday_color'], $this->config->get_birthday_color(), array('hidden' => !$this->config->is_members_birthday_enabled()), array(new FormFieldConstraintRegex('`^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$`i')))); $common_lang = LangLoader::get('common'); $fieldset = new FormFieldsetHTML('authorizations_fieldset', $common_lang['authorizations'], array('description' => LangLoader::get_message('config.authorizations.explain', 'admin-common'))); $form->add_fieldset($fieldset); $auth_settings = new AuthorizationsSettings(array(new ActionAuthorization($common_lang['authorizations.read'], Category::READ_AUTHORIZATIONS), new ActionAuthorization($common_lang['authorizations.write'], Category::WRITE_AUTHORIZATIONS), new ActionAuthorization($common_lang['authorizations.contribution'], Category::CONTRIBUTION_AUTHORIZATIONS), new ActionAuthorization($common_lang['authorizations.moderation'], Category::MODERATION_AUTHORIZATIONS))); $auth_setter = new FormFieldAuthorizationsSetter('authorizations', $auth_settings); $auth_settings->build_from_auth_array($this->config->get_authorizations()); $fieldset->add_field($auth_setter); //Submit and reset buttons $this->submit_button = new FormButtonDefaultSubmit(); $form->add_button($this->submit_button); $form->add_button(new FormButtonReset()); $this->form = $form; }
private function init() { $this->lang = LangLoader::get('common', 'newsletter'); $this->view = new FileTemplate('newsletter/NewsletterSubscribersListController.tpl'); $this->view->add_lang($this->lang); $this->user = AppContext::get_current_user(); }
private function init() { $this->user = AppContext::get_current_user(); $this->tpl = new FileTemplate('user/UserMessagesController.tpl'); $this->lang = LangLoader::get('user-common'); $this->tpl->add_lang($this->lang); }
/** * @var bool */ public function __construct() { $this->lang = LangLoader::get('user-common'); $this->field_used_once = false; $this->field_used_phpboost_config = false; $this->name = 'ExtendedField'; }
private function init() { $this->lang = LangLoader::get('user-common'); $this->view = new FileTemplate('user/UserUsersListController.tpl'); $this->view->add_lang($this->lang); $this->groups_cache = GroupsCache::load(); }
private function init(HTTPRequestCustom $request) { $this->lang = LangLoader::get('common', 'contact'); $this->admin_user_common_lang = LangLoader::get('admin-user-common'); $this->config = ContactConfig::load(); $this->id = $request->get_getint('id', 0); }
private function build_form() { $form = new HTMLForm(__CLASS__); $fieldset = new FormFieldsetHTML('config', $this->admin_common_lang['configuration']); $form->add_fieldset($fieldset); $fieldset->add_field(new FormFieldNumberEditor('items_per_page', $this->admin_common_lang['config.items_number_per_page'], $this->config->get_items_per_page(), array('min' => 1, 'max' => 50, 'required' => true), array(new FormFieldConstraintIntegerRange(1, 50)))); $fieldset->add_field(new FormFieldMultipleSelectChoice('forbidden_tags', $this->admin_common_lang['config.forbidden-tags'], $this->config->get_forbidden_tags(), $this->generate_forbidden_tags_option(), array('size' => 10))); $fieldset->add_field(new FormFieldCheckbox('max_links_number_per_message_enabled', $this->lang['admin.config.max_links_number_per_message_enabled'], $this->config->is_max_links_number_per_message_enabled(), array('events' => array('click' => ' if (HTMLForms.getField("max_links_number_per_message_enabled").getValue()) { HTMLForms.getField("max_links_number_per_message").enable(); } else { HTMLForms.getField("max_links_number_per_message").disable(); }')))); $fieldset->add_field(new FormFieldNumberEditor('max_links_number_per_message', $this->lang['admin.config.max_links'], $this->config->get_maximum_links_message(), array('min' => 1, 'max' => 20, 'required' => true, 'hidden' => !$this->config->is_max_links_number_per_message_enabled()), array(new FormFieldConstraintIntegerRange(1, 20)))); $common_lang = LangLoader::get('common'); $fieldset_authorizations = new FormFieldsetHTML('authorizations', $common_lang['authorizations']); $form->add_fieldset($fieldset_authorizations); $auth_settings = new AuthorizationsSettings(array(new ActionAuthorization($this->lang['admin.authorizations.read'], GuestbookAuthorizationsService::READ_AUTHORIZATIONS), new ActionAuthorization($common_lang['authorizations.write'], GuestbookAuthorizationsService::WRITE_AUTHORIZATIONS), new ActionAuthorization($common_lang['authorizations.moderation'], GuestbookAuthorizationsService::MODERATION_AUTHORIZATIONS))); $auth_settings->build_from_auth_array($this->config->get_authorizations()); $fieldset_authorizations->add_field(new FormFieldAuthorizationsSetter('authorizations', $auth_settings)); $this->submit_button = new FormButtonDefaultSubmit(); $form->add_button($this->submit_button); $form->add_button(new FormButtonReset()); $this->form = $form; }
function execute(HTTPRequestCustom $request) { // Define template $this->views = new FileTemplate('wpimport/import.tpl'); // Load lang $this->lang = LangLoader::get('common', 'wpimport'); // Add lang $this->views->add_lang($this->lang); // Build Form $this->build_form(); // Add Form to template $this->views->put('FORM', $this->form->display()); // Check max_execution_time $maxExecutionTime = ini_get('max_execution_time'); $this->views->put('CAN_SET_EXECUTION_TIME', false); $this->views->put('MAX_EXECUTION_TIME', $maxExecutionTime); @ini_set('max_execution_time', 0); if (ini_get('max_execution_time') == 0) { $this->views->put('CAN_SET_EXECUTION_TIME', true); } if ($this->submit_button->has_been_submited() && $this->form->validate()) { $importer = array(); $listImporter = self::listImporters(); foreach ($listImporter as $i) { if ($this->form->get_field_by_id('importer_' . $i['name'])->get_value()) { $importer[] = $i['name']; } } session_start(); $_SESSION['wpimport'] = array('phpboostpath' => $this->form->get_field_by_id('phpboostpath')->get_value(), 'wppath' => $this->form->get_field_by_id('wppath')->get_value(), 'default_author' => $this->form->get_field_by_id('default_author')->get_value(), 'default_cat_image' => $this->form->get_field_by_id('default_cat_image')->get_value(), 'import_location' => $this->form->get_field_by_id('import_location')->get_value(), 'importer' => implode(',', $importer)); AppContext::get_response()->redirect(DispatchManager::get_url('../wpimport', '/admin/import/start')); } return $this->build_response(); }
private function init() { $this->lang = LangLoader::get('common', 'news'); $this->tpl = new FileTemplate('news/NewsDisplaySeveralNewsController.tpl'); $this->tpl->add_lang($this->lang); $this->config = NewsConfig::load(); }
private function init() { $this->lang = LangLoader::get('admin-user-common'); $this->view = new FileTemplate('contact/AdminContactFieldsListController.tpl'); $this->view->add_lang($this->lang); $this->config = ContactConfig::load(); }
private function insert_data() { $lang = LangLoader::get('install', 'bugtracker'); PersistenceContext::get_querier()->insert(self::$bugtracker_table, array('id' => 1, 'title' => $lang['bug.1.title'], 'contents' => $lang['bug.1.contents'], 'author_id' => 1, 'submit_date' => time(), 'fix_date' => 0, 'status' => Bug::NEW_BUG, 'severity' => 1, 'priority' => 3, 'type' => 1, 'category' => 1, 'reproductible' => 1, 'reproduction_method' => '', 'detected_in' => 0, 'fixed_in' => 0, 'assigned_to_id' => 0)); PersistenceContext::get_querier()->insert(self::$bugtracker_table, array('id' => 2, 'title' => $lang['bug.2.title'], 'contents' => $lang['bug.2.contents'], 'author_id' => 1, 'submit_date' => time() - 1000, 'fix_date' => time(), 'status' => Bug::FIXED, 'severity' => 2, 'priority' => 4, 'type' => 1, 'category' => 2, 'reproductible' => 1, 'reproduction_method' => '', 'detected_in' => 0, 'fixed_in' => 0, 'assigned_to_id' => 0)); PersistenceContext::get_querier()->insert(self::$bugtracker_table, array('id' => 3, 'title' => $lang['bug.3.title'], 'contents' => $lang['bug.3.contents'], 'author_id' => 1, 'submit_date' => time(), 'fix_date' => 0, 'status' => Bug::REOPEN, 'severity' => 3, 'priority' => 5, 'type' => 1, 'category' => 3, 'reproductible' => 1, 'reproduction_method' => '', 'detected_in' => 0, 'fixed_in' => 0, 'assigned_to_id' => 0)); }
private function init() { $this->lang = LangLoader::get('admin-contents-common'); $this->content_formatting_config = ContentFormattingConfig::load(); $this->content_management_config = ContentManagementConfig::load(); $this->user_accounts_config = UserAccountsConfig::load(); }
private function init() { $this->lang = LangLoader::get('common', 'online'); $this->view = new FileTemplate('online/OnlineHomeController.tpl'); $this->view->add_lang($this->lang); $this->config = OnlineConfig::load(); }
public static function send_email_confirmation($user_id, $email, $pseudo, $login, $password, $registration_pass) { $lang = LangLoader::get('user-common'); $user_accounts_config = UserAccountsConfig::load(); $general_config = GeneralConfig::load(); $site_name = $general_config->get_site_name(); $subject = StringVars::replace_vars($lang['registration.subject-mail'], array('site_name' => $site_name)); switch ($user_accounts_config->get_member_accounts_validation_method()) { case UserAccountsConfig::AUTOMATIC_USER_ACCOUNTS_VALIDATION: $parameters = array('pseudo' => $pseudo, 'site_name' => $site_name, 'host' => $general_config->get_site_url(), 'login' => $login, 'password' => $password, 'accounts_validation_explain' => $lang['registration.email.automatic-validation'], 'signature' => MailServiceConfig::load()->get_mail_signature()); $content = StringVars::replace_vars($lang['registration.content-mail'], $parameters); AppContext::get_mail_service()->send_from_properties($email, $subject, $content); break; case UserAccountsConfig::MAIL_USER_ACCOUNTS_VALIDATION: $parameters = array('pseudo' => $pseudo, 'site_name' => $site_name, 'host' => $general_config->get_site_url(), 'login' => $login, 'password' => $password, 'accounts_validation_explain' => StringVars::replace_vars($lang['registration.email.mail-validation'], array('validation_link' => UserUrlBuilder::confirm_registration($registration_pass)->absolute())), 'signature' => MailServiceConfig::load()->get_mail_signature()); $content = StringVars::replace_vars($lang['registration.content-mail'], $parameters); AppContext::get_mail_service()->send_from_properties($email, $subject, $content); break; case UserAccountsConfig::ADMINISTRATOR_USER_ACCOUNTS_VALIDATION: $alert = new AdministratorAlert(); $alert->set_entitled($lang['registration.pending-approval']); $alert->set_fixing_url(UserUrlBuilder::edit_profile($user_id)->relative()); $alert->set_priority(AdministratorAlert::ADMIN_ALERT_MEDIUM_PRIORITY); $alert->set_id_in_module($user_id); $alert->set_type('member_account_to_approbate'); AdministratorAlertService::save_alert($alert); $parameters = array('pseudo' => $pseudo, 'site_name' => $site_name, 'host' => $general_config->get_site_url(), 'login' => $login, 'password' => $password, 'accounts_validation_explain' => $lang['registration.email.administrator-validation'], 'signature' => MailServiceConfig::load()->get_mail_signature()); $content = StringVars::replace_vars($lang['registration.content-mail'], $parameters); AppContext::get_mail_service()->send_from_properties($email, $subject, $content); break; } }
private function init() { $this->lang = LangLoader::get('common', 'contact'); $this->view = new FileTemplate('contact/ContactController.tpl'); $this->view->add_lang($this->lang); $this->config = ContactConfig::load(); }
private function init() { $this->lang = LangLoader::get('user-common'); $this->tpl = new StringTemplate('# INCLUDE FORM #'); $this->tpl->add_lang($this->lang); $this->user = AppContext::get_current_user(); }
private static function get_subheader_tpl() { $subheader_lang = LangLoader::get('admin-links-common'); $subheader_tpl = new FileTemplate('admin/subheader_menu.tpl'); $subheader_tpl->add_lang($subheader_lang); $modules = ModulesManager::get_activated_modules_map_sorted_by_localized_name(); $modules_number = 0; foreach ($modules as $module) { if ($module->get_configuration()->get_admin_menu() == 'modules') { $modules_number++; } } $subheader_tpl->put_all(array('L_ADD' => $subheader_lang['add'], 'L_ADMINISTRATION' => $subheader_lang['administration'], 'L_MANAGEMENT' => $subheader_lang['management'], 'L_CONFIGURATION' => $subheader_lang['configuration'], 'L_CONFIG_GENERAL' => $subheader_lang['administration.configuration.general'], 'L_CONFIG_ADVANCED' => $subheader_lang['administration.configuration.advanced'], 'L_MAIL_CONFIG' => $subheader_lang['administration.configuration.mail'], 'L_THEMES' => $subheader_lang['administration.themes'], 'L_LANGS' => $subheader_lang['administration.langs'], 'L_SMILEY' => $subheader_lang['administration.smileys'], 'L_ADMINISTRATOR_ALERTS' => $subheader_lang['administration.alerts'], 'L_TOOLS' => $subheader_lang['tools'], 'L_UPDATES' => $subheader_lang['updates'], 'L_KERNEL' => $subheader_lang['tools.updates.kernel'], 'L_MAINTAIN' => $subheader_lang['tools.maintain'], 'L_CACHE' => $subheader_lang['tools.cache'], 'L_SYNDICATION_CACHE' => $subheader_lang['tools.cache.syndication'], 'L_CSS_CACHE_CONFIG' => $subheader_lang['tools.cache.css'], 'L_ERRORS' => $subheader_lang['tools.errors-archived'], 'L_404_ERRORS' => $subheader_lang['tools.404-errors-archived'], 'L_SERVER' => $subheader_lang['tools.server'], 'L_PHPINFO' => $subheader_lang['tools.server.phpinfo'], 'L_SYSTEM_REPORT' => $subheader_lang['tools.server.system-report'], 'L_USER' => $subheader_lang['users'], 'L_PUNISHEMENT' => $subheader_lang['users.punishement'], 'L_GROUP' => $subheader_lang['users.groups'], 'L_EXTEND_FIELD' => $subheader_lang['users.extended-fields'], 'L_CONTENT' => $subheader_lang['content'], 'L_CONTENT_CONFIG' => $subheader_lang['content'], 'L_MENUS' => $subheader_lang['content.menus'], 'L_ADD_CONTENT_MENU' => $subheader_lang['content.menus.content'], 'L_ADD_LINKS_MENU' => $subheader_lang['content.menus.links'], 'L_ADD_FEED_MENU' => $subheader_lang['content.menus.feed'], 'L_FILES' => $subheader_lang['content.files'], 'L_COMMENTS' => $subheader_lang['content.comments'], 'L_MODULES' => $subheader_lang['modules'], 'U_NBR_MODULES' => ceil(($modules_number + 1) / 7), 'U_INDEX_SITE' => Environment::get_home_page(), 'C_ADMIN_LINKS_1' => false, 'C_ADMIN_LINKS_2' => false, 'C_ADMIN_LINKS_3' => false, 'C_ADMIN_LINKS_4' => false, 'C_ADMIN_LINKS_5' => false, 'C_ADMIN_LINKS_1' => false)); $array_pos = array(0, 4, 4, 3, 3, 1); $menus_numbers = array('index' => 1, 'administration' => 2, 'tools' => 3, 'members' => 4, 'content' => 5, 'modules' => 6); foreach ($modules as $module) { $module_id = $module->get_id(); $configuration = $module->get_configuration(); $menu_pos_name = $configuration->get_admin_menu(); $menu_pos = 0; if (!empty($menu_pos_name) && !empty($menus_numbers[$menu_pos_name])) { $menu_pos = $menus_numbers[$menu_pos_name]; } if ($menu_pos > 0) { $array_pos[$menu_pos - 1]++; $idmenu = $array_pos[$menu_pos - 1]; $subheader_tpl->put('C_ADMIN_LINKS_' . $menu_pos, true); $subheader_tpl->assign_block_vars('admin_links_' . $menu_pos, array('MODULE_MENU' => ModuleTreeLinksService::display_admin_actions_menu($module))); } } return $subheader_tpl; }
protected function load_lang(HTTPRequestCustom $request) { $locale = TextHelper::htmlspecialchars($request->get_string('lang', UpdateController::DEFAULT_LOCALE)); LangLoader::set_locale($locale); UpdateUrlBuilder::set_locale($locale); $this->lang = LangLoader::get('update', 'update'); }
public function __construct() { parent::__construct(); $this->lang = LangLoader::get('admin-user-common'); $this->set_disable_fields_configuration(array('possible_values')); $this->set_name(LangLoader::get_message('type.short-text', 'admin-user-common')); }
private function init() { $this->current_user = AppContext::get_current_user(); $this->lang = LangLoader::get('common', 'guestbook'); $this->view = new FileTemplate('guestbook/GuestbookController.tpl'); $this->view->add_lang($this->lang); }
public static function add_filter_fieldset(Menu $menu, Template $tpl) { $tpl_filter = new FileTemplate('admin/menus/filters.tpl'); $tpl_filter->assign_block_vars('modules', array('ID' => '')); foreach (ModulesManager::get_activated_modules_map_sorted_by_localized_name() as $module) { $configuration = $module->get_configuration(); $home_page = $configuration->get_home_page(); if (!empty($home_page)) { $tpl_filter->assign_block_vars('modules', array('ID' => $module->get_id())); } } //Ajout du menu if ($menu->get_id() == '') { $menu->set_filters(array(new MenuStringFilter('/'))); } // Installed modules foreach ($menu->get_filters() as $key => $filter) { $filter_pattern = $filter->get_pattern(); $filter_infos = explode('/', $filter_pattern); $module_name = $filter_infos[0]; $regex = substr(strstr($filter_pattern, '/'), 1); $tpl_filter->assign_block_vars('filters', array('ID' => $key, 'FILTER' => $regex)); $tpl_filter->assign_block_vars('filters.modules', array('ID' => '', 'SELECTED' => $filter_pattern == '/' ? ' selected="selected"' : '')); foreach (ModulesManager::get_activated_modules_map_sorted_by_localized_name() as $module) { $configuration = $module->get_configuration(); $home_page = $configuration->get_home_page(); if (!empty($home_page)) { $tpl_filter->assign_block_vars('filters.modules', array('ID' => $module->get_id(), 'SELECTED' => $module_name == $module->get_id() ? ' selected="selected"' : '')); } } } $tpl_filter->add_lang(LangLoader::get('admin-menus-common')); $tpl_filter->put_all(array('NBR_FILTER' => $menu->get_id() == '' ? 0 : count($menu->get_filters()) - 1)); $tpl->put('filters', $tpl_filter); }
public function get_menu_content() { $tpl = new FileTemplate('calendar/CalendarModuleMiniMenu.tpl'); $tpl->add_lang(LangLoader::get('common', 'calendar')); $tpl->put('CALENDAR', CalendarAjaxCalendarController::get_view(true)); return $tpl->render(); }
private function get_module_map($auth_mode) { $lang = LangLoader::get('common', 'bugtracker'); $config = BugtrackerConfig::load(); $current_user = AppContext::get_current_user(); $link = new SitemapLink($lang['module_title'], BugtrackerUrlBuilder::home(), Sitemap::FREQ_DEFAULT, Sitemap::PRIORITY_MAX); $module_map = new ModuleMap($link, 'bugtracker'); if ($auth_mode == Sitemap::AUTH_PUBLIC) { $this_auth = Authorizations::check_auth(RANK_TYPE, User::VISITOR_LEVEL, $config->get_authorizations(), BugtrackerAuthorizationsService::READ_AUTHORIZATIONS); } else { if ($auth_mode == Sitemap::AUTH_USER) { if ($current_user->get_level() == User::ADMIN_LEVEL) { $this_auth = true; } else { $this_auth = Authorizations::check_auth(RANK_TYPE, $current_user->get_level(), $config->get_authorizations(), BugtrackerAuthorizationsService::READ_AUTHORIZATIONS); } } } if ($this_auth) { $module_map->add(new SitemapLink($lang['titles.unsolved'], BugtrackerUrlBuilder::unsolved())); $module_map->add(new SitemapLink($lang['titles.solved'], BugtrackerUrlBuilder::solved())); if ($config->is_roadmap_enabled() && $config->get_versions()) { $module_map->add(new SitemapLink($lang['titles.roadmap'], BugtrackerUrlBuilder::roadmap())); } $module_map->add(new SitemapLink($lang['titles.stats'], BugtrackerUrlBuilder::stats())); } return $module_map; }
private function init() { $this->lang = LangLoader::get('common', 'articles'); $this->tpl = new FileTemplate('articles/ArticlesFormController.tpl'); $this->tpl->add_lang($this->lang); $this->common_lang = LangLoader::get('common'); }
private static function build_countries() { $lang = LangLoader::get('countries'); foreach (self::$countries_identifier as $country_identifier) { self::$countries[$country_identifier] = array('name' => $lang[$country_identifier], 'picture' => self::$pictures_path . $country_identifier . self::$pictures_extension); } }