本文整理汇总了PHP中LangLoader::get方法的典型用法代码示例。如果您正苦于以下问题:PHP LangLoader::get方法的具体用法?PHP LangLoader::get怎么用?PHP LangLoader::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LangLoader
的用法示例。
在下文中一共展示了LangLoader::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_search_form
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();
}
示例2: execute
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));
}
示例3: init
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();
}
示例4: init
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();
}
示例5: init
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);
}
示例6: build_form
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;
}
示例7: init
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();
}
示例8: init
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);
}
示例9: __construct
/**
* @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';
}
示例10: init
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();
}
示例11: init
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);
}
示例12: build_form
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;
}
示例13: execute
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();
}
示例14: init
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();
}
示例15: init
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();
}