@@ -13,16 +13,16 @@ |
||
13 | 13 | class after_profile extends base |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritDoc} |
|
17 | - */ |
|
16 | + * {@inheritDoc} |
|
17 | + */ |
|
18 | 18 | public function get_id() |
19 | 19 | { |
20 | 20 | return 'after_profile'; |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | - * {@inheritDoc} |
|
25 | - */ |
|
24 | + * {@inheritDoc} |
|
25 | + */ |
|
26 | 26 | public function will_display() |
27 | 27 | { |
28 | 28 | return strpos($this->user->page['page_name'], 'memberlist') !== false && strpos($this->user->page['query_string'], 'viewprofile') !== false; |
@@ -13,16 +13,16 @@ |
||
13 | 13 | class before_profile extends base |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritDoc} |
|
17 | - */ |
|
16 | + * {@inheritDoc} |
|
17 | + */ |
|
18 | 18 | public function get_id() |
19 | 19 | { |
20 | 20 | return 'before_profile'; |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | - * {@inheritDoc} |
|
25 | - */ |
|
24 | + * {@inheritDoc} |
|
25 | + */ |
|
26 | 26 | public function will_display() |
27 | 27 | { |
28 | 28 | return strpos($this->user->page['page_name'], 'memberlist') !== false && strpos($this->user->page['query_string'], 'viewprofile') !== false; |
@@ -13,16 +13,16 @@ |
||
13 | 13 | class after_not_first_post extends base |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritDoc} |
|
17 | - */ |
|
16 | + * {@inheritDoc} |
|
17 | + */ |
|
18 | 18 | public function get_id() |
19 | 19 | { |
20 | 20 | return 'after_not_first_post'; |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | - * {@inheritDoc} |
|
25 | - */ |
|
24 | + * {@inheritDoc} |
|
25 | + */ |
|
26 | 26 | public function will_display() |
27 | 27 | { |
28 | 28 | return strpos($this->user->page['page_name'], 'viewtopic') !== false; |
@@ -13,8 +13,8 @@ |
||
13 | 13 | class below_footer extends base |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritDoc} |
|
17 | - */ |
|
16 | + * {@inheritDoc} |
|
17 | + */ |
|
18 | 18 | public function get_id() |
19 | 19 | { |
20 | 20 | return 'below_footer'; |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | protected $location_manager; |
31 | 31 | |
32 | 32 | /** |
33 | - * {@inheritdoc} |
|
34 | - */ |
|
33 | + * {@inheritdoc} |
|
34 | + */ |
|
35 | 35 | static public function getSubscribedEvents() |
36 | 36 | { |
37 | 37 | return array( |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * Constructor |
|
44 | - * |
|
45 | - * @param \phpbb\template\template $template Template object |
|
46 | - * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
47 | - * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
48 | - */ |
|
43 | + * Constructor |
|
44 | + * |
|
45 | + * @param \phpbb\template\template $template Template object |
|
46 | + * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
47 | + * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
48 | + */ |
|
49 | 49 | public function __construct(\phpbb\template\template $template, \phpbb\admanagement\ad\manager $manager, \phpbb\admanagement\location\manager $location_manager) |
50 | 50 | { |
51 | 51 | $this->template = $template; |
@@ -16,40 +16,40 @@ |
||
16 | 16 | abstract class base implements \phpbb\admanagement\location\type\type_interface |
17 | 17 | { |
18 | 18 | /** |
19 | - * User object |
|
20 | - * @var \phpbb\user |
|
21 | - */ |
|
19 | + * User object |
|
20 | + * @var \phpbb\user |
|
21 | + */ |
|
22 | 22 | protected $user; |
23 | 23 | |
24 | 24 | /** |
25 | - * Construct an after_profile template location object |
|
26 | - * |
|
27 | - * @param \phpbb\user $user User object |
|
28 | - */ |
|
25 | + * Construct an after_profile template location object |
|
26 | + * |
|
27 | + * @param \phpbb\user $user User object |
|
28 | + */ |
|
29 | 29 | public function __construct(\phpbb\user $user) |
30 | 30 | { |
31 | 31 | $this->user = $user; |
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
35 | - * {@inheritDoc} |
|
36 | - */ |
|
35 | + * {@inheritDoc} |
|
36 | + */ |
|
37 | 37 | public function get_name() |
38 | 38 | { |
39 | 39 | return $this->user->lang('AD_' . strtoupper($this->get_id())); |
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * {@inheritDoc} |
|
44 | - */ |
|
43 | + * {@inheritDoc} |
|
44 | + */ |
|
45 | 45 | public function get_desc() |
46 | 46 | { |
47 | 47 | return $this->user->lang('AD_' . strtoupper($this->get_id()) . '_DESC'); |
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | - * {@inheritDoc} |
|
52 | - */ |
|
51 | + * {@inheritDoc} |
|
52 | + */ |
|
53 | 53 | public function will_display() |
54 | 54 | { |
55 | 55 | return true; |
@@ -13,30 +13,30 @@ discard block |
||
13 | 13 | class m3_template_locations_schema 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 | return $this->db_tools->sql_table_exists($this->table_prefix . 'ad_locations'); |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | - * {@inheritDoc} |
|
25 | - */ |
|
24 | + * {@inheritDoc} |
|
25 | + */ |
|
26 | 26 | static public function depends_on() |
27 | 27 | { |
28 | 28 | return array('\phpbb\admanagement\migrations\v10x\m2_acp_module'); |
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
32 | - * Add the ad_locations table schema to the database: |
|
33 | - * ad_locations: |
|
34 | - * ad_id |
|
35 | - * location_id |
|
36 | - * |
|
37 | - * @return array Array of table schema |
|
38 | - * @access public |
|
39 | - */ |
|
32 | + * Add the ad_locations table schema to the database: |
|
33 | + * ad_locations: |
|
34 | + * ad_id |
|
35 | + * location_id |
|
36 | + * |
|
37 | + * @return array Array of table schema |
|
38 | + * @access public |
|
39 | + */ |
|
40 | 40 | public function update_schema() |
41 | 41 | { |
42 | 42 | return array( |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
56 | - * Drop the ad_locations table schema from the database |
|
57 | - * |
|
58 | - * @return array Array of table schema |
|
59 | - * @access public |
|
60 | - */ |
|
56 | + * Drop the ad_locations table schema from the database |
|
57 | + * |
|
58 | + * @return array Array of table schema |
|
59 | + * @access public |
|
60 | + */ |
|
61 | 61 | public function revert_schema() |
62 | 62 | { |
63 | 63 | return array( |
@@ -13,27 +13,27 @@ discard block |
||
13 | 13 | class m4_indexes 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 | return $this->db_tools->sql_index_exists($this->table_prefix . 'ads', 'ad_enabled'); |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
24 | - * {@inheritDoc} |
|
25 | - */ |
|
24 | + * {@inheritDoc} |
|
25 | + */ |
|
26 | 26 | static public function depends_on() |
27 | 27 | { |
28 | 28 | return array('\phpbb\admanagement\migrations\v10x\m3_template_locations_schema'); |
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
32 | - * Add the indexes |
|
33 | - * |
|
34 | - * @return array Array of altered table schema |
|
35 | - * @access public |
|
36 | - */ |
|
32 | + * Add the indexes |
|
33 | + * |
|
34 | + * @return array Array of altered table schema |
|
35 | + * @access public |
|
36 | + */ |
|
37 | 37 | public function update_schema() |
38 | 38 | { |
39 | 39 | return array( |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * Drop the indexes |
|
53 | - * |
|
54 | - * @return array Array of altered table schema |
|
55 | - * @access public |
|
56 | - */ |
|
52 | + * Drop the indexes |
|
53 | + * |
|
54 | + * @return array Array of altered table schema |
|
55 | + * @access public |
|
56 | + */ |
|
57 | 57 | public function revert_schema() |
58 | 58 | { |
59 | 59 | return array( |
@@ -49,17 +49,17 @@ discard block |
||
49 | 49 | protected $errors = array(); |
50 | 50 | |
51 | 51 | /** |
52 | - * Constructor |
|
53 | - * |
|
54 | - * @param \phpbb\template\template $template Template object |
|
55 | - * @param \phpbb\user $user User object |
|
56 | - * @param \phpbb\request\request $request Request object |
|
57 | - * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
58 | - * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
59 | - * @param \phpbb\log\log $log The phpBB log system |
|
60 | - * @param string $php_ext PHP extension |
|
61 | - * @param string $ext_path Path to this extension |
|
62 | - */ |
|
52 | + * Constructor |
|
53 | + * |
|
54 | + * @param \phpbb\template\template $template Template object |
|
55 | + * @param \phpbb\user $user User object |
|
56 | + * @param \phpbb\request\request $request Request object |
|
57 | + * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
58 | + * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
59 | + * @param \phpbb\log\log $log The phpBB log system |
|
60 | + * @param string $php_ext PHP extension |
|
61 | + * @param string $ext_path Path to this extension |
|
62 | + */ |
|
63 | 63 | public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\request\request $request, \phpbb\admanagement\ad\manager $manager, \phpbb\admanagement\location\manager $location_manager, \phpbb\log\log $log, $php_ext, $ext_path) |
64 | 64 | { |
65 | 65 | $this->template = $template; |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
76 | - * Process user request |
|
77 | - * |
|
78 | - * @return void |
|
79 | - */ |
|
76 | + * Process user request |
|
77 | + * |
|
78 | + * @return void |
|
79 | + */ |
|
80 | 80 | public function main() |
81 | 81 | { |
82 | 82 | $this->user->add_lang_ext('phpbb/admanagement', 'acp'); |
@@ -95,31 +95,31 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
98 | - * Set page url |
|
99 | - * |
|
100 | - * @param string $u_action Custom form action |
|
101 | - * @return void |
|
102 | - */ |
|
98 | + * Set page url |
|
99 | + * |
|
100 | + * @param string $u_action Custom form action |
|
101 | + * @return void |
|
102 | + */ |
|
103 | 103 | public function set_page_url($u_action) |
104 | 104 | { |
105 | 105 | $this->u_action = $u_action; |
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * Get ACP page title for Ads module |
|
110 | - * |
|
111 | - * @return string Language string for Ads ACP module |
|
112 | - */ |
|
109 | + * Get ACP page title for Ads module |
|
110 | + * |
|
111 | + * @return string Language string for Ads ACP module |
|
112 | + */ |
|
113 | 113 | public function get_page_title() |
114 | 114 | { |
115 | 115 | return $this->user->lang('ACP_ADMANAGEMENT_TITLE'); |
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
119 | - * Add an advertisement |
|
120 | - * |
|
121 | - * @return void |
|
122 | - */ |
|
119 | + * Add an advertisement |
|
120 | + * |
|
121 | + * @return void |
|
122 | + */ |
|
123 | 123 | public function action_add() |
124 | 124 | { |
125 | 125 | $preview = $this->request->is_set_post('preview'); |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
164 | - * Edit an advertisement |
|
165 | - * |
|
166 | - * @return void |
|
167 | - */ |
|
164 | + * Edit an advertisement |
|
165 | + * |
|
166 | + * @return void |
|
167 | + */ |
|
168 | 168 | public function action_edit() |
169 | 169 | { |
170 | 170 | $ad_id = $this->request->variable('id', 0); |
@@ -222,30 +222,30 @@ discard block |
||
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
225 | - * Enable an advertisement |
|
226 | - * |
|
227 | - * @return void |
|
228 | - */ |
|
225 | + * Enable an advertisement |
|
226 | + * |
|
227 | + * @return void |
|
228 | + */ |
|
229 | 229 | public function action_enable() |
230 | 230 | { |
231 | 231 | $this->ad_enable(true); |
232 | 232 | } |
233 | 233 | |
234 | 234 | /** |
235 | - * Disable an advertisement |
|
236 | - * |
|
237 | - * @return void |
|
238 | - */ |
|
235 | + * Disable an advertisement |
|
236 | + * |
|
237 | + * @return void |
|
238 | + */ |
|
239 | 239 | public function action_disable() |
240 | 240 | { |
241 | 241 | $this->ad_enable(false); |
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
245 | - * Delete an advertisement |
|
246 | - * |
|
247 | - * @return void |
|
248 | - */ |
|
245 | + * Delete an advertisement |
|
246 | + * |
|
247 | + * @return void |
|
248 | + */ |
|
249 | 249 | public function action_delete() |
250 | 250 | { |
251 | 251 | $ad_id = $this->request->variable('id', 0); |
@@ -288,10 +288,10 @@ discard block |
||
288 | 288 | } |
289 | 289 | |
290 | 290 | /** |
291 | - * Display the ads |
|
292 | - * |
|
293 | - * @return void |
|
294 | - */ |
|
291 | + * Display the ads |
|
292 | + * |
|
293 | + * @return void |
|
294 | + */ |
|
295 | 295 | public function list_ads() |
296 | 296 | { |
297 | 297 | foreach ($this->manager->get_all_ads() as $row) |
@@ -321,11 +321,11 @@ discard block |
||
321 | 321 | } |
322 | 322 | |
323 | 323 | /** |
324 | - * Enable/disable an advertisement |
|
325 | - * |
|
326 | - * @param bool $enable Enable or disable the advertisement? |
|
327 | - * @return void |
|
328 | - */ |
|
324 | + * Enable/disable an advertisement |
|
325 | + * |
|
326 | + * @param bool $enable Enable or disable the advertisement? |
|
327 | + * @return void |
|
328 | + */ |
|
329 | 329 | protected function ad_enable($enable) |
330 | 330 | { |
331 | 331 | $ad_id = $this->request->variable('id', 0); |
@@ -356,11 +356,11 @@ discard block |
||
356 | 356 | } |
357 | 357 | |
358 | 358 | /** |
359 | - * Get admin form data. |
|
360 | - * |
|
361 | - * @param string $form_name The form name. |
|
362 | - * @return array Form data |
|
363 | - */ |
|
359 | + * Get admin form data. |
|
360 | + * |
|
361 | + * @param string $form_name The form name. |
|
362 | + * @return array Form data |
|
363 | + */ |
|
364 | 364 | protected function get_form_data($form_name) |
365 | 365 | { |
366 | 366 | $data = array( |
@@ -411,11 +411,11 @@ discard block |
||
411 | 411 | } |
412 | 412 | |
413 | 413 | /** |
414 | - * Assign form data to the template. |
|
415 | - * |
|
416 | - * @param array $data The form data. |
|
417 | - * @return void |
|
418 | - */ |
|
414 | + * Assign form data to the template. |
|
415 | + * |
|
416 | + * @param array $data The form data. |
|
417 | + * @return void |
|
418 | + */ |
|
419 | 419 | protected function assign_form_data($data) |
420 | 420 | { |
421 | 421 | $this->template->assign_vars(array( |
@@ -430,11 +430,11 @@ discard block |
||
430 | 430 | )); |
431 | 431 | } |
432 | 432 | /** |
433 | - * Prepare end date for display |
|
434 | - * |
|
435 | - * @param mixed $end_date End date. |
|
436 | - * @return string End date prepared for display. |
|
437 | - */ |
|
433 | + * Prepare end date for display |
|
434 | + * |
|
435 | + * @param mixed $end_date End date. |
|
436 | + * @return string End date prepared for display. |
|
437 | + */ |
|
438 | 438 | protected function prepare_end_date($end_date) |
439 | 439 | { |
440 | 440 | if (empty($end_date)) |
@@ -450,11 +450,11 @@ discard block |
||
450 | 450 | } |
451 | 451 | |
452 | 452 | /** |
453 | - * Assign template locations data to the template. |
|
454 | - * |
|
455 | - * @param mixed $data The form data or nothing. |
|
456 | - * @return void |
|
457 | - */ |
|
453 | + * Assign template locations data to the template. |
|
454 | + * |
|
455 | + * @param mixed $data The form data or nothing. |
|
456 | + * @return void |
|
457 | + */ |
|
458 | 458 | protected function assign_locations($data = false) |
459 | 459 | { |
460 | 460 | foreach ($this->location_manager->get_all_locations() as $location_id => $location_data) |
@@ -469,43 +469,43 @@ discard block |
||
469 | 469 | } |
470 | 470 | |
471 | 471 | /** |
472 | - * Prepare advertisement preview |
|
473 | - * |
|
474 | - * @param string $code Ad code to preview |
|
475 | - * @return void |
|
476 | - */ |
|
472 | + * Prepare advertisement preview |
|
473 | + * |
|
474 | + * @param string $code Ad code to preview |
|
475 | + * @return void |
|
476 | + */ |
|
477 | 477 | protected function ad_preview($code) |
478 | 478 | { |
479 | 479 | $this->template->assign_var('PREVIEW', htmlspecialchars_decode($code)); |
480 | 480 | } |
481 | 481 | |
482 | 482 | /** |
483 | - * Print success message. |
|
484 | - * |
|
485 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
486 | - */ |
|
483 | + * Print success message. |
|
484 | + * |
|
485 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
486 | + */ |
|
487 | 487 | protected function success() |
488 | 488 | { |
489 | 489 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action)); |
490 | 490 | } |
491 | 491 | |
492 | 492 | /** |
493 | - * Print error message. |
|
494 | - * |
|
495 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
496 | - */ |
|
493 | + * Print error message. |
|
494 | + * |
|
495 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
496 | + */ |
|
497 | 497 | protected function error() |
498 | 498 | { |
499 | 499 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action), E_USER_WARNING); |
500 | 500 | } |
501 | 501 | |
502 | 502 | /** |
503 | - * Log action |
|
504 | - * |
|
505 | - * @param string $action Performed action in uppercase |
|
506 | - * @param string $ad_name Advertisement name |
|
507 | - * @return void |
|
508 | - */ |
|
503 | + * Log action |
|
504 | + * |
|
505 | + * @param string $action Performed action in uppercase |
|
506 | + * @param string $ad_name Advertisement name |
|
507 | + * @return void |
|
508 | + */ |
|
509 | 509 | protected function log($action, $ad_name) |
510 | 510 | { |
511 | 511 | $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'ACP_ADMANAGEMENT_' . $action . '_LOG', time(), array($ad_name)); |