@@ -13,24 +13,24 @@ |
||
| 13 | 13 | class above_footer extends base |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * {@inheritDoc} |
|
| 17 | - */ |
|
| 16 | + * {@inheritDoc} |
|
| 17 | + */ |
|
| 18 | 18 | public function get_id() |
| 19 | 19 | { |
| 20 | 20 | return 'above_footer'; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * {@inheritDoc} |
|
| 25 | - */ |
|
| 24 | + * {@inheritDoc} |
|
| 25 | + */ |
|
| 26 | 26 | public function get_name() |
| 27 | 27 | { |
| 28 | 28 | return $this->user->lang('AD_ABOVE_FOOTER'); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * {@inheritDoc} |
|
| 33 | - */ |
|
| 32 | + * {@inheritDoc} |
|
| 33 | + */ |
|
| 34 | 34 | public function get_desc() |
| 35 | 35 | { |
| 36 | 36 | return $this->user->lang('AD_ABOVE_FOOTER_DESC'); |
@@ -13,24 +13,24 @@ |
||
| 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'; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * {@inheritDoc} |
|
| 25 | - */ |
|
| 24 | + * {@inheritDoc} |
|
| 25 | + */ |
|
| 26 | 26 | public function get_name() |
| 27 | 27 | { |
| 28 | 28 | return $this->user->lang('AD_BELOW_FOOTER'); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * {@inheritDoc} |
|
| 33 | - */ |
|
| 32 | + * {@inheritDoc} |
|
| 33 | + */ |
|
| 34 | 34 | public function get_desc() |
| 35 | 35 | { |
| 36 | 36 | return $this->user->lang('AD_BELOW_FOOTER_DESC'); |
@@ -13,24 +13,24 @@ |
||
| 13 | 13 | class above_header extends base |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * {@inheritDoc} |
|
| 17 | - */ |
|
| 16 | + * {@inheritDoc} |
|
| 17 | + */ |
|
| 18 | 18 | public function get_id() |
| 19 | 19 | { |
| 20 | 20 | return 'above_header'; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * {@inheritDoc} |
|
| 25 | - */ |
|
| 24 | + * {@inheritDoc} |
|
| 25 | + */ |
|
| 26 | 26 | public function get_name() |
| 27 | 27 | { |
| 28 | 28 | return $this->user->lang('AD_ABOVE_HEADER'); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * {@inheritDoc} |
|
| 33 | - */ |
|
| 32 | + * {@inheritDoc} |
|
| 33 | + */ |
|
| 34 | 34 | public function get_desc() |
| 35 | 35 | { |
| 36 | 36 | return $this->user->lang('AD_ABOVE_HEADER_DESC'); |
@@ -13,32 +13,32 @@ |
||
| 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 get_name() |
| 27 | 27 | { |
| 28 | 28 | return $this->user->lang('AD_AFTER_PROFILE'); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * {@inheritDoc} |
|
| 33 | - */ |
|
| 32 | + * {@inheritDoc} |
|
| 33 | + */ |
|
| 34 | 34 | public function get_desc() |
| 35 | 35 | { |
| 36 | 36 | return $this->user->lang('AD_AFTER_PROFILE_DESC'); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * {@inheritDoc} |
|
| 41 | - */ |
|
| 40 | + * {@inheritDoc} |
|
| 41 | + */ |
|
| 42 | 42 | public function will_display() |
| 43 | 43 | { |
| 44 | 44 | return strpos($this->user->page['page_name'], 'memberlist') !== false && strpos($this->user->page['query_string'], 'viewprofile') !== false; |
@@ -13,32 +13,32 @@ |
||
| 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 get_name() |
| 27 | 27 | { |
| 28 | 28 | return $this->user->lang('AD_BEFORE_PROFILE'); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * {@inheritDoc} |
|
| 33 | - */ |
|
| 32 | + * {@inheritDoc} |
|
| 33 | + */ |
|
| 34 | 34 | public function get_desc() |
| 35 | 35 | { |
| 36 | 36 | return $this->user->lang('AD_BEFORE_PROFILE_DESC'); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * {@inheritDoc} |
|
| 41 | - */ |
|
| 40 | + * {@inheritDoc} |
|
| 41 | + */ |
|
| 42 | 42 | public function will_display() |
| 43 | 43 | { |
| 44 | 44 | return strpos($this->user->page['page_name'], 'memberlist') !== false && strpos($this->user->page['query_string'], 'viewprofile') !== false; |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | protected $location_manager; |
| 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\template\template $template Template object |
|
| 50 | - * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
| 51 | - * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
| 52 | - */ |
|
| 46 | + * Constructor |
|
| 47 | + * |
|
| 48 | + * @param \phpbb\request\request $request Request object |
|
| 49 | + * @param \phpbb\template\template $template Template object |
|
| 50 | + * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
| 51 | + * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
| 52 | + */ |
|
| 53 | 53 | public function __construct(\phpbb\request\request $request, \phpbb\template\template $template, \phpbb\admanagement\ad\manager $manager, \phpbb\admanagement\location\manager $location_manager) |
| 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\template\template $template Template object |
|
| 51 | - * @param \phpbb\user $user User object |
|
| 52 | - * @param \phpbb\request\request $request Request object |
|
| 53 | - * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
| 54 | - * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
| 55 | - * @param string $php_ext PHP extension |
|
| 56 | - * @param string $ext_path Path to this extension |
|
| 57 | - */ |
|
| 48 | + * Constructor |
|
| 49 | + * |
|
| 50 | + * @param \phpbb\template\template $template Template object |
|
| 51 | + * @param \phpbb\user $user User object |
|
| 52 | + * @param \phpbb\request\request $request Request object |
|
| 53 | + * @param \phpbb\admanagement\ad\manager $manager Advertisement manager object |
|
| 54 | + * @param \phpbb\admanagement\location\manager $location_manager Template location manager object |
|
| 55 | + * @param string $php_ext PHP extension |
|
| 56 | + * @param string $ext_path Path to this extension |
|
| 57 | + */ |
|
| 58 | 58 | 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, $php_ext, $ext_path) |
| 59 | 59 | { |
| 60 | 60 | $this->template = $template; |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | - * Process user request |
|
| 71 | - * |
|
| 72 | - * @return void |
|
| 73 | - */ |
|
| 70 | + * Process user request |
|
| 71 | + * |
|
| 72 | + * @return void |
|
| 73 | + */ |
|
| 74 | 74 | public function main() |
| 75 | 75 | { |
| 76 | 76 | $this->user->add_lang_ext('phpbb/admanagement', 'acp'); |
@@ -87,31 +87,31 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | - * Set page url |
|
| 91 | - * |
|
| 92 | - * @param string $u_action Custom form action |
|
| 93 | - * @return void |
|
| 94 | - */ |
|
| 90 | + * Set page url |
|
| 91 | + * |
|
| 92 | + * @param string $u_action Custom form action |
|
| 93 | + * @return void |
|
| 94 | + */ |
|
| 95 | 95 | public function set_page_url($u_action) |
| 96 | 96 | { |
| 97 | 97 | $this->u_action = $u_action; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | - * Get ACP page title for Ads module |
|
| 102 | - * |
|
| 103 | - * @return string Language string for Ads ACP module |
|
| 104 | - */ |
|
| 101 | + * Get ACP page title for Ads module |
|
| 102 | + * |
|
| 103 | + * @return string Language string for Ads ACP module |
|
| 104 | + */ |
|
| 105 | 105 | public function get_page_title() |
| 106 | 106 | { |
| 107 | 107 | return $this->user->lang('ACP_ADMANAGEMENT_TITLE'); |
| 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'); |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
| 145 | - * Edit an advertisement |
|
| 146 | - * |
|
| 147 | - * @return void |
|
| 148 | - */ |
|
| 145 | + * Edit an advertisement |
|
| 146 | + * |
|
| 147 | + * @return void |
|
| 148 | + */ |
|
| 149 | 149 | public function action_edit() |
| 150 | 150 | { |
| 151 | 151 | $ad_id = $this->request->variable('id', 0); |
@@ -196,30 +196,30 @@ discard block |
||
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | - * Enable an advertisement |
|
| 200 | - * |
|
| 201 | - * @return void |
|
| 202 | - */ |
|
| 199 | + * Enable an advertisement |
|
| 200 | + * |
|
| 201 | + * @return void |
|
| 202 | + */ |
|
| 203 | 203 | public function action_enable() |
| 204 | 204 | { |
| 205 | 205 | $this->ad_enable(true); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /** |
| 209 | - * Disable an advertisement |
|
| 210 | - * |
|
| 211 | - * @return void |
|
| 212 | - */ |
|
| 209 | + * Disable an advertisement |
|
| 210 | + * |
|
| 211 | + * @return void |
|
| 212 | + */ |
|
| 213 | 213 | public function action_disable() |
| 214 | 214 | { |
| 215 | 215 | $this->ad_enable(false); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
| 219 | - * Delete an advertisement |
|
| 220 | - * |
|
| 221 | - * @return void |
|
| 222 | - */ |
|
| 219 | + * Delete an advertisement |
|
| 220 | + * |
|
| 221 | + * @return void |
|
| 222 | + */ |
|
| 223 | 223 | public function action_delete() |
| 224 | 224 | { |
| 225 | 225 | $ad_id = $this->request->variable('id', 0); |
@@ -253,10 +253,10 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | /** |
| 256 | - * Display the ads |
|
| 257 | - * |
|
| 258 | - * @return void |
|
| 259 | - */ |
|
| 256 | + * Display the ads |
|
| 257 | + * |
|
| 258 | + * @return void |
|
| 259 | + */ |
|
| 260 | 260 | public function list_ads() |
| 261 | 261 | { |
| 262 | 262 | foreach ($this->manager->get_all_ads() as $row) |
@@ -281,11 +281,11 @@ discard block |
||
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | /** |
| 284 | - * Enable/disable an advertisement |
|
| 285 | - * |
|
| 286 | - * @param bool $enable Enable or disable the advertisement? |
|
| 287 | - * @return void |
|
| 288 | - */ |
|
| 284 | + * Enable/disable an advertisement |
|
| 285 | + * |
|
| 286 | + * @param bool $enable Enable or disable the advertisement? |
|
| 287 | + * @return void |
|
| 288 | + */ |
|
| 289 | 289 | protected function ad_enable($enable) |
| 290 | 290 | { |
| 291 | 291 | $ad_id = $this->request->variable('id', 0); |
@@ -316,10 +316,10 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | /** |
| 319 | - * Get admin form data. |
|
| 320 | - * |
|
| 321 | - * @return array Form data |
|
| 322 | - */ |
|
| 319 | + * Get admin form data. |
|
| 320 | + * |
|
| 321 | + * @return array Form data |
|
| 322 | + */ |
|
| 323 | 323 | protected function get_form_data() |
| 324 | 324 | { |
| 325 | 325 | return array( |
@@ -332,12 +332,12 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | /** |
| 335 | - * Validate form data. |
|
| 336 | - * |
|
| 337 | - * @param array $data The form data. |
|
| 338 | - * @param string $form_name The form name. |
|
| 339 | - * @return void |
|
| 340 | - */ |
|
| 335 | + * Validate form data. |
|
| 336 | + * |
|
| 337 | + * @param array $data The form data. |
|
| 338 | + * @param string $form_name The form name. |
|
| 339 | + * @return void |
|
| 340 | + */ |
|
| 341 | 341 | protected function validate($data, $form_name) |
| 342 | 342 | { |
| 343 | 343 | if (!check_form_key($form_name)) |
@@ -356,11 +356,11 @@ discard block |
||
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /** |
| 359 | - * Assign form data to the template. |
|
| 360 | - * |
|
| 361 | - * @param array $data The form data. |
|
| 362 | - * @return void |
|
| 363 | - */ |
|
| 359 | + * Assign form data to the template. |
|
| 360 | + * |
|
| 361 | + * @param array $data The form data. |
|
| 362 | + * @return void |
|
| 363 | + */ |
|
| 364 | 364 | protected function assign_form_data($data) |
| 365 | 365 | { |
| 366 | 366 | $this->template->assign_vars(array( |
@@ -375,11 +375,11 @@ discard block |
||
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | /** |
| 378 | - * Assign template locations data to the template. |
|
| 379 | - * |
|
| 380 | - * @param mixed $data The form data or nothing. |
|
| 381 | - * @return void |
|
| 382 | - */ |
|
| 378 | + * Assign template locations data to the template. |
|
| 379 | + * |
|
| 380 | + * @param mixed $data The form data or nothing. |
|
| 381 | + * @return void |
|
| 382 | + */ |
|
| 383 | 383 | protected function assign_locations($data = false) |
| 384 | 384 | { |
| 385 | 385 | foreach ($this->location_manager->get_all_locations() as $location_id => $location_data) |
@@ -394,20 +394,20 @@ discard block |
||
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | /** |
| 397 | - * Print success message. |
|
| 398 | - * |
|
| 399 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 400 | - */ |
|
| 397 | + * Print success message. |
|
| 398 | + * |
|
| 399 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 400 | + */ |
|
| 401 | 401 | protected function success() |
| 402 | 402 | { |
| 403 | 403 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action)); |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | /** |
| 407 | - * Print error message. |
|
| 408 | - * |
|
| 409 | - * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 410 | - */ |
|
| 407 | + * Print error message. |
|
| 408 | + * |
|
| 409 | + * It takes arguments in the form of a language key, followed by language substitution values. |
|
| 410 | + */ |
|
| 411 | 411 | protected function error() |
| 412 | 412 | { |
| 413 | 413 | trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action), E_USER_WARNING); |