@@ -59,20 +59,20 @@ discard block |
||
59 | 59 | protected $errors = array(); |
60 | 60 | |
61 | 61 | /** |
62 | - * Constructor |
|
63 | - * |
|
64 | - * @param \phpbb\template\template $template Template object |
|
65 | - * @param \phpbb\user $user User object |
|
66 | - * @param \phpbb\request\request $request Request object |
|
67 | - * @param \phpbb\ads\ad\manager $manager Advertisement manager object |
|
68 | - * @param \phpbb\ads\location\manager $location_manager Template location manager object |
|
69 | - * @param \phpbb\log\log $log The phpBB log system |
|
70 | - * @param \phpbb\config\db_text $config_text Config text object |
|
71 | - * @param \phpbb\config\config $config Config object |
|
72 | - * @param \phpbb\files\upload $files_upload Files upload object |
|
73 | - * @param string $php_ext PHP extension |
|
74 | - * @param string $ext_path Path to this extension |
|
75 | - */ |
|
62 | + * Constructor |
|
63 | + * |
|
64 | + * @param \phpbb\template\template $template Template object |
|
65 | + * @param \phpbb\user $user User object |
|
66 | + * @param \phpbb\request\request $request Request object |
|
67 | + * @param \phpbb\ads\ad\manager $manager Advertisement manager object |
|
68 | + * @param \phpbb\ads\location\manager $location_manager Template location manager object |
|
69 | + * @param \phpbb\log\log $log The phpBB log system |
|
70 | + * @param \phpbb\config\db_text $config_text Config text object |
|
71 | + * @param \phpbb\config\config $config Config object |
|
72 | + * @param \phpbb\files\upload $files_upload Files upload object |
|
73 | + * @param string $php_ext PHP extension |
|
74 | + * @param string $ext_path Path to this extension |
|
75 | + */ |
|
76 | 76 | public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\request\request $request, \phpbb\ads\ad\manager $manager, \phpbb\ads\location\manager $location_manager, \phpbb\log\log $log, \phpbb\config\db_text $config_text, \phpbb\config\config $config, \phpbb\files\upload $files_upload, $php_ext, $ext_path) |
77 | 77 | { |
78 | 78 | $this->template = $template; |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
92 | - * Process user request for manage mode |
|
93 | - * |
|
94 | - * @return void |
|
95 | - */ |
|
92 | + * Process user request for manage mode |
|
93 | + * |
|
94 | + * @return void |
|
95 | + */ |
|
96 | 96 | public function mode_manage() |
97 | 97 | { |
98 | 98 | $this->setup(); |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
112 | - * Process user request for settings mode |
|
113 | - * |
|
114 | - * @return void |
|
115 | - */ |
|
112 | + * Process user request for settings mode |
|
113 | + * |
|
114 | + * @return void |
|
115 | + */ |
|
116 | 116 | public function mode_settings() |
117 | 117 | { |
118 | 118 | $this->setup(); |
@@ -164,31 +164,31 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
167 | - * Set page url |
|
168 | - * |
|
169 | - * @param string $u_action Custom form action |
|
170 | - * @return void |
|
171 | - */ |
|
167 | + * Set page url |
|
168 | + * |
|
169 | + * @param string $u_action Custom form action |
|
170 | + * @return void |
|
171 | + */ |
|
172 | 172 | public function set_page_url($u_action) |
173 | 173 | { |
174 | 174 | $this->u_action = $u_action; |
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
178 | - * Get ACP page title for Ads module |
|
179 | - * |
|
180 | - * @return string Language string for Ads ACP module |
|
181 | - */ |
|
178 | + * Get ACP page title for Ads module |
|
179 | + * |
|
180 | + * @return string Language string for Ads ACP module |
|
181 | + */ |
|
182 | 182 | public function get_page_title() |
183 | 183 | { |
184 | 184 | return $this->user->lang('ACP_PHPBB_ADS_TITLE'); |
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
188 | - * Add an advertisement |
|
189 | - * |
|
190 | - * @return void |
|
191 | - */ |
|
188 | + * Add an advertisement |
|
189 | + * |
|
190 | + * @return void |
|
191 | + */ |
|
192 | 192 | public function action_add() |
193 | 193 | { |
194 | 194 | $preview = $this->request->is_set_post('preview'); |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | } |
237 | 237 | |
238 | 238 | /** |
239 | - * Edit an advertisement |
|
240 | - * |
|
241 | - * @return void |
|
242 | - */ |
|
239 | + * Edit an advertisement |
|
240 | + * |
|
241 | + * @return void |
|
242 | + */ |
|
243 | 243 | public function action_edit() |
244 | 244 | { |
245 | 245 | $ad_id = $this->request->variable('id', 0); |
@@ -303,30 +303,30 @@ discard block |
||
303 | 303 | } |
304 | 304 | |
305 | 305 | /** |
306 | - * Enable an advertisement |
|
307 | - * |
|
308 | - * @return void |
|
309 | - */ |
|
306 | + * Enable an advertisement |
|
307 | + * |
|
308 | + * @return void |
|
309 | + */ |
|
310 | 310 | public function action_enable() |
311 | 311 | { |
312 | 312 | $this->ad_enable(true); |
313 | 313 | } |
314 | 314 | |
315 | 315 | /** |
316 | - * Disable an advertisement |
|
317 | - * |
|
318 | - * @return void |
|
319 | - */ |
|
316 | + * Disable an advertisement |
|
317 | + * |
|
318 | + * @return void |
|
319 | + */ |
|
320 | 320 | public function action_disable() |
321 | 321 | { |
322 | 322 | $this->ad_enable(false); |
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
326 | - * Delete an advertisement |
|
327 | - * |
|
328 | - * @return void |
|
329 | - */ |
|
326 | + * Delete an advertisement |
|
327 | + * |
|
328 | + * @return void |
|
329 | + */ |
|
330 | 330 | public function action_delete() |
331 | 331 | { |
332 | 332 | $ad_id = $this->request->variable('id', 0); |
@@ -369,10 +369,10 @@ discard block |
||
369 | 369 | } |
370 | 370 | |
371 | 371 | /** |
372 | - * Display the ads |
|
373 | - * |
|
374 | - * @return void |
|
375 | - */ |
|
372 | + * Display the ads |
|
373 | + * |
|
374 | + * @return void |
|
375 | + */ |
|
376 | 376 | public function list_ads() |
377 | 377 | { |
378 | 378 | foreach ($this->manager->get_all_ads() as $row) |
@@ -410,10 +410,10 @@ discard block |
||
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
413 | - * Perform general tasks |
|
414 | - * |
|
415 | - * @return void |
|
416 | - */ |
|
413 | + * Perform general tasks |
|
414 | + * |
|
415 | + * @return void |
|
416 | + */ |
|
417 | 417 | protected function setup() |
418 | 418 | { |
419 | 419 | $this->user->add_lang('posting'); // Used by process_banner_upload() file errors |
@@ -423,11 +423,11 @@ discard block |
||
423 | 423 | } |
424 | 424 | |
425 | 425 | /** |
426 | - * Enable/disable an advertisement |
|
427 | - * |
|
428 | - * @param bool $enable Enable or disable the advertisement? |
|
429 | - * @return void |
|
430 | - */ |
|
426 | + * Enable/disable an advertisement |
|
427 | + * |
|
428 | + * @param bool $enable Enable or disable the advertisement? |
|
429 | + * @return void |
|
430 | + */ |
|
431 | 431 | protected function ad_enable($enable) |
432 | 432 | { |
433 | 433 | $ad_id = $this->request->variable('id', 0); |
@@ -512,11 +512,11 @@ discard block |
||
512 | 512 | } |
513 | 513 | |
514 | 514 | /** |
515 | - * Get admin form data. |
|
516 | - * |
|
517 | - * @param string $form_name The form name. |
|
518 | - * @return array Form data |
|
519 | - */ |
|
515 | + * Get admin form data. |
|
516 | + * |
|
517 | + * @param string $form_name The form name. |
|
518 | + * @return array Form data |
|
519 | + */ |
|
520 | 520 | protected function get_form_data($form_name) |
521 | 521 | { |
522 | 522 | $data = array( |
@@ -588,11 +588,11 @@ discard block |
||
588 | 588 | } |
589 | 589 | |
590 | 590 | /** |
591 | - * Assign form data to the template. |
|
592 | - * |
|
593 | - * @param array $data The form data. |
|
594 | - * @return void |
|
595 | - */ |
|
591 | + * Assign form data to the template. |
|
592 | + * |
|
593 | + * @param array $data The form data. |
|
594 | + * @return void |
|
595 | + */ |
|
596 | 596 | protected function assign_form_data($data) |
597 | 597 | { |
598 | 598 | $this->template->assign_vars(array( |
@@ -611,11 +611,11 @@ discard block |
||
611 | 611 | } |
612 | 612 | |
613 | 613 | /** |
614 | - * Prepare end date for display |
|
615 | - * |
|
616 | - * @param mixed $end_date End date. |
|
617 | - * @return string End date prepared for display. |
|
618 | - */ |
|
614 | + * Prepare end date for display |
|
615 | + * |
|
616 | + * @param mixed $end_date End date. |
|
617 | + * @return string End date prepared for display. |
|
618 | + */ |
|
619 | 619 | protected function prepare_end_date($end_date) |
620 | 620 | { |
621 | 621 | if (empty($end_date)) |
@@ -632,11 +632,11 @@ discard block |
||
632 | 632 | } |
633 | 633 | |
634 | 634 | /** |
635 | - * Assign template locations data to the template. |
|
636 | - * |
|
637 | - * @param mixed $data The form data or nothing. |
|
638 | - * @return void |
|
639 | - */ |
|
635 | + * Assign template locations data to the template. |
|
636 | + * |
|
637 | + * @param mixed $data The form data or nothing. |
|
638 | + * @return void |
|
639 | + */ |
|
640 | 640 | protected function assign_locations($data = false) |
641 | 641 | { |
642 | 642 | foreach ($this->location_manager->get_all_locations() as $location_id => $location_data) |
@@ -651,43 +651,43 @@ discard block |
||
651 | 651 | } |
652 | 652 | |
653 | 653 | /** |
654 | - * Prepare advertisement preview |
|
655 | - * |
|
656 | - * @param string $code Ad code to preview |
|
657 | - * @return void |
|
658 | - */ |
|
654 | + * Prepare advertisement preview |
|
655 | + * |
|
656 | + * @param string $code Ad code to preview |
|
657 | + * @return void |
|
658 | + */ |
|
659 | 659 | protected function ad_preview($code) |
660 | 660 | { |
661 | 661 | $this->template->assign_var('PREVIEW', htmlspecialchars_decode($code)); |
662 | 662 | } |
663 | 663 | |
664 | 664 | /** |
665 | - * Print success message. |
|
666 | - * |
|
667 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
668 | - */ |
|
665 | + * Print success message. |
|
666 | + * |
|
667 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
668 | + */ |
|
669 | 669 | protected function success() |
670 | 670 | { |
671 | 671 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action)); |
672 | 672 | } |
673 | 673 | |
674 | 674 | /** |
675 | - * Print error message. |
|
676 | - * |
|
677 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
678 | - */ |
|
675 | + * Print error message. |
|
676 | + * |
|
677 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
678 | + */ |
|
679 | 679 | protected function error() |
680 | 680 | { |
681 | 681 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action), E_USER_WARNING); |
682 | 682 | } |
683 | 683 | |
684 | 684 | /** |
685 | - * Log action |
|
686 | - * |
|
687 | - * @param string $action Performed action in uppercase |
|
688 | - * @param string $ad_name Advertisement name |
|
689 | - * @return void |
|
690 | - */ |
|
685 | + * Log action |
|
686 | + * |
|
687 | + * @param string $action Performed action in uppercase |
|
688 | + * @param string $ad_name Advertisement name |
|
689 | + * @return void |
|
690 | + */ |
|
691 | 691 | protected function log($action, $ad_name) |
692 | 692 | { |
693 | 693 | $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'ACP_PHPBB_ADS_' . $action . '_LOG', time(), array($ad_name)); |