Completed
Pull Request — master (#31)
by Jakub
08:38
created
controller/admin_controller.php 1 patch
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -52,18 +52,18 @@  discard block
 block discarded – undo
52 52
 	protected $errors = array();
53 53
 
54 54
 	/**
55
-	* Constructor
56
-	*
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\ads\ad\manager			$manager			Advertisement manager object
61
-	* @param \phpbb\ads\location\manager	$location_manager	Template location manager object
62
-	* @param \phpbb\log\log							$log				The phpBB log system
63
-	* @param \phpbb\config\db_text					$config_text		Config text object
64
-	* @param string									$php_ext			PHP extension
65
-	* @param string									$ext_path			Path to this extension
66
-	*/
55
+	 * Constructor
56
+	 *
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\ads\ad\manager			$manager			Advertisement manager object
61
+	 * @param \phpbb\ads\location\manager	$location_manager	Template location manager object
62
+	 * @param \phpbb\log\log							$log				The phpBB log system
63
+	 * @param \phpbb\config\db_text					$config_text		Config text object
64
+	 * @param string									$php_ext			PHP extension
65
+	 * @param string									$ext_path			Path to this extension
66
+	 */
67 67
 	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, $php_ext, $ext_path)
68 68
 	{
69 69
 		$this->template = $template;
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 	}
79 79
 
80 80
 	/**
81
-	* Process user request for manage mode
82
-	*
83
-	* @return void
84
-	*/
81
+	 * Process user request for manage mode
82
+	 *
83
+	 * @return void
84
+	 */
85 85
 	public function mode_manage()
86 86
 	{
87 87
 		$this->setup();
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
 	}
99 99
 
100 100
 	/**
101
-	* Process user request for settings mode
102
-	*
103
-	* @return void
104
-	*/
101
+	 * Process user request for settings mode
102
+	 *
103
+	 * @return void
104
+	 */
105 105
 	public function mode_settings()
106 106
 	{
107 107
 		$this->setup();
@@ -143,31 +143,31 @@  discard block
 block discarded – undo
143 143
 	}
144 144
 
145 145
 	/**
146
-	* Set page url
147
-	*
148
-	* @param string $u_action Custom form action
149
-	* @return void
150
-	*/
146
+	 * Set page url
147
+	 *
148
+	 * @param string $u_action Custom form action
149
+	 * @return void
150
+	 */
151 151
 	public function set_page_url($u_action)
152 152
 	{
153 153
 		$this->u_action = $u_action;
154 154
 	}
155 155
 
156 156
 	/**
157
-	* Get ACP page title for Ads module
158
-	*
159
-	* @return string	Language string for Ads ACP module
160
-	*/
157
+	 * Get ACP page title for Ads module
158
+	 *
159
+	 * @return string	Language string for Ads ACP module
160
+	 */
161 161
 	public function get_page_title()
162 162
 	{
163 163
 		return $this->user->lang('ACP_PHPBB_ADS_TITLE');
164 164
 	}
165 165
 
166 166
 	/**
167
-	* Add an advertisement
168
-	*
169
-	* @return void
170
-	*/
167
+	 * Add an advertisement
168
+	 *
169
+	 * @return void
170
+	 */
171 171
 	public function action_add()
172 172
 	{
173 173
 		$preview = $this->request->is_set_post('preview');
@@ -209,10 +209,10 @@  discard block
 block discarded – undo
209 209
 	}
210 210
 
211 211
 	/**
212
-	* Edit an advertisement
213
-	*
214
-	* @return void
215
-	*/
212
+	 * Edit an advertisement
213
+	 *
214
+	 * @return void
215
+	 */
216 216
 	public function action_edit()
217 217
 	{
218 218
 		$ad_id = $this->request->variable('id', 0);
@@ -270,30 +270,30 @@  discard block
 block discarded – undo
270 270
 	}
271 271
 
272 272
 	/**
273
-	* Enable an advertisement
274
-	*
275
-	* @return void
276
-	*/
273
+	 * Enable an advertisement
274
+	 *
275
+	 * @return void
276
+	 */
277 277
 	public function action_enable()
278 278
 	{
279 279
 		$this->ad_enable(true);
280 280
 	}
281 281
 
282 282
 	/**
283
-	* Disable an advertisement
284
-	*
285
-	* @return void
286
-	*/
283
+	 * Disable an advertisement
284
+	 *
285
+	 * @return void
286
+	 */
287 287
 	public function action_disable()
288 288
 	{
289 289
 		$this->ad_enable(false);
290 290
 	}
291 291
 
292 292
 	/**
293
-	* Delete an advertisement
294
-	*
295
-	* @return void
296
-	*/
293
+	 * Delete an advertisement
294
+	 *
295
+	 * @return void
296
+	 */
297 297
 	public function action_delete()
298 298
 	{
299 299
 		$ad_id = $this->request->variable('id', 0);
@@ -336,10 +336,10 @@  discard block
 block discarded – undo
336 336
 	}
337 337
 
