1 | <?php |
||
22 | class admin_controller implements admin_controller_interface |
||
23 | { |
||
24 | /** @var manager */ |
||
25 | protected $manager; |
||
26 | |||
27 | /** @var log */ |
||
28 | protected $log; |
||
29 | |||
30 | /** @var request */ |
||
31 | protected $request; |
||
32 | |||
33 | /** @var template */ |
||
34 | protected $template; |
||
35 | |||
36 | /** @var user */ |
||
37 | protected $user; |
||
38 | |||
39 | /** @var string */ |
||
40 | protected $root_path; |
||
41 | |||
42 | /** @var string */ |
||
43 | protected $php_ext; |
||
44 | |||
45 | /** @var string */ |
||
46 | protected $form_key; |
||
47 | |||
48 | /** @var int */ |
||
49 | protected $forum_id; |
||
50 | |||
51 | /** @var string */ |
||
52 | protected $u_action; |
||
53 | |||
54 | /** |
||
55 | * Constructor |
||
56 | * |
||
57 | * @param manager $manager |
||
58 | * @param log $log |
||
59 | * @param request $request |
||
60 | * @param template $template |
||
61 | * @param user $user |
||
62 | * @param string $phpbb_root_path |
||
63 | * @param string $phpEx |
||
64 | */ |
||
65 | public function __construct(manager $manager, log $log, request $request, template $template, user $user, $phpbb_root_path, $phpEx) |
||
75 | |||
76 | public function main() |
||
104 | |||
105 | /** |
||
106 | * @inheritdoc |
||
107 | */ |
||
108 | public function display_settings() |
||
128 | |||
129 | /** |
||
130 | * @inheritdoc |
||
131 | */ |
||
132 | public function add_prefix() |
||
146 | |||
147 | /** |
||
148 | * @inheritdoc |
||
149 | */ |
||
150 | public function edit_prefix($prefix_id) |
||
167 | |||
168 | /** |
||
169 | * @inheritdoc |
||
170 | */ |
||
171 | public function delete_prefix($prefix_id) |
||
196 | |||
197 | /** |
||
198 | * @inheritdoc |
||
199 | */ |
||
200 | public function move_prefix($prefix_id, $direction, $amount = 1) |
||
222 | |||
223 | /** |
||
224 | * @inheritdoc |
||
225 | */ |
||
226 | public function set_u_action($u_action) |
||
231 | |||
232 | /** |
||
233 | * @param int $forum_id |
||
234 | */ |
||
235 | public function set_forum_id($forum_id) |
||
239 | |||
240 | /** |
||
241 | * Check link hash helper |
||
242 | * |
||
243 | * @param string $hash A hashed string |
||
244 | * @return bool True if hash matches, false if not |
||
245 | */ |
||
246 | protected function check_hash($hash) |
||
250 | |||
251 | /** |
||
252 | * Trigger a message and back link for error/success dialogs |
||
253 | * |
||
254 | * @param string $message A language key |
||
255 | * @param string $error Error type constant, optional |
||
256 | * @return null |
||
257 | */ |
||
258 | protected function trigger_message($message = '', $error = E_USER_NOTICE) |
||
262 | |||
263 | /** |
||
264 | * Helper for logging topic prefix admin actions |
||
265 | * |
||
266 | * @param string $tag The topic prefix tag |
||
267 | * @param string $message The log action language key |
||
268 | */ |
||
269 | protected function log($tag, $message) |
||
275 | |||
276 | /** |
||
277 | * Get a forum's information |
||
278 | * |
||
279 | * @param int $forum_id |
||
280 | * @return mixed Array with the current row, false, if the row does not exist |
||
281 | */ |
||
282 | protected function get_forum_info($forum_id) |
||
293 | } |
||
294 |