@@ -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 $ext_path Path to this extension |
|
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 $ext_path Path to this extension |
|
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, $ext_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'); |
@@ -87,31 +87,31 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * Set page url |
|
91 | - * |
|
92 | - * @param string $u_action Custom form action |
|
93 | - * @return void |
|
94 | - */ |
|
90 | + * Set page url |
|
91 | + * |
|
92 | + * @param string $u_action Custom form action |
|
93 | + * @return void |
|
94 | + */ |
|
95 | 95 | public function set_page_url($u_action) |
96 | 96 | { |
97 | 97 | $this->u_action = $u_action; |
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
101 | - * Get ACP page title for Ads module |
|
102 | - * |
|
103 | - * @return string Language string for Ads ACP module |
|
104 | - */ |
|
101 | + * Get ACP page title for Ads module |
|
102 | + * |
|
103 | + * @return string Language string for Ads ACP module |
|
104 | + */ |
|
105 | 105 | public function get_page_title() |
106 | 106 | { |
107 | 107 | return $this->user->lang('ACP_ADMANAGEMENT_TITLE'); |
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
111 | - * Add an advertisement |
|
112 | - * |
|
113 | - * @return void |
|
114 | - */ |
|
111 | + * Add an advertisement |
|
112 | + * |
|
113 | + * @return void |
|
114 | + */ |
|
115 | 115 | public function action_add() |
116 | 116 | { |
117 | 117 | add_form_key('phpbb/admanagement/add'); |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
146 | - * Edit an advertisement |
|
147 | - * |
|
148 | - * @return void |
|
149 | - */ |
|
146 | + * Edit an advertisement |
|
147 | + * |
|
148 | + * @return void |
|
149 | + */ |
|
150 | 150 | public function action_edit() |
151 | 151 | { |
152 | 152 | $ad_id = $this->request->variable('id', 0); |
@@ -196,30 +196,30 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
199 | - * Enable an advertisement |
|
200 | - * |
|
201 | - * @return void |
|
202 | - */ |
|
199 | + * Enable an advertisement |
|
200 | + * |
|
201 | + * @return void |
|
202 | + */ |
|
203 | 203 | public function action_enable() |
204 | 204 | { |
205 | 205 | $this->ad_enable(true); |
206 | 206 | } |
207 | 207 | |
208 | 208 | /** |
209 | - * Disable an advertisement |
|
210 | - * |
|
211 | - * @return void |
|
212 | - */ |
|
209 | + * Disable an advertisement |
|
210 | + * |
|
211 | + * @return void |
|
212 | + */ |
|
213 | 213 | public function action_disable() |
214 | 214 | { |
215 | 215 | $this->ad_enable(false); |
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
219 | - * Delete an advertisement |
|
220 | - * |
|
221 | - * @return void |
|
222 | - */ |
|
219 | + * Delete an advertisement |
|
220 | + * |
|
221 | + * @return void |
|
222 | + */ |
|
223 | 223 | public function action_delete() |
224 | 224 | { |
225 | 225 | $ad_id = $this->request->variable('id', 0); |
@@ -254,10 +254,10 @@ discard block |
||
254 | 254 | } |
255 | 255 | |
256 | 256 | /** |
257 | - * Display the ads |
|
258 | - * |
|
259 | - * @return void |
|
260 | - */ |
|
257 | + * Display the ads |
|
258 | + * |
|
259 | + * @return void |
|
260 | + */ |
|
261 | 261 | public function list_ads() |
262 | 262 | { |
263 | 263 | $sql = 'SELECT ad_id, ad_name, ad_enabled |
@@ -286,11 +286,11 @@ discard block |
||
286 | 286 | } |
287 | 287 | |
288 | 288 | /** |
289 | - * Enable/disable an advertisement |
|
290 | - * |
|
291 | - * @param bool $enable Enable or disable the advertisement? |
|
292 | - * @return void |
|
293 | - */ |
|
289 | + * Enable/disable an advertisement |
|
290 | + * |
|
291 | + * @param bool $enable Enable or disable the advertisement? |
|
292 | + * @return void |
|
293 | + */ |
|
294 | 294 | protected function ad_enable($enable) |
295 | 295 | { |
296 | 296 | $sql = 'UPDATE ' . $this->ads_table . ' |
@@ -321,11 +321,11 @@ discard block |
||
321 | 321 | } |
322 | 322 | |
323 | 323 | /** |
324 | - * Check the form key. |
|
325 | - * |
|
326 | - * @param string $form_name The name of the form. |
|
327 | - * @return void |
|
328 | - */ |
|
324 | + * Check the form key. |
|
325 | + * |
|
326 | + * @param string $form_name The name of the form. |
|
327 | + * @return void |
|
328 | + */ |
|
329 | 329 | protected function check_form_key($form_name) |
330 | 330 | { |
331 | 331 | if (!check_form_key($form_name)) |
@@ -335,10 +335,10 @@ discard block |
||
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
338 | - * Get admin form data. |
|
339 | - * |
|
340 | - * @return array Form data |
|
341 | - */ |
|
338 | + * Get admin form data. |
|
339 | + * |
|
340 | + * @return array Form data |
|
341 | + */ |
|
342 | 342 | protected function get_form_data() |
343 | 343 | { |
344 | 344 | return array( |
@@ -350,11 +350,11 @@ discard block |
||
350 | 350 | } |
351 | 351 | |
352 | 352 | /** |
353 | - * Validate form data. |
|
354 | - * |
|
355 | - * @param array $data The form data. |
|
356 | - * @return void |
|
357 | - */ |
|
353 | + * Validate form data. |
|
354 | + * |
|
355 | + * @param array $data The form data. |
|
356 | + * @return void |
|
357 | + */ |
|
358 | 358 | protected function validate($data) |
359 | 359 | { |
360 | 360 | if ($data['ad_name'] === '') |
@@ -368,11 +368,11 @@ discard block |
||
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
371 | - * Assign form data to the template. |
|
372 | - * |
|
373 | - * @param array $data The form data. |
|
374 | - * @return void |
|
375 | - */ |
|
371 | + * Assign form data to the template. |
|
372 | + * |
|
373 | + * @param array $data The form data. |
|
374 | + * @return void |
|
375 | + */ |
|
376 | 376 | protected function assign_form_data($data) |
377 | 377 | { |
378 | 378 | $this->template->assign_vars(array( |
@@ -387,20 +387,20 @@ discard block |
||
387 | 387 | } |
388 | 388 | |
389 | 389 | /** |
390 | - * Print success message. |
|
391 | - * |
|
392 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
393 | - */ |
|
390 | + * Print success message. |
|
391 | + * |
|
392 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
393 | + */ |
|
394 | 394 | protected function success() |
395 | 395 | { |
396 | 396 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action)); |
397 | 397 | } |
398 | 398 | |
399 | 399 | /** |
400 | - * Print error message. |
|
401 | - * |
|
402 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
403 | - */ |
|
400 | + * Print error message. |
|
401 | + * |
|
402 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
403 | + */ |
|
404 | 404 | protected function error() |
405 | 405 | { |
406 | 406 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action), E_USER_WARNING); |