本文整理汇总了PHP中LangLoader类的典型用法代码示例。如果您正苦于以下问题:PHP LangLoader类的具体用法?PHP LangLoader怎么用?PHP LangLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LangLoader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __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';
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:10,代码来源:AbstractMemberExtendedField.class.php
示例2: get_menu_content
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();
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:CalendarModuleMiniMenu.class.php
示例3: execute
public function execute(HTTPRequestCustom $request)
{
AppContext::get_session()->csrf_get_protect();
$config = BugtrackerConfig::load();
$parameter = $request->get_string('parameter', '');
if (in_array($parameter, array('type', 'category', 'severity', 'priority', 'version'))) {
switch ($parameter) {
case 'type':
$config->set_default_type(0);
break;
case 'category':
$config->set_default_category(0);
break;
case 'severity':
$config->set_default_severity(0);
break;
case 'priority':
$config->set_default_priority(0);
break;
case 'version':
$config->set_default_version(0);
break;
}
BugtrackerConfig::save();
AppContext::get_response()->redirect(BugtrackerUrlBuilder::configuration());
} else {
$controller = new UserErrorController(LangLoader::get_message('error', 'status-messages-common'), LangLoader::get_message('error.e_unexist_parameter', 'common', 'bugtracker'));
$controller->set_response_classname(UserErrorController::ADMIN_RESPONSE);
DispatchManager::redirect($controller);
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:AdminBugtrackerDeleteDefaultParameterController.class.php
示例4: load_lang
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');
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:UpdateController.class.php
示例5: init
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);
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:GuestbookController.class.php
示例6: execute
public function execute(HTTPRequestCustom $request)
{
$id = $request->get_getint('id', 0);
if (!empty($id) && AppContext::get_current_user()->check_level(User::MEMBER_LEVEL)) {
try {
$this->downloadfile = DownloadService::get_downloadfile('WHERE download.id = :id', array('id' => $id));
} catch (RowNotFoundException $e) {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
}
if ($this->downloadfile !== null && $this->downloadfile->is_visible()) {
if (!PersistenceContext::get_querier()->row_exists(PREFIX . 'events', 'WHERE id_in_module=:id_in_module AND module=\'download\' AND current_status = 0', array('id_in_module' => $this->downloadfile->get_id()))) {
$contribution = new Contribution();
$contribution->set_id_in_module($this->downloadfile->get_id());
$contribution->set_entitled(StringVars::replace_vars(LangLoader::get_message('contribution.deadlink', 'common'), array('link_name' => $this->downloadfile->get_name())));
$contribution->set_fixing_url(DownloadUrlBuilder::edit($this->downloadfile->get_id())->relative());
$contribution->set_description(LangLoader::get_message('contribution.deadlink_explain', 'common'));
$contribution->set_poster_id(AppContext::get_current_user()->get_id());
$contribution->set_module('download');
$contribution->set_type('alert');
$contribution->set_auth(Authorizations::capture_and_shift_bit_auth(DownloadService::get_categories_manager()->get_heritated_authorizations($this->downloadfile->get_id_category(), Category::MODERATION_AUTHORIZATIONS, Authorizations::AUTH_CHILD_PRIORITY), Category::MODERATION_AUTHORIZATIONS, Contribution::CONTRIBUTION_AUTH_BIT));
ContributionService::save_contribution($contribution);
}
DispatchManager::redirect(new UserContributionSuccessController());
} else {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:30,代码来源:DownloadDeadLinkController.class.php
示例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();
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:NewsletterSubscribersListController.class.php
示例8: get_subheader_tpl
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;
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:32,代码来源:AdminDisplayGraphicalEnvironment.class.php
示例9: __construct
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'));
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:MemberShortTextExtendedField.class.php
示例10: init
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();
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:ContactController.class.php
示例11: build_table
private function build_table()
{
$table_model = new SQLHTMLTableModel(CalendarSetup::$calendar_events_table, 'table', array(new HTMLTableColumn(LangLoader::get_message('form.title', 'common'), 'title'), new HTMLTableColumn(LangLoader::get_message('category', 'categories-common'), 'id_category'), new HTMLTableColumn(LangLoader::get_message('author', 'common'), 'display_name'), new HTMLTableColumn(LangLoader::get_message('date', 'date-common'), 'start_date'), new HTMLTableColumn($this->lang['calendar.titles.repetition']), new HTMLTableColumn(LangLoader::get_message('status.approved', 'common'), 'approved'), new HTMLTableColumn('')), new HTMLTableSortingRule('start_date', HTMLTableSortingRule::DESC));
$table = new HTMLTable($table_model);
$table_model->set_caption($this->lang['calendar.config.events.management']);
$table_model->add_permanent_filter('parent_id = 0');
$results = array();
$result = $table_model->get_sql_results('event
LEFT JOIN ' . CalendarSetup::$calendar_events_content_table . ' event_content ON event_content.id = event.content_id
LEFT JOIN ' . DB_TABLE_MEMBER . ' member ON member.user_id = event_content.author_id');
foreach ($result as $row) {
$event = new CalendarEvent();
$event->set_properties($row);
$category = $event->get_content()->get_category();
$user = $event->get_content()->get_author_user();
$edit_link = new LinkHTMLElement(CalendarUrlBuilder::edit_event(!$event->get_parent_id() ? $event->get_id() : $event->get_parent_id()), '', array('title' => LangLoader::get_message('edit', 'common')), 'fa fa-edit');
$delete_link = new LinkHTMLElement(CalendarUrlBuilder::delete_event($event->get_id()), '', array('title' => LangLoader::get_message('delete', 'common'), 'data-confirmation' => !$event->belongs_to_a_serie() ? 'delete-element' : ''), 'fa fa-delete');
$user_group_color = User::get_group_color($user->get_groups(), $user->get_level(), true);
$author = $user->get_id() !== User::VISITOR_LEVEL ? new LinkHTMLElement(UserUrlBuilder::profile($user->get_id()), $user->get_display_name(), !empty($user_group_color) ? array('style' => 'color: ' . $user_group_color) : array(), UserService::get_level_class($user->get_level())) : $user->get_display_name();
$br = new BrHTMLElement();
$results[] = new HTMLTableRow(array(new HTMLTableRowCell(new LinkHTMLElement(CalendarUrlBuilder::display_event($category->get_id(), $category->get_rewrited_name(), $event->get_id(), $event->get_content()->get_rewrited_title()), $event->get_content()->get_title()), 'left'), new HTMLTableRowCell(new SpanHTMLElement($category->get_name(), array('style' => $category->get_id() != Category::ROOT_CATEGORY && $category->get_color() ? 'color:' . $category->get_color() : ''))), new HTMLTableRowCell($author), new HTMLTableRowCell(LangLoader::get_message('from_date', 'main') . ' ' . $event->get_start_date()->format(Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE) . $br->display() . LangLoader::get_message('to_date', 'main') . ' ' . $event->get_end_date()->format(Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE)), new HTMLTableRowCell($event->belongs_to_a_serie() ? $this->lang['calendar.labels.repeat.' . $event->get_content()->get_repeat_type()] . ' - ' . $event->get_content()->get_repeat_number() . ' ' . $this->lang['calendar.labels.repeat_times'] : LangLoader::get_message('no', 'common')), new HTMLTableRowCell($event->get_content()->is_approved() ? LangLoader::get_message('yes', 'common') : LangLoader::get_message('no', 'common')), new HTMLTableRowCell($edit_link->display() . $delete_link->display())));
}
$table->set_rows($table_model->get_number_of_matching_rows(), $results);
$this->view->put('table', $table->display());
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:25,代码来源:AdminCalendarManageEventsController.class.php
示例12: display_profile_fields
/**
* @desc This function displayed fields profile
* @param object $member_extended_field MemberExtendedField containing user_id, Template and field_type.
*/
public static function display_profile_fields(HTMLForm $form, $user_id)
{
$extended_fields_displayed = PersistenceContext::get_querier()->row_exists(DB_TABLE_MEMBER_EXTENDED_FIELDS_LIST, 'WHERE display=1');
if ($extended_fields_displayed) {
$fieldset = new FormFieldsetHTML('other', LangLoader::get_message('other', 'main'));
$nbr_field = 0;
$result = PersistenceContext::get_querier()->select("SELECT exc.name, exc.description, exc.field_type, exc.required, exc.field_name, exc.possible_values, exc.default_value, exc.auth, exc.regex, ex.*\r\n\t\t\tFROM " . DB_TABLE_MEMBER_EXTENDED_FIELDS_LIST . " exc\r\n\t\t\tLEFT JOIN " . DB_TABLE_MEMBER_EXTENDED_FIELDS . " ex ON ex.user_id = :user_id\r\n\t\t\tWHERE exc.display = 1\r\n\t\t\tORDER BY exc.position", array('user_id' => $user_id));
while ($extended_field = $result->fetch()) {
if (AppContext::get_current_user()->check_auth(unserialize($extended_field['auth']), ExtendedField::READ_PROFILE_AUTHORIZATION)) {
$value = !empty($extended_field[$extended_field['field_name']]) ? $extended_field[$extended_field['field_name']] : $extended_field['default_value'];
$extended_field['value'] = $value;
$member_extended_field = new MemberExtendedField();
$member_extended_field->set_user_id($user_id);
$member_extended_field->set_fieldset($fieldset);
$member_extended_field->set_properties($extended_field);
$member_extended_field->get_instance()->display_field_profile($member_extended_field);
$nbr_field++;
}
}
if ($nbr_field > 0) {
$form->add_fieldset($fieldset);
}
$result->dispose();
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:29,代码来源:MemberExtendedFieldsService.class.php
示例13: init
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();
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:OnlineHomeController.class.php
示例14: insert_data
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));
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:BugtrackerSetup.class.php
示例15: 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;
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:33,代码来源:AdminCalendarConfigController.class.php
示例16: add_filter_fieldset
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);
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:35,代码来源:MenuAdminService.class.php
示例17: __construct
public function __construct($title, $message, $error_type = self::QUESTION)
{
$this->title = $title;
$this->message = $message;
$this->error_type = $error_type;
$this->link_name = LangLoader::get_message('back', 'main');
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:UserErrorController.class.php
示例18: get_module_map
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;
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:28,代码来源:BugtrackerSitemapExtensionPoint.class.php
示例19: send_email_confirmation
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;
}
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:32,代码来源:UserRegistrationService.class.php
示例20: build_form
private function build_form()
{
$security_config = SecurityConfig::load();
$this->form = new HTMLForm('adminForm', '', false);
$fieldset = new FormFieldsetHTML('adminAccount', $this->lang['admin.account']);
$this->form->add_fieldset($fieldset);
$fieldset->add_field(new FormFieldTextEditor('display_name', LangLoader::get_message('display_name', 'user-common'), '', array('maxlength' => 100, 'required' => true, 'events' => array('blur' => '
if (!HTMLForms.getField("login").getValue() && HTMLForms.getField("display_name").validate() == "") {
HTMLForms.getField("login").setValue(HTMLForms.getField("display_name").getValue().replace(/\\s/g, \'\'));
HTMLForms.getField("login").enableValidationMessage();
HTMLForms.getField("login").liveValidate();
}')), array(new FormFieldConstraintLengthRange(3, 100, $this->lang['admin.login.length']))));
$fieldset->add_field(new FormFieldMailEditor('email', $this->lang['admin.email'], '', array('required' => true)));
$fieldset->add_field(new FormFieldCheckbox('custom_login', LangLoader::get_message('login.custom', 'user-common'), false, array('description' => LangLoader::get_message('login.custom.explain', 'user-common'), 'events' => array('click' => '
if (HTMLForms.getField("custom_login").getValue()) {
HTMLForms.getField("login").enable();
} else {
HTMLForms.getField("login").disable();
}'))));
$fieldset->add_field(new FormFieldTextEditor('login', LangLoader::get_message('login', 'user-common'), '', array('required' => true, 'hidden' => true, 'maxlength' => 25), array(new FormFieldConstraintLengthRange(3, 25), new FormFieldConstraintPHPBoostAuthLoginExists())));
$fieldset->add_field($password = new FormFieldPasswordEditor('password', $this->lang['admin.password'], '', array('description' => StringVars::replace_vars($this->lang['admin.password.explanation'], array('number' => $security_config->get_internal_password_min_length())), 'required' => true), array(new FormFieldConstraintLengthMin($security_config->get_internal_password_min_length(), StringVars::replace_vars($this->lang['admin.password.length'], array('number' => $security_config->get_internal_password_min_length()))), new FormFieldConstraintPasswordStrength())));
$fieldset->add_field($repeatPassword = new FormFieldPasswordEditor('repeatPassword', $this->lang['admin.password.repeat'], '', array('required' => true), array(new FormFieldConstraintLengthMin($security_config->get_internal_password_min_length()), new FormFieldConstraintPasswordStrength())));
$this->form->add_constraint(new FormConstraintFieldsEquality($password, $repeatPassword));
$fieldset->add_field(new FormFieldCheckbox('createSession', $this->lang['admin.connectAfterInstall'], true));
$fieldset->add_field(new FormFieldCheckbox('autoconnect', $this->lang['admin.autoconnect'], true));
$action_fieldset = new FormFieldsetSubmit('actions');
$back = new FormButtonLinkCssImg($this->lang['step.previous'], InstallUrlBuilder::website(), 'fa fa-arrow-left');
$action_fieldset->add_element($back);
$this->submit_button = new FormButtonSubmitCssImg($this->lang['step.next'], 'fa fa-arrow-right', 'admin');
$action_fieldset->add_element($this->submit_button);
$this->form->add_fieldset($action_fieldset);
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:32,代码来源:InstallCreateAdminController.class.php
注:本文中的LangLoader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论