@@ -58,20 +58,20 @@ discard block |
||
| 58 | 58 | protected $errors = array(); |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | - * Constructor |
|
| 62 | - * |
|
| 63 | - * @param \phpbb\template\template $template Template object |
|
| 64 | - * @param \phpbb\user $user User object |
|
| 65 | - * @param \phpbb\request\request $request Request object |
|
| 66 | - * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
| 67 | - * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
| 68 | - * @param \phpbb\log\log $log The phpBB log system |
|
| 69 | - * @param \phpbb\config\config $config Config object |
|
| 70 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 71 | - * @param string $php_ext PHP extension |
|
| 72 | - * @param string $ext_path Path to this extension |
|
| 73 | - * @param string $groups_table Groups table |
|
| 74 | - */ |
|
| 61 | + * Constructor |
|
| 62 | + * |
|
| 63 | + * @param \phpbb\template\template $template Template object |
|
| 64 | + * @param \phpbb\user $user User object |
|
| 65 | + * @param \phpbb\request\request $request Request object |
|
| 66 | + * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
| 67 | + * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
| 68 | + * @param \phpbb\log\log $log The phpBB log system |
|
| 69 | + * @param \phpbb\config\config $config Config object |
|
| 70 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
| 71 | + * @param string $php_ext PHP extension |
|
| 72 | + * @param string $ext_path Path to this extension |
|
| 73 | + * @param string $groups_table Groups table |
|
| 74 | + */ |
|
| 75 | 75 | 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, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, $php_ext, $ext_path, $groups_table) |
| 76 | 76 | { |
| 77 | 77 | $this->template = $template; |
@@ -88,10 +88,10 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | - * Process user request for manage mode |
|
| 92 | - * |
|
| 93 | - * @return void |
|
| 94 | - */ |
|
| 91 | + * Process user request for manage mode |
|
| 92 | + * |
|
| 93 | + * @return void |
|
| 94 | + */ |
|
| 95 | 95 | public function mode_manage() |
| 96 | 96 | { |
| 97 | 97 | $this->setup(); |
@@ -108,10 +108,10 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | - * Process user request for settings mode |
|
| 112 | - * |
|
| 113 | - * @return void |
|
| 114 | - */ |
|
| 111 | + * Process user request for settings mode |
|
| 112 | + * |
|
| 113 | + * @return void |
|
| 114 | + */ |
|
| 115 | 115 | public function mode_settings() |
| 116 | 116 | { |
| 117 | 117 | $this->setup(); |
@@ -148,31 +148,31 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
| 151 | - * Set page url |
|
| 152 | - * |
|
| 153 | - * @param string $u_action Custom form action |
|
| 154 | - * @return void |
|
| 155 | - */ |
|
| 151 | + * Set page url |
|
| 152 | + * |
|
| 153 | + * @param string $u_action Custom form action |
|
| 154 | + * @return void |
|
| 155 | + */ |
|
| 156 | 156 | public function set_page_url($u_action) |
| 157 | 157 | { |
| 158 | 158 | $this->u_action = $u_action; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | - * Get ACP page title for Ads module |
|
| 163 | - * |
|
| 164 | - * @return string Language string for Ads ACP module |
|
| 165 | - */ |
|
| 162 | + * Get ACP page title for Ads module |
|
| 163 | + * |
|
| 164 | + * @return string Language string for Ads ACP module |
|
| 165 | + */ |
|
| 166 | 166 | public function get_page_title() |
| 167 | 167 | { |
| 168 | 168 | return $this->user->lang('ACP_ADMANAGEMENT_TITLE'); |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
| 172 | - * Add an advertisement |
|
| 173 | - * |
|
| 174 | - * @return void |
|
| 175 | - */ |
|
| 172 | + * Add an advertisement |
|
| 173 | + * |
|
| 174 | + * @return void |
|
| 175 | + */ |
|
| 176 | 176 | public function action_add() |
| 177 | 177 | { |
| 178 | 178 | $preview = $this->request->is_set_post('preview'); |
@@ -214,10 +214,10 @@ discard block |
||
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
| 217 | - * Edit an advertisement |
|
| 218 | - * |
|
| 219 | - * @return void |
|
| 220 | - */ |
|
| 217 | + * Edit an advertisement |
|
| 218 | + * |
|
| 219 | + * @return void |
|
| 220 | + */ |
|
| 221 | 221 | public function action_edit() |
| 222 | 222 | { |
| 223 | 223 | $ad_id = $this->request->variable('id', 0); |
@@ -275,30 +275,30 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
| 278 | - * Enable an advertisement |
|
| 279 | - * |
|
| 280 | - * @return void |
|
| 281 | - */ |
|
| 278 | + * Enable an advertisement |
|
| 279 | + * |
|
| 280 | + * @return void |
|
| 281 | + */ |
|
| 282 | 282 | public function action_enable() |
| 283 | 283 | { |
| 284 | 284 | $this->ad_enable(true); |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | /** |
| 288 | - * Disable an advertisement |
|
| 289 | - * |
|
| 290 | - * @return void |
|
| 291 | - */ |
|
| 288 | + * Disable an advertisement |
|
| 289 | + * |
|
| 290 | + * @return void |
|
| 291 | + */ |
|
| 292 | 292 | public function action_disable() |
| 293 | 293 | { |
| 294 | 294 | $this->ad_enable(false); |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
| 298 | - * Delete an advertisement |
|
| 299 | - * |
|
| 300 | - * @return void |
|
| 301 | - */ |
|
| 298 | + * Delete an advertisement |
|
| 299 | + * |
|
| 300 | + * @return void |
|
| 301 | + */ |
|
| 302 | 302 | public function action_delete() |
| 303 | 303 | { |
| 304 | 304 | $ad_id = $this->request->variable('id', 0); |
@@ -341,10 +341,10 @@ discard block |
||
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | /** |
| 344 | - * Display the ads |
|
| 345 | - * |
|
| 346 | - * @return void |
|
| 347 | - */ |
|
| 344 | + * Display the ads |
|
| 345 | + * |
|
| 346 | + * @return void |
|
| 347 | + */ |
|
| 348 | 348 | public function list_ads() |
| 349 | 349 | { |
| 350 | 350 | foreach ($this->manager->get_all_ads() as $row) |
@@ -374,10 +374,10 @@ discard block |
||
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | /** |
| 377 | - * Perform general tasks |
|
| 378 | - * |
|
| 379 | - * @return void |
|
| 380 | - */ |
|
| 377 | + * Perform general tasks |
|
| 378 | + * |
|
| 379 | + * @return void |
|
| 380 | + */ |
|
| 381 | 381 | protected function setup() |
| 382 | 382 | { |
| 383 | 383 | $this->user->add_lang_ext('phpbb/admanagement', 'acp'); |
@@ -386,11 +386,11 @@ discard block |
||
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | /** |
| 389 | - * Enable/disable an advertisement |
|
| 390 | - * |
|
| 391 | - * @param bool $enable Enable or disable the advertisement? |
|
| 392 | - * @return void |
|
| 393 | - */ |
|
| 389 | + * Enable/disable an advertisement |
|
| 390 | + * |
|
| 391 | + * @param bool $enable Enable or disable the advertisement? |
|
| 392 | + * @return void |
|
| 393 | + */ |
|
| 394 | 394 | protected function ad_enable($enable) |
| 395 | 395 | { |
| 396 | 396 | $ad_id = $this->request->variable('id', 0); |
@@ -421,11 +421,11 @@ discard block |
||
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | /** |
| 424 | - * Get admin form data. |
|
| 425 | - * |
|
| 426 | - * @param string $form_name The form name. |
|
| 427 | - * @return array Form data |
|
| 428 | - */ |
|
| 424 | + * Get admin form data. |
|
| 425 | + * |
|
| 426 | + * @param string $form_name The form name. |
|
| 427 | + * @return array Form data |
|
| 428 | + */ |
|
| 429 | 429 | protected function get_form_data($form_name) |
| 430 | 430 | { |
| 431 | 431 | $data = array( |
@@ -476,11 +476,11 @@ discard block |
||
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | /** |
| 479 | - * Assign form data to the template. |
|
| 480 | - * |
|
| 481 | - * @param array $data The form data. |
|
| 482 | - * @return void |
|
| 483 | - */ |
|
| 479 | + * Assign form data to the template. |
|
| 480 | + * |
|
| 481 | + * @param array $data The form data. |
|
| 482 | + * @return void |
|
| 483 | + */ |
|
| 484 | 484 | protected function assign_form_data($data) |
| 485 | 485 | { |
| 486 | 486 | $this->template->assign_vars(array( |
@@ -495,11 +495,11 @@ discard block |
||
| 495 | 495 | )); |
| 496 | 496 | } |
| 497 | 497 | /** |
| 498 | - * Prepare end date for display |
|
| 499 | - * |
|
| 500 | - * @param mixed $end_date End date. |
|
| 501 | - * @return string End date prepared for display. |
|
| 502 | - */ |
|
| 498 | + * Prepare end date for display |
|
| 499 | + * |
|
| 500 | + * @param mixed $end_date End date. |
|
| 501 | + * @return string End date prepared for display. |
|
| 502 | + */ |
|
| 503 | 503 | protected function prepare_end_date($end_date) |
| 504 | 504 | { |
| 505 | 505 | if (empty($end_date)) |
@@ -515,11 +515,11 @@ discard block |
||
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | /** |
| 518 | - * Assign template locations data to the template. |
|
| 519 | - * |
|
| 520 | - * @param mixed $data The form data or nothing. |
|
| 521 | - * @return void |
|
| 522 | - */ |
|
| 518 | + * Assign template locations data to the template. |
|
| 519 | + * |
|
| 520 | + * @param mixed $data The form data or nothing. |
|
| 521 | + * @return void |
|
| 522 | + */ |
|
| 523 | 523 | protected function assign_locations($data = false) |
| 524 | 524 | { |
| 525 | 525 | foreach ($this->location_manager->get_all_locations() as $location_id => $location_data) |
@@ -534,43 +534,43 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | /** |
| 537 | - * Prepare advertisement preview |
|
| 538 | - * |
|
| 539 | - * @param string $code Ad code to preview |
|
| 540 | - * @return void |
|
| 541 | - */ |
|
| 537 | + * Prepare advertisement preview |
|
| 538 | + * |
|
| 539 | + * @param string $code Ad code to preview |
|
| 540 | + * @return void |
|
| 541 | + */ |
|
| 542 | 542 | protected function ad_preview($code) |
| 543 | 543 | { |
| 544 | 544 | $this->template->assign_var('PREVIEW', htmlspecialchars_decode($code)); |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | /** |
| 548 | - * Print success message. |
|
| 549 | - * |
|
| 550 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 551 | - */ |
|
| 548 | + * Print success message. |
|
| 549 | + * |
|
| 550 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 551 | + */ |
|
| 552 | 552 | protected function success() |
| 553 | 553 | { |
| 554 | 554 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action)); |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | /** |
| 558 | - * Print error message. |
|
| 559 | - * |
|
| 560 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 561 | - */ |
|
| 558 | + * Print error message. |
|
| 559 | + * |
|
| 560 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 561 | + */ |
|
| 562 | 562 | protected function error() |
| 563 | 563 | { |
| 564 | 564 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action), E_USER_WARNING); |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | /** |
| 568 | - * Log action |
|
| 569 | - * |
|
| 570 | - * @param string $action Performed action in uppercase |
|
| 571 | - * @param string $ad_name Advertisement name |
|
| 572 | - * @return void |
|
| 573 | - */ |
|
| 568 | + * Log action |
|
| 569 | + * |
|
| 570 | + * @param string $action Performed action in uppercase |
|
| 571 | + * @param string $ad_name Advertisement name |
|
| 572 | + * @return void |
|
| 573 | + */ |
|
| 574 | 574 | protected function log($action, $ad_name) |
| 575 | 575 | { |
| 576 | 576 | $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'ACP_ADMANAGEMENT_' . $action . '_LOG', time(), array($ad_name)); |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | protected $php_ext; |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * {@inheritdoc} |
|
| 46 | - */ |
|
| 45 | + * {@inheritdoc} |
|
| 46 | + */ |
|
| 47 | 47 | static public function getSubscribedEvents() |
| 48 | 48 | { |
| 49 | 49 | return array( |
@@ -52,16 +52,16 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Constructor |
|
| 56 | - * |
|
| 57 | - * @param \phpbb\template\template $template Template object |
|
| 58 | - * @param \phpbb\user\user $user User object |
|
| 59 | - * @param \phpbb\config\config $config Config object |
|
| 60 | - * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
| 61 | - * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
| 62 | - * @param string $root_path phpBB root path |
|
| 63 | - * @param string $php_ext PHP extension |
|
| 64 | - */ |
|
| 55 | + * Constructor |
|
| 56 | + * |
|
| 57 | + * @param \phpbb\template\template $template Template object |
|
| 58 | + * @param \phpbb\user\user $user User object |
|
| 59 | + * @param \phpbb\config\config $config Config object |
|
| 60 | + * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
| 61 | + * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
| 62 | + * @param string $root_path phpBB root path |
|
| 63 | + * @param string $php_ext PHP extension |
|
| 64 | + */ |
|
| 65 | 65 | public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\admanagement\ad\manager $manager, \phpbb\admanagement\location\manager $location_manager, $root_path, $php_ext) |
| 66 | 66 | { |
| 67 | 67 | $this->template = $template; |
@@ -13,26 +13,26 @@ |
||
| 13 | 13 | class m6_hide_for_group 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 isset($this->config['phpbb_admanagement_hide_groups']); |
| 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\m5_end_date'); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * Add the ACP settings module |
|
| 33 | - * |
|
| 34 | - * @return array Array of data update instructions |
|
| 35 | - */ |
|
| 32 | + * Add the ACP settings module |
|
| 33 | + * |
|
| 34 | + * @return array Array of data update instructions |
|
| 35 | + */ |
|
| 36 | 36 | public function update_data() |
| 37 | 37 | { |
| 38 | 38 | return array( |