Completed
Pull Request — master (#4)
by Jakub
14:22
created
location/type/above_header.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,6 @@
 block discarded – undo
21 21
 	/**
22 22
 	* Construct an above_header template location object
23 23
 	*
24
-	* @param	\phpbb\user	$config	User object
25 24
 	*/
26 25
 	public function __construct(\phpbb\user $user)
27 26
 	{
Please login to merge, or discard this patch.
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -13,40 +13,40 @@
 block discarded – undo
13 13
 class above_header extends base
14 14
 {
15 15
 	/**
16
-	* User object
17
-	* @var \phpbb\user
18
-	*/
16
+	 * User object
17
+	 * @var \phpbb\user
18
+	 */
19 19
 	protected $user;
20 20
 
21 21
 	/**
22
-	* Construct an above_header template location object
23
-	*
24
-	* @param	\phpbb\user	$config	User object
25
-	*/
22
+	 * Construct an above_header template location object
23
+	 *
24
+	 * @param	\phpbb\user	$config	User object
25
+	 */
26 26
 	public function __construct(\phpbb\user $user)
27 27
 	{
28 28
 		$this->user = $user;
29 29
 	}
30 30
 
31 31
 	/**
32
-	* {@inheritDoc}
33
-	*/
32
+	 * {@inheritDoc}
33
+	 */
34 34
 	public function get_id()
35 35
 	{
36 36
 		return 'above_header';
37 37
 	}
38 38
 
39 39
 	/**
40
-	* {@inheritDoc}
41
-	*/
40
+	 * {@inheritDoc}
41
+	 */
42 42
 	public function get_name()
43 43
 	{
44 44
 		return $this->user->lang('AD_ABOVE_HEADER');
45 45
 	}
46 46
 
47 47
 	/**
48
-	* {@inheritDoc}
49
-	*/
48
+	 * {@inheritDoc}
49
+	 */
50 50
 	public function get_desc()
51 51
 	{
52 52
 		return $this->user->lang('AD_ABOVE_HEADER_DESC');
Please login to merge, or discard this patch.
location/type/below_header.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,6 @@
 block discarded – undo
21 21
 	/**
22 22
 	* Construct an above_header template location object
23 23
 	*
24
-	* @param	\phpbb\user	$config	User object
25 24
 	*/
26 25
 	public function __construct(\phpbb\user $user)
27 26
 	{
Please login to merge, or discard this patch.
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -13,40 +13,40 @@
 block discarded – undo
13 13
 class below_header extends base
14 14
 {
15 15
 	/**
16
-	* User object
17
-	* @var \phpbb\user
18
-	*/
16
+	 * User object
17
+	 * @var \phpbb\user
18
+	 */
19 19
 	protected $user;
20 20
 
21 21
 	/**
22
-	* Construct an above_header template location object
23
-	*
24
-	* @param	\phpbb\user	$config	User object
25
-	*/
22
+	 * Construct an above_header template location object
23
+	 *
24
+	 * @param	\phpbb\user	$config	User object
25
+	 */
26 26
 	public function __construct(\phpbb\user $user)
27 27
 	{
28 28
 		$this->user = $user;
29 29
 	}
30 30
 
31 31
 	/**
32
-	* {@inheritDoc}
33
-	*/
32
+	 * {@inheritDoc}
33
+	 */
34 34
 	public function get_id()
35 35
 	{
36 36
 		return 'below_header';
37 37
 	}
38 38
 
39 39
 	/**
40
-	* {@inheritDoc}
41
-	*/
40
+	 * {@inheritDoc}
41
+	 */
42 42
 	public function get_name()
43 43
 	{
44 44
 		return $this->user->lang('AD_BELOW_HEADER');
45 45
 	}
46 46
 
47 47
 	/**
48
-	* {@inheritDoc}
49
-	*/
48
+	 * {@inheritDoc}
49
+	 */
50 50
 	public function get_desc()
51 51
 	{
52 52
 		return $this->user->lang('AD_BELOW_HEADER_DESC');
Please login to merge, or discard this patch.
location/type/type_interface.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -16,34 +16,34 @@
 block discarded – undo
16 16
 interface type_interface
17 17
 {
18 18
 	/**
19
-	* Returns the unique ID of the location.
20
-	*
21
-	* @return string	ID of location.
22
-	*/
19
+	 * Returns the unique ID of the location.
20
+	 *
21
+	 * @return string	ID of location.
22
+	 */
23 23
 	public function get_id();
24 24
 
25 25
 	/**
26
-	* Returns the name of the location.
27
-	*
28
-	* @return string	Name of location.
29
-	*/
26
+	 * Returns the name of the location.
27
+	 *
28
+	 * @return string	Name of location.
29
+	 */
30 30
 	public function get_name();
31 31
 
32 32
 	/**
33
-	* Returns the description of the location.
34
-	*
35
-	* @return string	Description of location.
36
-	*/
33
+	 * Returns the description of the location.
34
+	 *
35
+	 * @return string	Description of location.
36
+	 */
37 37
 	public function get_desc();
38 38
 
39 39
 	/**
40
-	* Returns whether or not this location type will be displayed on a current page.
41
-	*
42
-	* Generally, you can always return true, but if you can narrow down the usage
43
-	* without adding extra load to server, this will further enhance the extension's
44
-	* performance.
45
-	*
46
-	* @return bool	True when location type will be displayed on a current page and false if not.
47
-	*/
40
+	 * Returns whether or not this location type will be displayed on a current page.
41
+	 *
42
+	 * Generally, you can always return true, but if you can narrow down the usage
43
+	 * without adding extra load to server, this will further enhance the extension's
44
+	 * performance.
45
+	 *
46
+	 * @return bool	True when location type will be displayed on a current page and false if not.
47
+	 */
48 48
 	public function will_display();
49 49
 }
Please login to merge, or discard this patch.
location/type/base.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 abstract class base implements \phpbb\admanagement\location\type\type_interface
17 17
 {
18 18
 	/**
19
-	* {@inheritDoc}
20
-	*/
19
+	 * {@inheritDoc}
20
+	 */
21 21
 	public function will_display()
22 22
 	{
23 23
 		return true;
Please login to merge, or discard this patch.
location/manager.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -13,30 +13,30 @@  discard block
 block discarded – undo
13 13
 class manager
14 14
 {
15 15
 	/**
16
-	* Array that contains all available template location types which are passed
17
-	* via the service container
18
-	* @var array
19
-	*/
16
+	 * Array that contains all available template location types which are passed
17
+	 * via the service container
18
+	 * @var array
19
+	 */
20 20
 	protected $template_locations;
21 21
 
22 22
 	/**
23
-	* Construct an template locations manager object
24
-	*
25
-	* @param	array	$template_locations	Template location types passed via the service container
26
-	*/
23
+	 * Construct an template locations manager object
24
+	 *
25
+	 * @param	array	$template_locations	Template location types passed via the service container
26
+	 */
27 27
 	public function __construct($template_locations)
28 28
 	{
29 29
 		$this->register_template_locations($template_locations);
30 30
 	}
31 31
 
32 32
 	/**
33
-	* Get a list of all template location types
34
-	*
35
-	* Returns an associated array where key is the location id
36
-	* and value is array of location name and location description.
37
-	*
38
-	* @return	array	Array containing a list of all avatar drivers
39
-	*/
33
+	 * Get a list of all template location types
34
+	 *
35
+	 * Returns an associated array where key is the location id
36
+	 * and value is array of location name and location description.
37
+	 *
38
+	 * @return	array	Array containing a list of all avatar drivers
39
+	 */
40 40
 	public function get_all_locations()
41 41
 	{
42 42
 		$location_types = array();
@@ -53,20 +53,20 @@  discard block
 block discarded – undo
53 53
 	}
54 54
 
55 55
 	/**
56
-	* Get a list of all template location IDs
57
-	*
58
-	* @return	array	Array containing a list of all template location IDs
59
-	*/
56
+	 * Get a list of all template location IDs
57
+	 *
58
+	 * @return	array	Array containing a list of all template location IDs
59
+	 */
60 60
 	public function get_all_location_ids()
61 61
 	{
62 62
 		return array_keys($this->template_locations);
63 63
 	}
64 64
 
65 65
 	/**
66
-	* Register template locations
67
-	*
68
-	* @param	array	$template_locations	Template location types passed via the service container
69
-	*/
66
+	 * Register template locations
67
+	 *
68
+	 * @param	array	$template_locations	Template location types passed via the service container
69
+	 */
70 70
 	protected function register_template_locations($template_locations)
71 71
 	{
72 72
 		if (!empty($template_locations))
Please login to merge, or discard this patch.
migrations/v10x/m3_template_locations_schema.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -13,31 +13,31 @@  discard block
 block discarded – undo
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_location_id
35
-	*		ad_id
36
-	*		location_id
37
-	*
38
-	* @return array Array of table schema
39
-	* @access public
40
-	*/
32
+	 * Add the ad_locations table schema to the database:
33
+	 *	ad_locations:
34
+	 *		ad_location_id
35
+	 *		ad_id
36
+	 *		location_id
37
+	 *
38
+	 * @return array Array of table schema
39
+	 * @access public
40
+	 */
41 41
 	public function update_schema()
42 42
 	{
43 43
 		return array(
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 	}
55 55
 
56 56
 	/**
57
-	* Drop the ad_locations table schema from the database
58
-	*
59
-	* @return array Array of table schema
60
-	* @access public
61
-	*/
57
+	 * Drop the ad_locations table schema from the database
58
+	 *
59
+	 * @return array Array of table schema
60
+	 * @access public
61
+	 */
62 62
 	public function revert_schema()
63 63
 	{
64 64
 		return array(
Please login to merge, or discard this patch.
controller/admin_controller.php 1 patch
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -51,18 +51,18 @@  discard block
 block discarded – undo
51 51
 	protected $errors = array();
52 52
 
53 53
 	/**
54
-	* Constructor
55
-	*
56
-	* @param \phpbb\db\driver\driver_interface		$db					DB driver interface
57
-	* @param \phpbb\template\template				$template			Template object
58
-	* @param \phpbb\user							$user				User object
59
-	* @param \phpbb\request\request					$request			Request object
60
-	* @param \phpbb\admanagement\location\manager	$location_manager	Template location manager object
61
-	* @param string									$ads_table			Ads table
62
-	* @param string									$ad_locations_table	Ad locations table
63
-	* @param string									$php_ext			PHP extension
64
-	* @param string									$ext_path			Path to this extension
65
-	*/
54
+	 * Constructor
55
+	 *
56
+	 * @param \phpbb\db\driver\driver_interface		$db					DB driver interface
57
+	 * @param \phpbb\template\template				$template			Template object
58
+	 * @param \phpbb\user							$user				User object
59
+	 * @param \phpbb\request\request					$request			Request object
60
+	 * @param \phpbb\admanagement\location\manager	$location_manager	Template location manager object
61
+	 * @param string									$ads_table			Ads table
62
+	 * @param string									$ad_locations_table	Ad locations table
63
+	 * @param string									$php_ext			PHP extension
64
+	 * @param string									$ext_path			Path to this extension
65
+	 */
66 66
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user, \phpbb\request\request $request, \phpbb\admanagement\location\manager $location_manager, $ads_table, $ad_locations_table, $php_ext, $ext_path)
67 67
 	{
68 68
 		$this->db = $db;
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
 	}
78 78
 
79 79
 	/**
80
-	* Process user request
81
-	*
82
-	* @return void
83
-	*/
80
+	 * Process user request
81
+	 *
82
+	 * @return void
83
+	 */
84 84
 	public function main()
85 85
 	{
86 86
 		$this->user->add_lang_ext('phpbb/admanagement', 'acp');
@@ -97,31 +97,31 @@  discard block
 block discarded – undo
97 97
 	}
98 98
 
99 99
 	/**
100
-	* Set page url
101
-	*
102
-	* @param string $u_action Custom form action
103
-	* @return void
104
-	*/
100
+	 * Set page url
101
+	 *
102
+	 * @param string $u_action Custom form action
103
+	 * @return void
104
+	 */
105 105
 	public function set_page_url($u_action)
106 106
 	{
107 107
 		$this->u_action = $u_action;
108 108
 	}
109 109
 
110 110
 	/**
111
-	* Get ACP page title for Ads module
112
-	*
113
-	* @return string	Language string for Ads ACP module
114
-	*/
111
+	 * Get ACP page title for Ads module
112
+	 *
113
+	 * @return string	Language string for Ads ACP module
114
+	 */
115 115
 	public function get_page_title()
116 116
 	{
117 117
 		return $this->user->lang('ACP_ADMANAGEMENT_TITLE');
118 118
 	}
119 119
 
120 120
 	/**
121
-	* Add an advertisement
122
-	*
123
-	* @return void
124
-	*/
121
+	 * Add an advertisement
122
+	 *
123
+	 * @return void
124
+	 */
125 125
 	public function action_add()
126 126
 	{
127 127
 		add_form_key('phpbb/admanagement/add');
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
 	}
174 174
 
175 175
 	/**
176
-	* Edit an advertisement
177
-	*
178
-	* @return void
179
-	*/
176
+	 * Edit an advertisement
177
+	 *
178
+	 * @return void
179
+	 */
180 180
 	public function action_edit()
181 181
 	{
182 182
 		$ad_id = $this->request->variable('id', 0);
@@ -265,30 +265,30 @@  discard block
 block discarded – undo
265 265
 	}
266 266
 
267 267
 	/**
268
-	* Enable an advertisement
269
-	*
270
-	* @return void
271
-	*/
268
+	 * Enable an advertisement
269
+	 *
270
+	 * @return void
271
+	 */
272 272
 	public function action_enable()
273 273
 	{
274 274
 		$this->ad_enable(true);
275 275
 	}
276 276
 
277 277
 	/**
278
-	* Disable an advertisement
279
-	*
280
-	* @return void
281
-	*/
278
+	 * Disable an advertisement
279
+	 *
280
+	 * @return void
281
+	 */
282 282
 	public function action_disable()
283 283
 	{
284 284
 		$this->ad_enable(false);
285 285
 	}
286 286
 
287 287
 	/**
288
-	* Delete an advertisement
289
-	*
290
-	* @return void
291
-	*/
288
+	 * Delete an advertisement
289
+	 *
290
+	 * @return void
291
+	 */
292 292
 	public function action_delete()
293 293
 	{
294 294
 		$ad_id = $this->request->variable('id', 0);
@@ -329,10 +329,10 @@  discard block
 block discarded – undo
329 329
 	}
330 330
 
331 331
 	/**
332
-	* Display the ads
333
-	*
334
-	* @return void
335
-	*/
332
+	 * Display the ads
333
+	 *
334
+	 * @return void
335
+	 */
336 336
 	public function list_ads()
337 337
 	{
338 338
 		$sql = 'SELECT ad_id, ad_name, ad_enabled
@@ -361,11 +361,11 @@  discard block
 block discarded – undo
361 361
 	}
362 362
 
363 363
 	/**
364
-	* Enable/disable an advertisement
365
-	*
366
-	* @param	bool	$enable	Enable or disable the advertisement?
367
-	* @return void
368
-	*/
364
+	 * Enable/disable an advertisement
365
+	 *
366
+	 * @param	bool	$enable	Enable or disable the advertisement?
367
+	 * @return void
368
+	 */
369 369
 	protected function ad_enable($enable)
370 370
 	{
371 371
 		$ad_id = $this->request->variable('id', 0);
@@ -398,11 +398,11 @@  discard block
 block discarded – undo
398 398
 	}
399 399
 
400 400
 	/**
401
-	* Check the form key.
402
-	*
403
-	* @param	string	$form_name	The name of the form.
404
-	* @return void
405
-	*/
401
+	 * Check the form key.
402
+	 *
403
+	 * @param	string	$form_name	The name of the form.
404
+	 * @return void
405
+	 */
406 406
 	protected function check_form_key($form_name)
407 407
 	{
408 408
 		if (!check_form_key($form_name))
@@ -412,10 +412,10 @@  discard block
 block discarded – undo
412 412
 	}
413 413
 
414 414
 	/**
415
-	* Get admin form data.
416
-	*
417
-	* @return	array	Form data
418
-	*/
415
+	 * Get admin form data.
416
+	 *
417
+	 * @return	array	Form data
418
+	 */
419 419
 	protected function get_form_data()
420 420
 	{
421 421
 		return array(
@@ -428,11 +428,11 @@  discard block
 block discarded – undo
428 428
 	}
429 429
 
430 430
 	/**
431
-	* Validate form data.
432
-	*
433
-	* @param	array	$data	The form data.
434
-	* @return void
435
-	*/
431
+	 * Validate form data.
432
+	 *
433
+	 * @param	array	$data	The form data.
434
+	 * @return void
435
+	 */
436 436
 	protected function validate($data)
437 437
 	{
438 438
 		if ($data['ad_name'] === '')
@@ -446,11 +446,11 @@  discard block
 block discarded – undo
446 446
 	}
447 447
 
448 448
 	/**
449
-	* Assign form data to the template.
450
-	*
451
-	* @param	array	$data	The form data.
452
-	* @return void
453
-	*/
449
+	 * Assign form data to the template.
450
+	 *
451
+	 * @param	array	$data	The form data.
452
+	 * @return void
453
+	 */
454 454
 	protected function assign_form_data($data)
455 455
 	{
456 456
 		$this->template->assign_vars(array(
@@ -465,11 +465,11 @@  discard block
 block discarded – undo
465 465
 	}
466 466
 
467 467
 	/**
468
-	* Assign template locations data to the template.
469
-	*
470
-	* @param	mixed	$data	The form data or nothing.
471
-	* @return	void
472
-	*/
468
+	 * Assign template locations data to the template.
469
+	 *
470
+	 * @param	mixed	$data	The form data or nothing.
471
+	 * @return	void
472
+	 */
473 473
 	protected function assign_locations($data = false)
474 474
 	{
475 475
 		foreach ($this->location_manager->get_all_locations() as $location_id => $location_data)
@@ -484,20 +484,20 @@  discard block
 block discarded – undo
484 484
 	}
485 485
 
486 486
 	/**
487
-	* Print success message.
488
-	*
489
-	* It takes arguments in the form of a language key, followed by language substitution values.
490
-	*/
487
+	 * Print success message.
488
+	 *
489
+	 * It takes arguments in the form of a language key, followed by language substitution values.
490
+	 */
491 491
 	protected function success()
492 492
 	{
493 493
 		trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action));
494 494
 	}
495 495
 
496 496
 	/**
497
-	* Print error message.
498
-	*
499
-	* It takes arguments in the form of a language key, followed by language substitution values.
500
-	*/
497
+	 * Print error message.
498
+	 *
499
+	 * It takes arguments in the form of a language key, followed by language substitution values.
500
+	 */
501 501
 	protected function error()
502 502
 	{
503 503
 		trigger_error(call_user_func_array(array($this->user, 'lang'), func_get_args()) . adm_back_link($this->u_action), E_USER_WARNING);
Please login to merge, or discard this patch.
event/main_listener.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 	protected $ad_locations_table;
40 40
 
41 41
 	/**
42
-	* {@inheritdoc}
43
-	*/
42
+	 * {@inheritdoc}
43
+	 */
44 44
 	static public function getSubscribedEvents()
45 45
 	{
46 46
 		return array(
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
 	}
50 50
 
51 51
 	/**
52
-	* Constructor
53
-	*
54
-	* @param \phpbb\request\request					$request			Request object
55
-	* @param \phpbb\db\driver\driver_interface		$db					DB driver interface
56
-	* @param \phpbb\template\template				$template			Template object
57
-	* @param \phpbb\admanagement\location\manager	$location_manager	Template location manager object
58
-	* @param string									$ads_table			Ads table
59
-	* @param string									$ad_locations_table	Ad locations table
60
-	*/
52
+	 * Constructor
53
+	 *
54
+	 * @param \phpbb\request\request					$request			Request object
55
+	 * @param \phpbb\db\driver\driver_interface		$db					DB driver interface
56
+	 * @param \phpbb\template\template				$template			Template object
57
+	 * @param \phpbb\admanagement\location\manager	$location_manager	Template location manager object
58
+	 * @param string									$ads_table			Ads table
59
+	 * @param string									$ad_locations_table	Ad locations table
60
+	 */
61 61
 	public function __construct(\phpbb\request\request $request, \phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\admanagement\location\manager $location_manager, $ads_table, $ad_locations_table)
62 62
 	{
63 63
 		$this->request = $request;
Please login to merge, or discard this patch.