338 338
 	/**
339
-	* Display the ads
340
-	*
341
-	* @return void
342
-	*/
339
+	 * Display the ads
340
+	 *
341
+	 * @return void
342
+	 */
343 343
 	public function list_ads()
344 344
 	{
345 345
 		foreach ($this->manager->get_all_ads() as $row)
@@ -369,10 +369,10 @@  discard block
 block discarded – undo
369 369
 	}
370 370
 
371 371
 	/**
372
-	* Perform general tasks
373
-	*
374
-	* @return void
375
-	*/
372
+	 * Perform general tasks
373
+	 *
374
+	 * @return void
375
+	 */
376 376
 	protected function setup()
377 377
 	{
378 378
 		$this->user->add_lang_ext('phpbb/ads', 'acp');
@@ -384,11 +384,11 @@  discard block
 block discarded – undo
384 384
 	}
385 385
 
386 386
 	/**
387
-	* Enable/disable an advertisement
388
-	*
389
-	* @param	bool	$enable	Enable or disable the advertisement?
390
-	* @return void
391
-	*/
387
+	 * Enable/disable an advertisement
388
+	 *
389
+	 * @param	bool	$enable	Enable or disable the advertisement?
390
+	 * @return void
391
+	 */
392 392
 	protected function ad_enable($enable)
393 393
 	{
394 394
 		$ad_id = $this->request->variable('id', 0);
@@ -419,11 +419,11 @@  discard block
 block discarded – undo
419 419
 	}
420 420
 
421 421
 	/**
422
-	* Get admin form data.
423
-	*
424
-	* @param	string	$form_name	The form name.
425
-	* @return	array	Form data
426
-	*/
422
+	 * Get admin form data.
423
+	 *
424
+	 * @param	string	$form_name	The form name.
425
+	 * @return	array	Form data
426
+	 */
427 427
 	protected function get_form_data($form_name)
428 428
 	{
429 429
 		$data = array(
@@ -474,11 +474,11 @@  discard block
 block discarded – undo
474 474
 	}
475 475
 
476 476
 	/**
477
-	* Assign form data to the template.
478
-	*
479
-	* @param	array	$data	The form data.
480
-	* @return void
481
-	*/
477
+	 * Assign form data to the template.
478
+	 *
479
+	 * @param	array	$data	The form data.
480
+	 * @return void
481
+	 */
482 482
 	protected function assign_form_data($data)
483 483
 	{
484 484
 		$this->template->assign_vars(array(
@@ -494,11 +494,11 @@  discard block
 block discarded – undo
494 494
 	}
495 495
 
496 496
 	/**
497
-	* Prepare end date for display
498
-	*
499
-	* @param	mixed	$end_date	End date.
500
-	* @return	string	End date prepared for display.
501
-	*/
497
+	 * Prepare end date for display
498
+	 *
499
+	 * @param	mixed	$end_date	End date.
500
+	 * @return	string	End date prepared for display.
501
+	 */
502 502
 	protected function prepare_end_date($end_date)
503 503
 	{
504 504
 		if (empty($end_date))
@@ -515,11 +515,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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_PHPBB_ADS_' . $action . '_LOG', time(), array($ad_name));
Please login to merge, or discard this patch.
event/main_listener.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
 	protected $location_manager;
37 37
 
38 38
 	/**
39
-	* {@inheritdoc}
40
-	*/
39
+	 * {@inheritdoc}
40
+	 */
41 41
 	static public function getSubscribedEvents()
42 42
 	{
43 43
 		return array(
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
 	}
48 48
 
49 49
 	/**
50
-	* Constructor
51
-	*
52
-	* @param \phpbb\template\template				$template			Template object
53
-	* @param \phpbb\user							$user				User object
54
-	* @param \phpbb\config\db_text					$config_text		Config text object
55
-	* @param \phpbb\ads\ad\manager			$manager			Advertisement manager object
56
-	* @param \phpbb\ads\location\manager	$location_manager	Template location manager object
57
-	*/
50
+	 * Constructor
51
+	 *
52
+	 * @param \phpbb\template\template				$template			Template object
53
+	 * @param \phpbb\user							$user				User object
54
+	 * @param \phpbb\config\db_text					$config_text		Config text object
55
+	 * @param \phpbb\ads\ad\manager			$manager			Advertisement manager object
56
+	 * @param \phpbb\ads\location\manager	$location_manager	Template location manager object
57
+	 */
58 58
 	public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\db_text $config_text, \phpbb\ads\ad\manager $manager, \phpbb\ads\location\manager $location_manager)
59 59
 	{
60 60
 		$this->template = $template;
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 	}
66 66
 
67 67
 	/**
68
-	* Load common language file during user setup
69
-	*
70
-	* @param	\phpbb\event\data	$event	The event object
71
-	* @return	void
72
-	*/
68
+	 * Load common language file during user setup
69
+	 *
70
+	 * @param	\phpbb\event\data	$event	The event object
71
+	 * @return	void
72
+	 */
73 73
 	public function load_language_on_setup($event)
74 74
 	{
75 75
 		$lang_set_ext = $event['lang_set_ext'];
Please login to merge, or discard this patch.