@@ -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,51 +67,51 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
70 | - * Set page url |
|
71 | - * |
|
72 | - * @param string $u_action Custom form action |
|
73 | - * @return void |
|
74 | - */ |
|
70 | + * Set page url |
|
71 | + * |
|
72 | + * @param string $u_action Custom form action |
|
73 | + * @return void |
|
74 | + */ |
|
75 | 75 | public function set_page_url($u_action) |
76 | 76 | { |
77 | 77 | $this->u_action = $u_action; |
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
81 | - * Load module-specific language |
|
82 | - * |
|
83 | - * @return void |
|
84 | - */ |
|
81 | + * Load module-specific language |
|
82 | + * |
|
83 | + * @return void |
|
84 | + */ |
|
85 | 85 | public function load_lang() |
86 | 86 | { |
87 | 87 | $this->user->add_lang_ext('phpbb/admanagement', 'acp'); |
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | - * Get ACP page title for Ads module |
|
92 | - * |
|
93 | - * @return string Language string for Ads ACP module |
|
94 | - */ |
|
91 | + * Get ACP page title for Ads module |
|
92 | + * |
|
93 | + * @return string Language string for Ads ACP module |
|
94 | + */ |
|
95 | 95 | public function get_page_title() |
96 | 96 | { |
97 | 97 | return $this->user->lang('ACP_ADMANAGEMENT_TITLE'); |
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
101 | - * Get action |
|
102 | - * |
|
103 | - * @return string Ads module action |
|
104 | - */ |
|
101 | + * Get action |
|
102 | + * |
|
103 | + * @return string Ads module action |
|
104 | + */ |
|
105 | 105 | public function get_action() |
106 | 106 | { |
107 | 107 | return $this->request->variable('action', ''); |
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'); |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
149 | - * Edit an advertisement |
|
150 | - * |
|
151 | - * @return void |
|
152 | - */ |
|
149 | + * Edit an advertisement |
|
150 | + * |
|
151 | + * @return void |
|
152 | + */ |
|
153 | 153 | public function action_edit() |
154 | 154 | { |
155 | 155 | $ad_id = $this->request->variable('id', 0); |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |
206 | - * Enable/disable an advertisement |
|
207 | - * |
|
208 | - * @param bool $enable Enable or disable the advertisement? |
|
209 | - * @return void |
|
210 | - */ |
|
206 | + * Enable/disable an advertisement |
|
207 | + * |
|
208 | + * @param bool $enable Enable or disable the advertisement? |
|
209 | + * @return void |
|
210 | + */ |
|
211 | 211 | public function ad_enable($enable) |
212 | 212 | { |
213 | 213 | $sql = 'UPDATE ' . $this->ads_table . ' |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
241 | - * Delete an advertisement |
|
242 | - * |
|
243 | - * @return void |
|
244 | - */ |
|
241 | + * Delete an advertisement |
|
242 | + * |
|
243 | + * @return void |
|
244 | + */ |
|
245 | 245 | public function action_delete() |
246 | 246 | { |
247 | 247 | $ad_id = $this->request->variable('id', 0); |
@@ -277,10 +277,10 @@ discard block |
||
277 | 277 | |
278 | 278 | |
279 | 279 | /** |
280 | - * Display the ads |
|
281 | - * |
|
282 | - * @return void |
|
283 | - */ |
|
280 | + * Display the ads |
|
281 | + * |
|
282 | + * @return void |
|
283 | + */ |
|
284 | 284 | public function list_ads() |
285 | 285 | { |
286 | 286 | $sql = 'SELECT ad_id, ad_name, ad_enabled |
@@ -309,11 +309,11 @@ discard block |
||
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
312 | - * Check the form key. |
|
313 | - * |
|
314 | - * @param string $form_name The name of the form. |
|
315 | - * @return void |
|
316 | - */ |
|
312 | + * Check the form key. |
|
313 | + * |
|
314 | + * @param string $form_name The name of the form. |
|
315 | + * @return void |
|
316 | + */ |
|
317 | 317 | protected function check_form_key($form_name) |
318 | 318 | { |
319 | 319 | if (!check_form_key($form_name)) |
@@ -323,10 +323,10 @@ discard block |
||
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
326 | - * Get admin form data. |
|
327 | - * |
|
328 | - * @return void |
|
329 | - */ |
|
326 | + * Get admin form data. |
|
327 | + * |
|
328 | + * @return void |
|
329 | + */ |
|
330 | 330 | protected function get_form_data() |
331 | 331 | { |
332 | 332 | return array( |
@@ -338,11 +338,11 @@ discard block |
||
338 | 338 | } |
339 | 339 | |
340 | 340 | /** |
341 | - * Validate form data. |
|
342 | - * |
|
343 | - * @param array $data The form data. |
|
344 | - * @return void |
|
345 | - */ |
|
341 | + * Validate form data. |
|
342 | + * |
|
343 | + * @param array $data The form data. |
|
344 | + * @return void |
|
345 | + */ |
|
346 | 346 | protected function validate($data) |
347 | 347 | { |
348 | 348 | if ($data['ad_name'] === '') |
@@ -356,10 +356,10 @@ discard block |
||
356 | 356 | } |
357 | 357 | |
358 | 358 | /** |
359 | - * Assign errors to the template. |
|
360 | - * |
|
361 | - * @return void |
|
362 | - */ |
|
359 | + * Assign errors to the template. |
|
360 | + * |
|
361 | + * @return void |
|
362 | + */ |
|
363 | 363 | protected function assign_errors() |
364 | 364 | { |
365 | 365 | $this->template->assign_vars(array( |
@@ -369,11 +369,11 @@ discard block |
||
369 | 369 | } |
370 | 370 | |
371 | 371 | /** |
372 | - * Assign form data to the template. |
|
373 | - * |
|
374 | - * @param array $data The form data. |
|
375 | - * @return void |
|
376 | - */ |
|
372 | + * Assign form data to the template. |
|
373 | + * |
|
374 | + * @param array $data The form data. |
|
375 | + * @return void |
|
376 | + */ |
|
377 | 377 | protected function assign_form_data($data) |
378 | 378 | { |
379 | 379 | $this->template->assign_vars(array( |
@@ -385,20 +385,20 @@ discard block |
||
385 | 385 | } |
386 | 386 | |
387 | 387 | /** |
388 | - * Print success message. |
|
389 | - * |
|
390 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
391 | - */ |
|
388 | + * Print success message. |
|
389 | + * |
|
390 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
391 | + */ |
|
392 | 392 | protected function success() |
393 | 393 | { |
394 | 394 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action)); |
395 | 395 | } |
396 | 396 | |
397 | 397 | /** |
398 | - * Print error message. |
|
399 | - * |
|
400 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
401 | - */ |
|
398 | + * Print error message. |
|
399 | + * |
|
400 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
401 | + */ |
|
402 | 402 | protected function error() |
403 | 403 | { |
404 | 404 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action), E_USER_WARNING); |