本文整理汇总了PHP中phpbb\user::add_lang方法的典型用法代码示例。如果您正苦于以下问题:PHP user::add_lang方法的具体用法?PHP user::add_lang怎么用?PHP user::add_lang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpbb\user
的用法示例。
在下文中一共展示了user::add_lang方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Controller for /help/{mode} routes
*
* @param string $mode
* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
* @throws http_exception when the $mode is not known by any extension
*/
public function handle($mode)
{
switch ($mode) {
case 'faq':
case 'bbcode':
$page_title = $mode === 'faq' ? $this->user->lang['FAQ_EXPLAIN'] : $this->user->lang['BBCODE_GUIDE'];
$this->user->add_lang($mode, false, true);
break;
default:
$page_title = $this->user->lang['FAQ_EXPLAIN'];
$ext_name = $lang_file = '';
/**
* You can use this event display a custom help page
*
* @event core.faq_mode_validation
* @var string page_title Title of the page
* @var string mode FAQ that is going to be displayed
* @var string lang_file Language file containing the help data
* @var string ext_name Vendor and extension name where the help
* language file can be loaded from
* @since 3.1.4-RC1
*/
$vars = array('page_title', 'mode', 'lang_file', 'ext_name');
extract($this->dispatcher->trigger_event('core.faq_mode_validation', compact($vars)));
if ($ext_name === '' || $lang_file === '') {
throw new http_exception(404, 'Not Found');
}
$this->user->add_lang($lang_file, false, true, $ext_name);
break;
}
$this->template->assign_vars(array('L_FAQ_TITLE' => $page_title, 'S_IN_FAQ' => true));
$this->assign_to_template($this->user->help);
make_jumpbox(append_sid("{$this->root_path}viewforum.{$this->php_ext}"));
return $this->helper->render('faq_body.html', $page_title);
}
示例2: main
public function main($id, $mode)
{
global $config, $request, $template, $user;
$this->config = $config;
$this->request = $request;
$this->template = $template;
$this->user = $user;
$this->user->add_lang('acp/common');
$this->user->add_lang_ext('phpbbmodders/holidayflare', 'holidayflare_acp');
$this->tpl_name = 'acp_holidayflare';
$this->page_title = $this->user->lang('ACP_HOLIDAYFLARE');
$form_key = 'acp_holidayflare';
add_form_key($form_key);
if ($this->request->is_set_post('submit')) {
if (!check_form_key($form_key)) {
trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
}
/* XMAS Start */
$enable_xmas = $this->request->variable('enable_xmas', 0);
$this->config->set('enable_xmas', $enable_xmas);
/* XMAS Stop */
/* Valentine Start */
$enable_valentine = $this->request->variable('enable_valentine', 0);
$this->config->set('enable_valentine', $enable_valentine);
/* Valentine Stop */
trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
}
$this->template->assign_vars(array('S_ENABLE_XMAS' => isset($this->config['enable_xmas']) ? $this->config['enable_xmas'] : '', 'S_ENABLE_VALENTINE' => isset($this->config['enable_valentine']) ? $this->config['enable_valentine'] : '', 'U_ACTION' => $this->u_action));
}
示例3: main
public function main($id, $mode)
{
global $config, $request, $template, $user;
$this->config = $config;
$this->request = $request;
$this->template = $template;
$this->user = $user;
// Add the common lang file
$this->user->add_lang(array('acp/common'));
// Add the board snowstormlights ACP lang file
$this->user->add_lang_ext('prosk8er/snowstormlights', 'info_acp_snowstorm_lights');
// Load a template from adm/style for our ACP page
$this->tpl_name = 'snowstorm_lights';
// Set the page title for our ACP page
$this->page_title = $user->lang['ACP_SNOWSTORM_LIGHTS'];
// Define the name of the form for use as a form key
$form_key = 'acp_snowstorm_lights';
add_form_key($form_key);
// If form is submitted or previewed
if ($this->request->is_set_post('submit')) {
// Test if form key is valid
if (!check_form_key($form_key)) {
trigger_error('FORM_INVALID');
}
// Store the config enable/disable state
$scl_enabled = $this->request->variable('scl_enabled', 0);
$this->config->set('scl_enabled', $scl_enabled);
$snow_enabled = $request->variable('snow_enabled', 0);
$this->config->set('snow_enabled', $snow_enabled);
// Output message to user for the update
trigger_error($this->user->lang('SNOWSTORM_LIGHTS_SAVED') . adm_back_link($this->u_action));
}
// Output data to the template
$this->template->assign_vars(array('SCL_ENABLED' => isset($this->config['scl_enabled']) ? $this->config['scl_enabled'] : '', 'SNOW_ENABLED' => isset($this->config['snow_enabled']) ? $this->config['snow_enabled'] : '', 'U_ACTION' => $this->u_action));
}
示例4: main
public function main($id, $mode)
{
global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config;
$this->db = $db;
$this->user = $user;
$this->template = $template;
$this->request = $request;
$this->cache = $cache;
$this->auth = $auth;
$this->config = $config;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $phpEx;
$this->default_style = $config['default_style'];
$this->styles_path = $this->phpbb_root_path . $this->styles_path_absolute . '/';
$this->u_base_action = append_sid("{$phpbb_admin_path}index.{$this->php_ext}", "i={$id}");
$this->s_hidden_fields = array('mode' => $mode);
$this->user->add_lang('acp/styles');
$this->tpl_name = 'acp_styles';
$this->page_title = 'ACP_CAT_STYLES';
$this->mode = $mode;
$action = $this->request->variable('action', '');
$post_actions = array('install', 'activate', 'deactivate', 'uninstall');
foreach ($post_actions as $key) {
if ($this->request->is_set_post($key)) {
$action = $key;
}
}
// The uninstall action uses confirm_box() to verify the validity of the request,
// so there is no need to check for a valid token here.
if (in_array($action, $post_actions) && $action != 'uninstall') {
$is_valid_request = check_link_hash($request->variable('hash', ''), $action) || check_form_key('styles_management');
if (!$is_valid_request) {
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
if ($action != '') {
$this->s_hidden_fields['action'] = $action;
}
$this->template->assign_vars(array('U_ACTION' => $this->u_base_action, 'S_HIDDEN_FIELDS' => build_hidden_fields($this->s_hidden_fields)));
// Execute actions
switch ($action) {
case 'install':
$this->action_install();
return;
case 'uninstall':
$this->action_uninstall();
return;
case 'activate':
$this->action_activate();
return;
case 'deactivate':
$this->action_deactivate();
return;
case 'details':
$this->action_details();
return;
default:
$this->frontend();
}
}
示例5: __construct
/**
* Constructor.
*
* @param \phpbb\user $user
* @param $container
* @param \phpbb\titania\config\config $ext_config
* @param string $php_ext
*/
public function __construct(\phpbb\user $user, $container, $ext_config, $php_ext)
{
$this->user = $user;
$this->ext_config = $ext_config;
$this->php_ext = $php_ext;
$this->container = $container;
$this->user->add_lang('acp/styles');
}
示例6: __construct
/**
* Constructor
*
* @param \phpbb\config\config $config Config object
* @param \phpbb\user $user User object
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(\phpbb\config\config $config, \phpbb\user $user, $phpbb_root_path, $php_ext)
{
$this->config = $config;
$this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
include $this->phpbb_root_path . 'includes/functions_user.' . $php_ext;
$this->user->add_lang('ucp');
}
示例7: __construct
/**
* Constructor
*
* @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\user $user
* @param \phpbb\request\request_interface $request
* @param \phpbb\titania\controller\helper $helper
* @param \phpbb\titania\config\config $ext_config
* @param \phpbb\titania\attachment\operator $attachments
*/
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\request\request_interface $request, \phpbb\titania\controller\helper $helper, \phpbb\titania\config\config $ext_config, \phpbb\titania\attachment\operator $attachments)
{
$this->db = $db;
$this->user = $user;
$this->request = $request;
$this->helper = $helper;
$this->ext_config = $ext_config;
$this->attachments = $attachments;
$this->user->add_lang('viewtopic');
}
示例8: __construct
/**
* Constructor
*
* @param \phpbb\user $user
* @param \phpbb\template\template $template
* @param \phpbb\request\request_interface $request
* @param \phpbb\titania\controller\helper $helper
* @param \phpbb\titania\config\config $ext_config
* @param \phpbb\titania\attachment\operator $attachments
*/
public function __construct(\phpbb\user $user, \phpbb\template\template $template, \phpbb\request\request_interface $request, \phpbb\titania\controller\helper $helper, \phpbb\titania\config\config $ext_config, \phpbb\titania\attachment\operator $attachments)
{
$this->user = $user;
$this->template = $template;
$this->request = $request;
$this->helper = $helper;
$this->ext_config = $ext_config;
$this->attachments = $attachments;
$this->user->add_lang_ext('phpbb/titania', array('contributions', 'manage'));
$this->user->add_lang('viewtopic');
}
示例9: __construct
/**
* Constructor
*
* @param \phpbb\auth\auth $auth
* @param \phpbb\config\config $config Config object
* @param \phpbb\db\driver\driver_interface $db
* @param \\phpbb\event\dispatcher_interface $phpbb_dispatcher
* @param \phpbb\user $user
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\user $user, $phpbb_root_path, $php_ext)
{
$this->auth = $auth;
$this->config = $config;
$this->db = $db;
$this->phpbb_dispatcher = $phpbb_dispatcher;
$this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->user->add_lang('memberlist');
}
示例10: __construct
public function __construct()
{
global $config, $db, $phpbb_log, $request, $template, $user;
$this->config = $config;
$this->db = $db;
$this->log = $phpbb_log;
$this->request = $request;
$this->template = $template;
$this->user = $user;
$this->user->add_lang('acp/common');
$this->user->add_lang_ext('phpbb/teamsecurity', 'acp_teamsecurity');
}
示例11: __construct
/**
* Constructor
*
* @param \phpbb\config\config $config Config object
* @param \phpbb\request\request $request Request object
* @param \phpbb\user $user User object
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(\phpbb\config\config $config, \phpbb\request\request $request, \phpbb\user $user, $phpbb_root_path, $php_ext)
{
$this->config = $config;
$this->request = $request;
$this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
if (!function_exists('validate_data')) {
include $this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext;
}
$this->user->add_lang('ucp');
$this->user->add_lang_ext('tas2580/regcheck', 'common');
}
示例12: __construct
/**
* Constructor
*
* @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\config\config $config
* @param \phpbb\user $user
* @param \phpbb\titania\config\config $ext_config
* @param \phpbb\titania\controller\helper $controller_helper
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\user $user, \phpbb\titania\config\config $ext_config, \phpbb\titania\controller\helper $controller_helper, $phpbb_root_path, $php_ext)
{
$this->db = $db;
$this->config = $config;
$this->user = $user;
$this->ext_config = $ext_config;
$this->controller_helper = $controller_helper;
$this->attachments_table = $this->sql_table;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->user->add_lang('posting');
$this->configure_properties();
}
示例13: __construct
/**
* Constructor
*
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\cache\driver\driver_interface $cache Cache driver interface
* @param \phpbb\config\config $config Config object
* @param \phpbb\db\driver\driver_interface $db Database object
* @param \phpbb\user $user User object
* @param string $phpbb_root_path Path to the phpbb includes directory.
* @param string $php_ext php file extension
*/
public function __construct(\phpbb\auth\auth $auth, \phpbb\cache\driver\driver_interface $cache, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $php_ext)
{
$this->auth = $auth;
$this->cache = $cache;
$this->config = $config;
$this->db = $db;
$this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
if (!class_exists('acp_forums')) {
include $this->phpbb_root_path . 'includes/acp/acp_forums.' . $this->php_ext;
}
$this->user->add_lang('acp/forums');
}
示例14: build
public function build(array $topic_data, \phpbb\template\twig\twig &$template)
{
$this->user->add_lang('viewtopic');
$forum_id = (int) $topic_data['forum_id'];
$topic_id = (int) $topic_data['topic_id'];
$cur_voted_id = $this->_get_users_votes($topic_id);
$s_can_vote = $this->_user_can_vote($forum_id, $topic_data, $cur_voted_id);
$viewtopic_url = append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", "f={$forum_id}&t={$topic_id}");
$poll_total = $poll_most = 0;
$poll_info = $this->_get_poll_info($topic_data, $poll_total, $poll_most);
$poll_end = $topic_data['poll_length'] + $topic_data['poll_start'];
$this->_build_poll_options($cur_voted_id, $poll_info, $poll_total, $poll_most, $template);
$template->assign_vars(array('POLL_QUESTION' => $topic_data['poll_title'], 'TOTAL_VOTES' => $poll_total, 'POLL_LEFT_CAP_IMG' => $this->user->img('poll_left'), 'POLL_RIGHT_CAP_IMG' => $this->user->img('poll_right'), 'L_MAX_VOTES' => $this->user->lang('MAX_OPTIONS_SELECT', (int) $topic_data['poll_max_options']), 'L_POLL_LENGTH' => $this->_get_poll_length_lang($topic_data['poll_length'], $poll_end), 'S_CAN_VOTE' => $s_can_vote, 'S_DISPLAY_RESULTS' => $this->_show_results($s_can_vote, $cur_voted_id), 'S_IS_MULTI_CHOICE' => $this->_poll_is_multiple_choice($topic_data['poll_max_options']), 'S_POLL_ACTION' => $viewtopic_url, 'S_FORM_TOKEN' => $this->sitemaker->get_form_key('posting'), 'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll'));
}
示例15: __construct
/**
* Constructor
*
* @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\auth\auth $auth
* @param \phpbb\user $user
* @param \phpbb\request\request_interface $request
* @param \phpbb\titania\controller\helper $helper
* @param \phpbb\titania\config\config $ext_config
* @param \phpbb\titania\access $access
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\user $user, \phpbb\request\request $request, \phpbb\titania\controller\helper $helper, \phpbb\titania\config\config $ext_config, access $access, $phpbb_root_path, $php_ext)
{
$this->db = $db;
$this->auth = $auth;
$this->user = $user;
$this->request = $request;
$this->helper = $helper;
$this->ext_config = $ext_config;
$this->access = $access;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->user->add_lang('viewtopic');
require $this->phpbb_root_path . 'includes/functions_download.' . $this->php_ext;
}