@@ -16,33 +16,33 @@ discard block |
||
16 | 16 | class m1_initial_schema extends \phpbb\db\migration\migration |
17 | 17 | { |
18 | 18 | /** |
19 | - * {@inheritDoc} |
|
20 | - */ |
|
19 | + * {@inheritDoc} |
|
20 | + */ |
|
21 | 21 | public function effectively_installed() |
22 | 22 | { |
23 | 23 | return $this->db_tools->sql_table_exists($this->table_prefix . 'ads'); |
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
27 | - * {@inheritDoc} |
|
28 | - */ |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | 29 | static public function depends_on() |
30 | 30 | { |
31 | 31 | return array('\phpbb\db\migration\data\v310\gold'); |
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
35 | - * Add the ads table schema to the database: |
|
36 | - * ads: |
|
37 | - * ad_id |
|
38 | - * ad_name |
|
39 | - * ad_note |
|
40 | - * ad_code |
|
41 | - * ad_enabled |
|
42 | - * |
|
43 | - * @return array Array of table schema |
|
44 | - * @access public |
|
45 | - */ |
|
35 | + * Add the ads table schema to the database: |
|
36 | + * ads: |
|
37 | + * ad_id |
|
38 | + * ad_name |
|
39 | + * ad_note |
|
40 | + * ad_code |
|
41 | + * ad_enabled |
|
42 | + * |
|
43 | + * @return array Array of table schema |
|
44 | + * @access public |
|
45 | + */ |
|
46 | 46 | public function update_schema() |
47 | 47 | { |
48 | 48 | return array( |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | - * Drop the ads table schema from the database |
|
66 | - * |
|
67 | - * @return array Array of table schema |
|
68 | - * @access public |
|
69 | - */ |
|
65 | + * Drop the ads table schema from the database |
|
66 | + * |
|
67 | + * @return array Array of table schema |
|
68 | + * @access public |
|
69 | + */ |
|
70 | 70 | public function revert_schema() |
71 | 71 | { |
72 | 72 | return array( |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | class m2_acp_module extends \phpbb\db\migration\migration |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritDoc} |
|
17 | - */ |
|
16 | + * {@inheritDoc} |
|
17 | + */ |
|
18 | 18 | public function effectively_installed() |
19 | 19 | { |
20 | 20 | $sql = 'SELECT module_id |
@@ -29,18 +29,18 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
32 | - * {@inheritDoc} |
|
33 | - */ |
|
32 | + * {@inheritDoc} |
|
33 | + */ |
|
34 | 34 | static public function depends_on() |
35 | 35 | { |
36 | 36 | return array('\phpbb\admanagement\migrations\v10x\m1_initial_schema'); |
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | - * Add the ACP module |
|
41 | - * |
|
42 | - * @return array Array of data update instructions |
|
43 | - */ |
|
40 | + * Add the ACP module |
|
41 | + * |
|
42 | + * @return array Array of data update instructions |
|
43 | + */ |
|
44 | 44 | public function update_data() |
45 | 45 | { |
46 | 46 | return array( |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | protected $ads_table; |
34 | 34 | |
35 | 35 | /** |
36 | - * {@inheritdoc} |
|
37 | - */ |
|
36 | + * {@inheritdoc} |
|
37 | + */ |
|
38 | 38 | static public function getSubscribedEvents() |
39 | 39 | { |
40 | 40 | return array( |
@@ -43,13 +43,13 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
46 | - * Constructor |
|
47 | - * |
|
48 | - * @param \phpbb\request\request $request Request object |
|
49 | - * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
50 | - * @param \phpbb\template\template $template Template object |
|
51 | - * @param string $ads_table Ads table |
|
52 | - */ |
|
46 | + * Constructor |
|
47 | + * |
|
48 | + * @param \phpbb\request\request $request Request object |
|
49 | + * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
50 | + * @param \phpbb\template\template $template Template object |
|
51 | + * @param string $ads_table Ads table |
|
52 | + */ |
|
53 | 53 | public function __construct(\phpbb\request\request $request, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, $ads_table) |
54 | 54 | { |
55 | 55 | $this->request = $request; |
@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | protected $errors = array(); |
46 | 46 | |
47 | 47 | /** |
48 | - * Constructor |
|
49 | - * |
|
50 | - * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
51 | - * @param \phpbb\template\template $template Template object |
|
52 | - * @param \phpbb\user $user User object |
|
53 | - * @param \phpbb\request\request $request Request object |
|
54 | - * @param string $ads_table Ads table |
|
55 | - * @param string $php_ext PHP extension |
|
56 | - * @param string $phpbb_admin_path Path to admin |
|
57 | - */ |
|
48 | + * Constructor |
|
49 | + * |
|
50 | + * @param \phpbb\db\driver\driver_interface $db DB driver interface |
|
51 | + * @param \phpbb\template\template $template Template object |
|
52 | + * @param \phpbb\user $user User object |
|
53 | + * @param \phpbb\request\request $request Request object |
|
54 | + * @param string $ads_table Ads table |
|
55 | + * @param string $php_ext PHP extension |
|
56 | + * @param string $phpbb_admin_path Path to admin |
|
57 | + */ |
|
58 | 58 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \phpbb\request\request $request, $ads_table, $php_ext, $phpbb_admin_path) |
59 | 59 | { |
60 | 60 | $this->db = $db; |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
70 | - * Process user request |
|
71 | - * |
|
72 | - * @return void |
|
73 | - */ |
|
70 | + * Process user request |
|
71 | + * |
|
72 | + * @return void |
|
73 | + */ |
|
74 | 74 | public function main() |
75 | 75 | { |
76 | 76 | $this->user->add_lang_ext('phpbb/admanagement', 'acp'); |
@@ -112,31 +112,31 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
115 | - * Set page url |
|
116 | - * |
|
117 | - * @param string $u_action Custom form action |
|
118 | - * @return void |
|
119 | - */ |
|
115 | + * Set page url |
|
116 | + * |
|
117 | + * @param string $u_action Custom form action |
|
118 | + * @return void |
|
119 | + */ |
|
120 | 120 | public function set_page_url($u_action) |
121 | 121 | { |
122 | 122 | $this->u_action = $u_action; |
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
126 | - * Get ACP page title for Ads module |
|
127 | - * |
|
128 | - * @return string Language string for Ads ACP module |
|
129 | - */ |
|
126 | + * Get ACP page title for Ads module |
|
127 | + * |
|
128 | + * @return string Language string for Ads ACP module |
|
129 | + */ |
|
130 | 130 | public function get_page_title() |
131 | 131 | { |
132 | 132 | return $this->user->lang('ACP_ADMANAGEMENT_TITLE'); |
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
136 | - * Add an advertisement |
|
137 | - * |
|
138 | - * @return void |
|
139 | - */ |
|
136 | + * Add an advertisement |
|
137 | + * |
|
138 | + * @return void |
|
139 | + */ |
|
140 | 140 | public function action_add() |
141 | 141 | { |
142 | 142 | add_form_key('phpbb/admanagement/add'); |
@@ -171,10 +171,10 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
174 | - * Edit an advertisement |
|
175 | - * |
|
176 | - * @return void |
|
177 | - */ |
|
174 | + * Edit an advertisement |
|
175 | + * |
|
176 | + * @return void |
|
177 | + */ |
|
178 | 178 | public function action_edit() |
179 | 179 | { |
180 | 180 | $ad_id = $this->request->variable('id', 0); |
@@ -228,11 +228,11 @@ discard block |
||
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
231 | - * Enable/disable an advertisement |
|
232 | - * |
|
233 | - * @param bool $enable Enable or disable the advertisement? |
|
234 | - * @return void |
|
235 | - */ |
|
231 | + * Enable/disable an advertisement |
|
232 | + * |
|
233 | + * @param bool $enable Enable or disable the advertisement? |
|
234 | + * @return void |
|
235 | + */ |
|
236 | 236 | public function ad_enable($enable) |
237 | 237 | { |
238 | 238 | $sql = 'UPDATE ' . $this->ads_table . ' |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | } |
264 | 264 | |
265 | 265 | /** |
266 | - * Delete an advertisement |
|
267 | - * |
|
268 | - * @return void |
|
269 | - */ |
|
266 | + * Delete an advertisement |
|
267 | + * |
|
268 | + * @return void |
|
269 | + */ |
|
270 | 270 | public function action_delete() |
271 | 271 | { |
272 | 272 | $ad_id = $this->request->variable('id', 0); |
@@ -302,10 +302,10 @@ discard block |
||
302 | 302 | |
303 | 303 | |
304 | 304 | /** |
305 | - * Display the ads |
|
306 | - * |
|
307 | - * @return void |
|
308 | - */ |
|
305 | + * Display the ads |
|
306 | + * |
|
307 | + * @return void |
|
308 | + */ |
|
309 | 309 | public function list_ads() |
310 | 310 | { |
311 | 311 | $sql = 'SELECT ad_id, ad_name, ad_enabled |
@@ -334,11 +334,11 @@ discard block |
||
334 | 334 | } |
335 | 335 | |
336 | 336 | /** |
337 | - * Check the form key. |
|
338 | - * |
|
339 | - * @param string $form_name The name of the form. |
|
340 | - * @return void |
|
341 | - */ |
|
337 | + * Check the form key. |
|
338 | + * |
|
339 | + * @param string $form_name The name of the form. |
|
340 | + * @return void |
|
341 | + */ |
|
342 | 342 | protected function check_form_key($form_name) |
343 | 343 | { |
344 | 344 | if (!check_form_key($form_name)) |
@@ -348,10 +348,10 @@ discard block |
||
348 | 348 | } |
349 | 349 | |
350 | 350 | /** |
351 | - * Get admin form data. |
|
352 | - * |
|
353 | - * @return array Form data |
|
354 | - */ |
|
351 | + * Get admin form data. |
|
352 | + * |
|
353 | + * @return array Form data |
|
354 | + */ |
|
355 | 355 | protected function get_form_data() |
356 | 356 | { |
357 | 357 | return array( |
@@ -363,11 +363,11 @@ discard block |
||
363 | 363 | } |
364 | 364 | |
365 | 365 | /** |
366 | - * Validate form data. |
|
367 | - * |
|
368 | - * @param array $data The form data. |
|
369 | - * @return void |
|
370 | - */ |
|
366 | + * Validate form data. |
|
367 | + * |
|
368 | + * @param array $data The form data. |
|
369 | + * @return void |
|
370 | + */ |
|
371 | 371 | protected function validate($data) |
372 | 372 | { |
373 | 373 | if ($data['ad_name'] === '') |
@@ -381,10 +381,10 @@ discard block |
||
381 | 381 | } |
382 | 382 | |
383 | 383 | /** |
384 | - * Assign errors to the template. |
|
385 | - * |
|
386 | - * @return void |
|
387 | - */ |
|
384 | + * Assign errors to the template. |
|
385 | + * |
|
386 | + * @return void |
|
387 | + */ |
|
388 | 388 | protected function assign_errors() |
389 | 389 | { |
390 | 390 | $this->template->assign_vars(array( |
@@ -394,11 +394,11 @@ discard block |
||
394 | 394 | } |
395 | 395 | |
396 | 396 | /** |
397 | - * Assign form data to the template. |
|
398 | - * |
|
399 | - * @param array $data The form data. |
|
400 | - * @return void |
|
401 | - */ |
|
397 | + * Assign form data to the template. |
|
398 | + * |
|
399 | + * @param array $data The form data. |
|
400 | + * @return void |
|
401 | + */ |
|
402 | 402 | protected function assign_form_data($data) |
403 | 403 | { |
404 | 404 | $this->template->assign_vars(array( |
@@ -410,20 +410,20 @@ discard block |
||
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
413 | - * Print success message. |
|
414 | - * |
|
415 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
416 | - */ |
|
413 | + * Print success message. |
|
414 | + * |
|
415 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
416 | + */ |
|
417 | 417 | protected function success() |
418 | 418 | { |
419 | 419 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action)); |
420 | 420 | } |
421 | 421 | |
422 | 422 | /** |
423 | - * Print error message. |
|
424 | - * |
|
425 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
426 | - */ |
|
423 | + * Print error message. |
|
424 | + * |
|
425 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
426 | + */ |
|
427 | 427 | protected function error() |
428 | 428 | { |
429 | 429 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action), E_USER_WARNING); |