1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* |
4
|
|
|
* Member Avatar & Status [MAS]. An extension for the phpBB Forum Software package. |
5
|
|
|
* |
6
|
|
|
* @copyright (c) 2018-2020, Dark❶ [dark1] |
7
|
|
|
* @license GNU General Public License, version 2 (GPL-2.0-only) |
8
|
|
|
* |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace dark1\memberavatarstatus\controller; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @ignore |
15
|
|
|
*/ |
16
|
|
|
use phpbb\language\language; |
17
|
|
|
use phpbb\log\log; |
18
|
|
|
use phpbb\request\request; |
19
|
|
|
use phpbb\template\template; |
20
|
|
|
use phpbb\user; |
21
|
|
|
use phpbb\config\config; |
22
|
|
|
use dark1\memberavatarstatus\core\avatar; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Member Avatar & Status [MAS] ACP controller Search. |
26
|
|
|
*/ |
27
|
|
|
class acp_search extends acp_base |
28
|
|
|
{ |
29
|
|
|
/** @var \phpbb\config\config */ |
30
|
|
|
protected $config; |
31
|
|
|
|
32
|
|
|
/** @var \dark1\memberavatarstatus\core\avatar*/ |
33
|
|
|
protected $avatar; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Constructor. |
37
|
|
|
* |
38
|
|
|
* @param \phpbb\language\language $language Language object |
39
|
|
|
* @param \phpbb\log\log $log Log object |
40
|
|
|
* @param \phpbb\request\request $request Request object |
41
|
|
|
* @param \phpbb\template\template $template Template object |
42
|
|
|
* @param \phpbb\user $user User object |
43
|
|
|
* @param \phpbb\config\config $config Config object |
44
|
|
|
* @param \dark1\memberavatarstatus\core\avatar $avatar dark1 avatar |
45
|
|
|
*/ |
46
|
|
|
public function __construct(language $language, log $log, request $request, template $template, user $user, config $config, avatar $avatar) |
47
|
|
|
{ |
48
|
|
|
parent::__construct($language, $log, $request, $template, $user); |
49
|
|
|
|
50
|
|
|
$this->config = $config; |
51
|
|
|
$this->avatar = $avatar; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Display the options a user can configure for Search Mode. |
56
|
|
|
* |
57
|
|
|
* @return void |
58
|
|
|
* @access public |
59
|
|
|
*/ |
60
|
|
|
public function handle() |
61
|
|
|
{ |
62
|
|
|
// Is the form being submitted to us? |
63
|
|
|
if ($this->request->is_set_post('submit')) |
64
|
|
|
{ |
65
|
|
|
$this->check_form_on_submit(); |
66
|
|
|
|
67
|
|
|
// Set the options the user configured |
68
|
|
|
$this->config->set('dark1_mas_sh_fp_av', $this->request->variable('dark1_mas_sh_fp_av', 0)); |
69
|
|
|
$this->config->set('dark1_mas_sh_fp_ol', $this->request->variable('dark1_mas_sh_fp_ol', 0)); |
70
|
|
|
$this->config->set('dark1_mas_sh_lp_av', $this->request->variable('dark1_mas_sh_lp_av', 0)); |
71
|
|
|
$this->config->set('dark1_mas_sh_lp_ol', $this->request->variable('dark1_mas_sh_lp_ol', 0)); |
72
|
|
|
$this->config->set('dark1_mas_sh_up_av', $this->request->variable('dark1_mas_sh_up_av', 0)); |
73
|
|
|
$this->config->set('dark1_mas_sh_up_ol', $this->request->variable('dark1_mas_sh_up_ol', 0)); |
74
|
|
|
$this->config->set('dark1_mas_sh_fp_av_sz', $this->avatar->mas_get_avatar_size($this->request->variable('dark1_mas_sh_fp_av_sz', avatar::AV_DEF_SZ_SML), avatar::AV_DEF_SZ_SML, avatar::AV_MAX_SZ_SML)); |
75
|
|
|
$this->config->set('dark1_mas_sh_lp_av_sz', $this->avatar->mas_get_avatar_size($this->request->variable('dark1_mas_sh_lp_av_sz', avatar::AV_DEF_SZ_SML), avatar::AV_DEF_SZ_SML, avatar::AV_MAX_SZ_SML)); |
76
|
|
|
$this->config->set('dark1_mas_sh_up_av_sz', $this->avatar->mas_get_avatar_size($this->request->variable('dark1_mas_sh_up_av_sz', avatar::AV_DEF_SZ_SML), avatar::AV_DEF_SZ_SML, avatar::AV_MAX_SZ_SML)); |
77
|
|
|
|
78
|
|
|
$this->success_form_on_submit(); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
// Set output variables for display in the template |
82
|
|
|
$this->template->assign_vars([ |
83
|
|
|
'MAS_COLOR_OFFLINE' => $this->config['dark1_mas_col_off'], |
84
|
|
|
'MAS_COLOR_ONLINE' => $this->config['dark1_mas_col_on'], |
85
|
|
|
'MAS_SH_FP_AVATAR' => $this->config['dark1_mas_sh_fp_av'], |
86
|
|
|
'MAS_SH_FP_AV_SIZE' => $this->config['dark1_mas_sh_fp_av_sz'], |
87
|
|
|
'MAS_SH_FP_ONLINE' => $this->config['dark1_mas_sh_fp_ol'], |
88
|
|
|
'MAS_SH_LP_AVATAR' => $this->config['dark1_mas_sh_lp_av'], |
89
|
|
|
'MAS_SH_LP_AV_SIZE' => $this->config['dark1_mas_sh_lp_av_sz'], |
90
|
|
|
'MAS_SH_LP_ONLINE' => $this->config['dark1_mas_sh_lp_ol'], |
91
|
|
|
'MAS_SH_UP_AVATAR' => $this->config['dark1_mas_sh_up_av'], |
92
|
|
|
'MAS_SH_UP_AV_SIZE' => $this->config['dark1_mas_sh_up_av_sz'], |
93
|
|
|
'MAS_SH_UP_ONLINE' => $this->config['dark1_mas_sh_up_ol'], |
94
|
|
|
'MAS_NO_AVATAR_IMG' => $this->avatar->mas_get_no_avatar_img(), |
95
|
|
|
]); |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|