Completed
Push — master ( 46e7ff...dc819d )
by Erwan
02:48
created
controller/links.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -86,19 +86,19 @@  discard block
 block discarded – undo
86 86
 	*/
87 87
 	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, \ernadoo\phpbbdirectory\core\helper $dir_helper, $root_path, $php_ext)
88 88
 	{
89
-		$this->db				= $db;
89
+		$this->db = $db;
90 90
 		$this->config			= $config;
91
-		$this->template			= $template;
91
+		$this->template = $template;
92 92
 		$this->user				= $user;
93 93
 		$this->helper			= $helper;
94
-		$this->request			= $request;
94
+		$this->request = $request;
95 95
 		$this->auth				= $auth;
96
-		$this->captcha_factory 	= $captcha_factory;
96
+		$this->captcha_factory = $captcha_factory;
97 97
 		$this->categorie		= $categorie;
98 98
 		$this->link				= $link;
99
-		$this->dir_helper		= $dir_helper;
99
+		$this->dir_helper = $dir_helper;
100 100
 		$this->root_path		= $root_path;
101
-		$this->php_ext			= $php_ext;
101
+		$this->php_ext = $php_ext;
102 102
 
103 103
 		$this->user->add_lang_ext('ernadoo/phpbbdirectory', 'directory');
104 104
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		$cat_id		= $this->request->variable('id', $cat_id);
184 184
 		$submit		= $this->request->is_set_post('submit') ? true : false;
185 185
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
186
-		$title		= $this->user->lang['DIR_EDIT_SITE'];
186
+		$title = $this->user->lang['DIR_EDIT_SITE'];
187 187
 
188 188
 		$this->template->assign_block_vars('dir_navlinks', array(
189 189
 			'FORUM_NAME'	=> $title,
@@ -219,15 +219,15 @@  discard block
 block discarded – undo
219 219
 				'old_banner'	=> $site['link_banner'],
220 220
 			);
221 221
 
222
-			$site_description		= generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']);
223
-			$site['link_banner'] 	= (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : '';
222
+			$site_description = generate_text_for_edit($site['link_description'], $site['link_uid'], $site['link_flags']);
223
+			$site['link_banner'] = (preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $site['link_banner'])) ? $site['link_banner'] : '';
224 224
 
225
-			$this->url			= $site['link_url'];
226
-			$this->site_name	= $site['link_name'];
225
+			$this->url = $site['link_url'];
226
+			$this->site_name = $site['link_name'];
227 227
 			$this->description	= $site_description['text'];
228 228
 			$this->guest_email	= $site['link_guest_email'];
229
-			$this->rss			= $site['link_rss'];
230
-			$this->banner 		= $site['link_banner'];
229
+			$this->rss = $site['link_rss'];
230
+			$this->banner = $site['link_banner'];
231 231
 			$this->back			= $site['link_back'];
232 232
 			$this->flag 		= $site['link_flag'];
233 233
 		}
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 		$cat_id		= $this->request->variable('id', $cat_id);
255 255
 		$submit		= $this->request->is_set_post('submit') ? true : false;
256 256
 		$refresh	= $this->request->is_set_post('refresh_vc') ? true : false;
257
-		$title		= $this->user->lang['DIR_NEW_SITE'];
257
+		$title = $this->user->lang['DIR_NEW_SITE'];
258 258
 
259 259
 		$this->template->assign_block_vars('dir_navlinks', array(
260 260
 			'FORUM_NAME'	=> $title,
@@ -357,12 +357,12 @@  discard block
 block discarded – undo
357 357
 			return $this->helper->message('FORM_INVALID');
358 358
 		}
359 359
 
360
-		$this->url			= $this->request->variable('url', '');
361
-		$this->site_name	= $this->request->variable('site_name', '', true);
360
+		$this->url = $this->request->variable('url', '');
361
+		$this->site_name = $this->request->variable('site_name', '', true);
362 362
 		$this->description	= $this->request->variable('description', '', true);
363 363
 		$this->guest_email	= $this->request->variable('guest_email', '');
364
-		$this->rss			= $this->request->variable('rss', '');
365
-		$this->banner 		= $this->request->variable('banner', '');
364
+		$this->rss = $this->request->variable('rss', '');
365
+		$this->banner = $this->request->variable('banner', '');
366 366
 		$this->back			= $this->request->variable('back', '');
367 367
 		$this->flag 		= $this->request->variable('flag', '');
368 368
 
@@ -391,17 +391,17 @@  discard block
 block discarded – undo
391 391
 			'site_name' =>			array(
392 392
 				array('string', false, 1, 100)),
393 393
 			'website'		=>		array(
394
-				array('string',	false, 12, 255),
395
-				array('match',	true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
394
+				array('string', false, 12, 255),
395
+				array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
396 396
 			'description'	=>		array(
397 397
 				array('string', !$this->categorie->data['cat_must_describe'], 1, $this->config['dir_length_describe'])),
398 398
 			'rss'			=>		array(
399 399
 				array('string', true, 12, 255),
400
-				array('match',	empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
400
+				array('match', empty($this->rss), '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
401 401
 			'banner'		=>		array(
402 402
 				array('string', true, 5, 255)),
403 403
 			'back'			=>		array(
404
-				array('string',	!$this->categorie->data['cat_link_back'], 12, 255),
404
+				array('string', !$this->categorie->data['cat_link_back'], 12, 255),
405 405
 				array(array($this->link, 'link_back'), true)),
406 406
 			'cat'			=>		array(
407 407
 				array('num', '', 1))
@@ -450,8 +450,8 @@  discard block
 block discarded – undo
450 450
 		// Still no errors?? So let's go!
451 451
 		if (!$error)
452 452
 		{
453
-			$this->banner	= (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
454
-			$this->url		= $this->link->clean_url($this->url);
453
+			$this->banner = (!$this->banner && !$this->request->is_set_post('delete_banner')) ? $this->request->variable('old_banner', '') : $this->banner;
454
+			$this->url = $this->link->clean_url($this->url);
455 455
 
456 456
 			$data_edit = array(
457 457
 				'link_user_id'		=> $this->link_user_id,
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 
500 500
 			$meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id));
501 501
 			meta_refresh(3, $meta_info);
502
-			$message	= ($need_approval) ? $this->user->lang['DIR_'.strtoupper($mode).'_SITE_ACTIVE'] : $this->user->lang['DIR_'.strtoupper($mode).'_SITE_OK'];
502
+			$message	= ($need_approval) ? $this->user->lang['DIR_' . strtoupper($mode) . '_SITE_ACTIVE'] : $this->user->lang['DIR_' . strtoupper($mode) . '_SITE_OK'];
503 503
 			$message	= $message . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->user->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>');
504 504
 			return $this->helper->message($message);
505 505
 		}
@@ -589,20 +589,20 @@  discard block
 block discarded – undo
589 589
 		add_form_key('dir_form');
590 590
 
591 591
 		$ext_path = $phpbb_extension_manager->get_extension_path('ernadoo/phpbbdirectory', false);
592
-		$flag_path = $ext_path.'images/flags/';
592
+		$flag_path = $ext_path . 'images/flags/';
593 593
 
594 594
 		$s_guest	= (!$this->user->data['is_registered'] || !empty($this->guest_email));
595
-		$s_rss		= $this->config['dir_activ_rss'];
596
-		$s_banner	= $this->config['dir_activ_banner'];
595
+		$s_rss = $this->config['dir_activ_rss'];
596
+		$s_banner = $this->config['dir_activ_banner'];
597 597
 		$s_back		= $this->categorie->data['cat_link_back'];
598 598
 		$s_flag		= $this->config['dir_activ_flag'];
599 599
 
600 600
 		$this->template->assign_vars(array(
601
-			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) 	? $this->user->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'),
602
-			'IMG_STATUS'			=> ($this->config['allow_bbcode'])	? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'],
601
+			'BBCODE_STATUS'			=> ($this->config['allow_bbcode']) ? $this->user->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path . "faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->user->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path . "faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'),
602
+			'IMG_STATUS'			=> ($this->config['allow_bbcode']) ? $this->user->lang['IMAGES_ARE_ON'] : $this->user->lang['IMAGES_ARE_OFF'],
603 603
 			'SMILIES_STATUS'		=> ($this->config['allow_smilies']) ? $this->user->lang['SMILIES_ARE_ON'] : $this->user->lang['SMILIES_ARE_OFF'],
604 604
 			'URL_STATUS'			=> ($this->config['allow_post_links']) ? $this->user->lang['URL_IS_ON'] : $this->user->lang['URL_IS_OFF'],
605
-			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash'])	? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'],
605
+			'FLASH_STATUS'			=> ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->user->lang['FLASH_IS_ON'] : $this->user->lang['FLASH_IS_OFF'],
606 606
 
607 607
 			'L_TITLE'				=> $title,
608 608
 			'L_DIR_DESCRIPTION_EXP'	=> $this->user->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']),
Please login to merge, or discard this patch.