[use/request_class] Use request class in attachments module
This commit is contained in:
@@ -20,6 +20,7 @@ services:
|
|||||||
- @config
|
- @config
|
||||||
- @template
|
- @template
|
||||||
- @dbal.conn
|
- @dbal.conn
|
||||||
|
- @request
|
||||||
- %core.php_ext%
|
- %core.php_ext%
|
||||||
- %core.root_path%
|
- %core.root_path%
|
||||||
- @user
|
- @user
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ class attachments extends module_base
|
|||||||
/** @var \phpbb\config\config */
|
/** @var \phpbb\config\config */
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
|
/** @var \phpbb\request\request */
|
||||||
|
protected $request;
|
||||||
|
|
||||||
/** @var \phpbb\template */
|
/** @var \phpbb\template */
|
||||||
protected $template;
|
protected $template;
|
||||||
|
|
||||||
@@ -69,16 +72,18 @@ class attachments extends module_base
|
|||||||
* @param \phpbb\config\config $config phpBB config
|
* @param \phpbb\config\config $config phpBB config
|
||||||
* @param \phpbb\template $template phpBB template
|
* @param \phpbb\template $template phpBB template
|
||||||
* @param \phpbb\db\driver $db Database driver
|
* @param \phpbb\db\driver $db Database driver
|
||||||
|
* @param \phpbb\request\request $request phpBB request
|
||||||
* @param string $phpEx php file extension
|
* @param string $phpEx php file extension
|
||||||
* @param string $phpbb_root_path phpBB root path
|
* @param string $phpbb_root_path phpBB root path
|
||||||
* @param \phpbb\user $user phpBB user object
|
* @param \phpbb\user $user phpBB user object
|
||||||
*/
|
*/
|
||||||
public function __construct($auth, $config, $template, $db, $phpEx, $phpbb_root_path, $user)
|
public function __construct($auth, $config, $template, $db, $request, $phpEx, $phpbb_root_path, $user)
|
||||||
{
|
{
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->template = $template;
|
$this->template = $template;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
$this->request = $request;
|
||||||
$this->php_ext = $phpEx;
|
$this->php_ext = $phpEx;
|
||||||
$this->phpbb_root_path = $phpbb_root_path;
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
@@ -201,7 +206,7 @@ class attachments extends module_base
|
|||||||
public function store_filetypes($key, $module_id)
|
public function store_filetypes($key, $module_id)
|
||||||
{
|
{
|
||||||
// Get selected extensions
|
// Get selected extensions
|
||||||
$values = request_var($key, array(0 => ''));
|
$values = $this->request->variable($key, array(0 => ''));
|
||||||
|
|
||||||
$filetypes = implode(',', $values);
|
$filetypes = implode(',', $values);
|
||||||
|
|
||||||
@@ -250,7 +255,7 @@ class attachments extends module_base
|
|||||||
public function store_selected_forums($key)
|
public function store_selected_forums($key)
|
||||||
{
|
{
|
||||||
// Get selected extensions
|
// Get selected extensions
|
||||||
$values = request_var($key, array(0 => ''));
|
$values = $this->request->variable($key, array(0 => ''));
|
||||||
$news = implode(',', $values);
|
$news = implode(',', $values);
|
||||||
set_config($key, $news);
|
set_config($key, $news);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user