@@ -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( |
@@ -48,17 +48,17 @@ discard block |
||
| 48 | 48 | protected $errors = array(); |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | - * Constructor |
|
| 52 | - * |
|
| 53 | - * @param \phpbb\template\template $template Template object |
|
| 54 | - * @param \phpbb\user $user User object |
|
| 55 | - * @param \phpbb\request\request $request Request object |
|
| 56 | - * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
| 57 | - * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
| 58 | - * @param \phpbb\log\log $log The phpBB log system |
|
| 59 | - * @param string $php_ext PHP extension |
|
| 60 | - * @param string $ext_path Path to this extension |
|
| 61 | - */ |
|
| 51 | + * Constructor |
|
| 52 | + * |
|
| 53 | + * @param \phpbb\template\template $template Template object |
|
| 54 | + * @param \phpbb\user $user User object |
|
| 55 | + * @param \phpbb\request\request $request Request object |
|
| 56 | + * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
| 57 | + * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
| 58 | + * @param \phpbb\log\log $log The phpBB log system |
|
| 59 | + * @param string $php_ext PHP extension |
|
| 60 | + * @param string $ext_path Path to this extension |
|
| 61 | + */ |
|
| 62 | 62 | 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) |
| 63 | 63 | { |
| 64 | 64 | $this->template = $template; |
@@ -72,10 +72,10 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | - * Process user request |
|
| 76 | - * |
|
| 77 | - * @return void |
|
| 78 | - */ |
|
| 75 | + * Process user request |
|
| 76 | + * |
|
| 77 | + * @return void |
|
| 78 | + */ |
|
| 79 | 79 | public function main() |
| 80 | 80 | { |
| 81 | 81 | $this->user->add_lang_ext('phpbb/admanagement', 'acp'); |
@@ -92,31 +92,31 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | - * Set page url |
|
| 96 | - * |
|
| 97 | - * @param string $u_action Custom form action |
|
| 98 | - * @return void |
|
| 99 | - */ |
|
| 95 | + * Set page url |
|
| 96 | + * |
|
| 97 | + * @param string $u_action Custom form action |
|
| 98 | + * @return void |
|
| 99 | + */ |
|
| 100 | 100 | public function set_page_url($u_action) |
| 101 | 101 | { |
| 102 | 102 | $this->u_action = $u_action; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | - * Get ACP page title for Ads module |
|
| 107 | - * |
|
| 108 | - * @return string Language string for Ads ACP module |
|
| 109 | - */ |
|
| 106 | + * Get ACP page title for Ads module |
|
| 107 | + * |
|
| 108 | + * @return string Language string for Ads ACP module |
|
| 109 | + */ |
|
| 110 | 110 | public function get_page_title() |
| 111 | 111 | { |
| 112 | 112 | return $this->user->lang('ACP_ADMANAGEMENT_TITLE'); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | - * Add an advertisement |
|
| 117 | - * |
|
| 118 | - * @return void |
|
| 119 | - */ |
|
| 116 | + * Add an advertisement |
|
| 117 | + * |
|
| 118 | + * @return void |
|
| 119 | + */ |
|
| 120 | 120 | public function action_add() |
| 121 | 121 | { |
| 122 | 122 | $preview = $this->request->is_set_post('preview'); |
@@ -159,10 +159,10 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | - * Edit an advertisement |
|
| 163 | - * |
|
| 164 | - * @return void |
|
| 165 | - */ |
|
| 162 | + * Edit an advertisement |
|
| 163 | + * |
|
| 164 | + * @return void |
|
| 165 | + */ |
|
| 166 | 166 | public function action_edit() |
| 167 | 167 | { |
| 168 | 168 | $ad_id = $this->request->variable('id', 0); |
@@ -221,30 +221,30 @@ discard block |
||
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | /** |
| 224 | - * Enable an advertisement |
|
| 225 | - * |
|
| 226 | - * @return void |
|
| 227 | - */ |
|
| 224 | + * Enable an advertisement |
|
| 225 | + * |
|
| 226 | + * @return void |
|
| 227 | + */ |
|
| 228 | 228 | public function action_enable() |
| 229 | 229 | { |
| 230 | 230 | $this->ad_enable(true); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
| 234 | - * Disable an advertisement |
|
| 235 | - * |
|
| 236 | - * @return void |
|
| 237 | - */ |
|
| 234 | + * Disable an advertisement |
|
| 235 | + * |
|
| 236 | + * @return void |
|
| 237 | + */ |
|
| 238 | 238 | public function action_disable() |
| 239 | 239 | { |
| 240 | 240 | $this->ad_enable(false); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /** |
| 244 | - * Delete an advertisement |
|
| 245 | - * |
|
| 246 | - * @return void |
|
| 247 | - */ |
|
| 244 | + * Delete an advertisement |
|
| 245 | + * |
|
| 246 | + * @return void |
|
| 247 | + */ |
|
| 248 | 248 | public function action_delete() |
| 249 | 249 | { |
| 250 | 250 | $ad_id = $this->request->variable('id', 0); |
@@ -287,10 +287,10 @@ discard block |
||
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | /** |
| 290 | - * Display the ads |
|
| 291 | - * |
|
| 292 | - * @return void |
|
| 293 | - */ |
|
| 290 | + * Display the ads |
|
| 291 | + * |
|
| 292 | + * @return void |
|
| 293 | + */ |
|
| 294 | 294 | public function list_ads() |
| 295 | 295 | { |
| 296 | 296 | foreach ($this->manager->get_all_ads() as $row) |
@@ -313,11 +313,11 @@ discard block |
||
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | /** |
| 316 | - * Enable/disable an advertisement |
|
| 317 | - * |
|
| 318 | - * @param bool $enable Enable or disable the advertisement? |
|
| 319 | - * @return void |
|
| 320 | - */ |
|
| 316 | + * Enable/disable an advertisement |
|
| 317 | + * |
|
| 318 | + * @param bool $enable Enable or disable the advertisement? |
|
| 319 | + * @return void |
|
| 320 | + */ |
|
| 321 | 321 | protected function ad_enable($enable) |
| 322 | 322 | { |
| 323 | 323 | $ad_id = $this->request->variable('id', 0); |
@@ -348,10 +348,10 @@ discard block |
||
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | /** |
| 351 | - * Get admin form data. |
|
| 352 | - * |
|
| 353 | - * @return array Form data |
|
| 354 | - */ |
|
| 351 | + * Get admin form data. |
|
| 352 | + * |
|
| 353 | + * @return array Form data |
|
| 354 | + */ |
|
| 355 | 355 | protected function get_form_data() |
| 356 | 356 | { |
| 357 | 357 | return array( |
@@ -364,12 +364,12 @@ discard block |
||
| 364 | 364 | } |
| 365 | 365 | |
| 366 | 366 | /** |
| 367 | - * Validate form data. |
|
| 368 | - * |
|
| 369 | - * @param array $data The form data. |
|
| 370 | - * @param string $form_name The form name. |
|
| 371 | - * @return void |
|
| 372 | - */ |
|
| 367 | + * Validate form data. |
|
| 368 | + * |
|
| 369 | + * @param array $data The form data. |
|
| 370 | + * @param string $form_name The form name. |
|
| 371 | + * @return void |
|
| 372 | + */ |
|
| 373 | 373 | protected function validate($data, $form_name) |
| 374 | 374 | { |
| 375 | 375 | if (!check_form_key($form_name)) |
@@ -388,11 +388,11 @@ discard block |
||
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | /** |
| 391 | - * Assign form data to the template. |
|
| 392 | - * |
|
| 393 | - * @param array $data The form data. |
|
| 394 | - * @return void |
|
| 395 | - */ |
|
| 391 | + * Assign form data to the template. |
|
| 392 | + * |
|
| 393 | + * @param array $data The form data. |
|
| 394 | + * @return void |
|
| 395 | + */ |
|
| 396 | 396 | protected function assign_form_data($data) |
| 397 | 397 | { |
| 398 | 398 | $this->template->assign_vars(array( |
@@ -407,11 +407,11 @@ discard block |
||
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | /** |
| 410 | - * Assign template locations data to the template. |
|
| 411 | - * |
|
| 412 | - * @param mixed $data The form data or nothing. |
|
| 413 | - * @return void |
|
| 414 | - */ |
|
| 410 | + * Assign template locations data to the template. |
|
| 411 | + * |
|
| 412 | + * @param mixed $data The form data or nothing. |
|
| 413 | + * @return void |
|
| 414 | + */ |
|
| 415 | 415 | protected function assign_locations($data = false) |
| 416 | 416 | { |
| 417 | 417 | foreach ($this->location_manager->get_all_locations() as $location_id => $location_data) |
@@ -426,43 +426,43 @@ discard block |
||
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | /** |
| 429 | - * Prepare advertisement preview |
|
| 430 | - * |
|
| 431 | - * @param string $code Ad code to preview |
|
| 432 | - * @return void |
|
| 433 | - */ |
|
| 429 | + * Prepare advertisement preview |
|
| 430 | + * |
|
| 431 | + * @param string $code Ad code to preview |
|
| 432 | + * @return void |
|
| 433 | + */ |
|
| 434 | 434 | protected function ad_preview($code) |
| 435 | 435 | { |
| 436 | 436 | $this->template->assign_var('PREVIEW', htmlspecialchars_decode($code)); |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | /** |
| 440 | - * Print success message. |
|
| 441 | - * |
|
| 442 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 443 | - */ |
|
| 440 | + * Print success message. |
|
| 441 | + * |
|
| 442 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 443 | + */ |
|
| 444 | 444 | protected function success() |
| 445 | 445 | { |
| 446 | 446 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action)); |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | /** |
| 450 | - * Print error message. |
|
| 451 | - * |
|
| 452 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 453 | - */ |
|
| 450 | + * Print error message. |
|
| 451 | + * |
|
| 452 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 453 | + */ |
|
| 454 | 454 | protected function error() |
| 455 | 455 | { |
| 456 | 456 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action), E_USER_WARNING); |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | /** |
| 460 | - * Log action |
|
| 461 | - * |
|
| 462 | - * @param string $action Performed action in uppercase |
|
| 463 | - * @param string $ad_name Advertisement name |
|
| 464 | - * @return void |
|
| 465 | - */ |
|
| 460 | + * Log action |
|
| 461 | + * |
|
| 462 | + * @param string $action Performed action in uppercase |
|
| 463 | + * @param string $ad_name Advertisement name |
|
| 464 | + * @return void |
|
| 465 | + */ |
|
| 466 | 466 | protected function log($action, $ad_name) |
| 467 | 467 | { |
| 468 | 468 | $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'ACP_ADMANAGEMENT_' . $action . '_LOG', time(), array($ad_name)); |
@@ -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( |