mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/17100] Use class members for some global vars in acp_board
PHPBB3-17100
This commit is contained in:
parent
69f65956a9
commit
dda8766471
1 changed files with 26 additions and 7 deletions
|
@ -18,6 +18,11 @@
|
||||||
/**
|
/**
|
||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use phpbb\config\config;
|
||||||
|
use phpbb\language\language;
|
||||||
|
use phpbb\user;
|
||||||
|
|
||||||
if (!defined('IN_PHPBB'))
|
if (!defined('IN_PHPBB'))
|
||||||
{
|
{
|
||||||
exit;
|
exit;
|
||||||
|
@ -28,16 +33,32 @@ class acp_board
|
||||||
var $u_action;
|
var $u_action;
|
||||||
var $new_config;
|
var $new_config;
|
||||||
|
|
||||||
|
/** @var config */
|
||||||
|
protected $config;
|
||||||
|
|
||||||
|
/** @var language */
|
||||||
|
protected $language;
|
||||||
|
|
||||||
|
/** @var user */
|
||||||
|
protected $user;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $user, $template, $request, $language;
|
global $user, $template, $request, $language;
|
||||||
global $config, $phpbb_root_path, $phpEx;
|
global $config, $phpbb_root_path, $phpEx;
|
||||||
global $cache, $phpbb_container, $phpbb_dispatcher, $phpbb_log;
|
global $cache, $phpbb_container, $phpbb_dispatcher, $phpbb_log;
|
||||||
|
|
||||||
/** @var \phpbb\language\language $language Language object */
|
if (!$language)
|
||||||
$language = $phpbb_container->get('language');
|
{
|
||||||
|
/** @var language $language Language object */
|
||||||
|
$language = $phpbb_container->get('language');
|
||||||
|
}
|
||||||
|
|
||||||
$user->add_lang('acp/board');
|
$this->config = $config;
|
||||||
|
$this->language = $language;
|
||||||
|
$this->user = $user;
|
||||||
|
|
||||||
|
$this->language->add_lang('acp/board');
|
||||||
|
|
||||||
$submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false;
|
$submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false;
|
||||||
|
|
||||||
|
@ -503,7 +524,7 @@ class acp_board
|
||||||
{
|
{
|
||||||
if (!preg_match('#^[a-z][a-z0-9+\\-.]*$#Di', $scheme))
|
if (!preg_match('#^[a-z][a-z0-9+\\-.]*$#Di', $scheme))
|
||||||
{
|
{
|
||||||
$error[] = $language->lang('URL_SCHEME_INVALID', $language->lang('ALLOWED_SCHEMES_LINKS'), $scheme);
|
$error[] = $this->language->lang('URL_SCHEME_INVALID', $this->language->lang('ALLOWED_SCHEMES_LINKS'), $scheme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -978,8 +999,6 @@ class acp_board
|
||||||
*/
|
*/
|
||||||
public function bump_interval($value, $key): array
|
public function bump_interval($value, $key): array
|
||||||
{
|
{
|
||||||
global $language;
|
|
||||||
|
|
||||||
$bump_type_options = [];
|
$bump_type_options = [];
|
||||||
$types = array('m' => 'MINUTES', 'h' => 'HOURS', 'd' => 'DAYS');
|
$types = array('m' => 'MINUTES', 'h' => 'HOURS', 'd' => 'DAYS');
|
||||||
foreach ($types as $type => $lang)
|
foreach ($types as $type => $lang)
|
||||||
|
@ -987,7 +1006,7 @@ class acp_board
|
||||||
$bump_type_options[] = [
|
$bump_type_options[] = [
|
||||||
'value' => $type,
|
'value' => $type,
|
||||||
'selected' => $this->new_config['bump_type'] == $type,
|
'selected' => $this->new_config['bump_type'] == $type,
|
||||||
'label' => $language->lang($lang),
|
'label' => $this->language->lang($lang),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue