Completed
Push — 3.2.x ( 4efeb0...61fc4e )
by Erwan
11:12
created
controller/acp/cat.php 2 patches
Indentation   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
 	private $update;
70 70
 
71 71
 	/**
72
-	* Constructor
73
-	*
74
-	* @param \phpbb\cache\service								$cache				Cache object
75
-	* @param \phpbb\db\driver\driver_interface 					$db					Database object
76
-	* @param \phpbb\controller\helper							$helper				Helper object
77
-	* @param \phpbb\language\language							$language			Language object
78
-	* @param \phpbb\log\log										$log				Log object
79
-	* @param \phpbb\request\request								$request			Request object
80
-	* @param \phpbb\template\template							$template			Template object
81
-	* @param \phpbb\user										$user				User object
82
-	* @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
83
-	* @param \ernadoo\phpbbdirectory\core\nestedset_category	$nestedset_category	PhpBB Directory extension nestedset object
84
-	*/
72
+	 * Constructor
73
+	 *
74
+	 * @param \phpbb\cache\service								$cache				Cache object
75
+	 * @param \phpbb\db\driver\driver_interface 					$db					Database object
76
+	 * @param \phpbb\controller\helper							$helper				Helper object
77
+	 * @param \phpbb\language\language							$language			Language object
78
+	 * @param \phpbb\log\log										$log				Log object
79
+	 * @param \phpbb\request\request								$request			Request object
80
+	 * @param \phpbb\template\template							$template			Template object
81
+	 * @param \phpbb\user										$user				User object
82
+	 * @param \ernadoo\phpbbdirectory\core\categorie				$categorie			PhpBB Directory extension categorie object
83
+	 * @param \ernadoo\phpbbdirectory\core\nestedset_category	$nestedset_category	PhpBB Directory extension nestedset object
84
+	 */
85 85
 	public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category)
86 86
 	{
87 87
 		$this->cache				= $cache;
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
 	}
106 106
 
107 107
 	/**
108
-	* Initialize defaults data for add page
109
-	*
110
-	* @return null
111
-	*/
108
+	 * Initialize defaults data for add page
109
+	 *
110
+	 * @return null
111
+	 */
112 112
 	public function action_add()
113 113
 	{
114 114
 		$this->cat_id = $this->parent_id;
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
 	}
144 144
 
145 145
 	/**
146
-	* Display deleting page
147
-	*
148
-	* @return null
149
-	*/
146
+	 * Display deleting page
147
+	 *
148
+	 * @return null
149
+	 */
150 150
 	public function action_delete()
151 151
 	{
152 152
 		if (!$this->cat_id)
@@ -197,10 +197,10 @@  discard block
 block discarded – undo
197 197
 	}
198 198
 
199 199
 	/**
200
-	* Initialize data for edit page
201
-	*
202
-	* @return null
203
-	*/
200
+	 * Initialize data for edit page
201
+	 *
202
+	 * @return null
203
+	 */
204 204
 	public function action_edit()
205 205
 	{
206 206
 		$row = $this->_get_cat_info($this->cat_id);
@@ -227,10 +227,10 @@  discard block
 block discarded – undo
227 227
 	}
228 228
 
229 229
 	/**
230
-	* Move order categories
231
-	*
232
-	* @return null
233
-	*/
230
+	 * Move order categories
231
+	 *
232
+	 * @return null
233
+	 */
234 234
 	public function action_move()
235 235
 	{
236 236
 		if (!$this->cat_id)
@@ -273,10 +273,10 @@  discard block
 block discarded – undo
273 273
 	}
274 274
 
275 275
 	/**
276
-	* Display progress bar for syncinc categories
277
-	*
278
-	* @return null
279
-	*/
276
+	 * Display progress bar for syncinc categories
277
+	 *
278
+	 * @return null
279
+	 */
280 280
 	public function action_progress_bar()
281 281
 	{
282 282
 		$start = $this->request->variable('start', 0);
@@ -297,10 +297,10 @@  discard block
 block discarded – undo
297 297
 	}
298 298
 
299 299
 	/**
300
-	* Get link's ID interval for _sync_dir_links()
301
-	*
302
-	* @return null
303
-	*/
300
+	 * Get link's ID interval for _sync_dir_links()
301
+	 *
302
+	 * @return null
303
+	 */
304 304
 	public function action_sync()
305 305
 	{
306 306
 		if (!$this->cat_id)
@@ -382,10 +382,10 @@  discard block
 block discarded – undo
382 382
 	}
383 383
 
384 384
 	/**
385
-	* Sync category data
386
-	*
387
-	* @return null
388
-	*/
385
+	 * Sync category data
386
+	 *
387
+	 * @return null
388
+	 */
389 389
 	public function action_sync_cat()
390 390
 	{
391 391
 		$sql = 'SELECT cat_name
@@ -409,10 +409,10 @@  discard block
 block discarded – undo
409 409
 	}
410 410
 
411 411
 	/**
412
-	* Display categories page
413
-	*
414
-	* @return null
415
-	*/
412
+	 * Display categories page
413
+	 *
414
+	 * @return null
415
+	 */
416 416
 	public function display_cats()
417 417
 	{
418 418
 		// Default management page
@@ -506,22 +506,22 @@  discard block
 block discarded – undo
506 506
 	}
507 507
 
508 508
 	/**
509
-	* Set page url
510
-	*
511
-	* @param	string $u_action Custom form action
512
-	* @return	null
513
-	* @access	public
514
-	*/
509
+	 * Set page url
510
+	 *
511
+	 * @param	string $u_action Custom form action
512
+	 * @return	null
513
+	 * @access	public
514
+	 */
515 515
 	public function set_page_url($u_action)
516 516
 	{
517 517
 		$this->u_action = $u_action;
518 518
 	}
519 519
 
520 520
 	/**
521
-	* Update cat table
522
-	*
523
-	* @return null
524
-	*/
521
+	 * Update cat table
522
+	 *
523
+	 * @return null
524
+	 */
525 525
 	public function update()
526 526
 	{
527 527
 		if (!check_form_key($this->form_key))
@@ -611,13 +611,13 @@  discard block
 block discarded – undo
611 611
 	}
612 612
 
613 613
 	/**
614
-	* Check route
615
-	*
616
-	* @param string $route Route text
617
-	* @return null
618
-	* @access public
619
-	* @throws \phpbb\pages\exception\unexpected_value
620
-	*/
614
+	 * Check route
615
+	 *
616
+	 * @param string $route Route text
617
+	 * @return null
618
+	 * @access public
619
+	 * @throws \phpbb\pages\exception\unexpected_value
620
+	 */
621 621
 	private function _check_route($route)
622 622
 	{
623 623
 		// Route is a required field
@@ -648,11 +648,11 @@  discard block
 block discarded – undo
648 648
 	}
649 649
 
650 650
 	/**
651
-	* Display form
652
-	*
653
-	* @param	string $parents_list	Drop-down list
654
-	* @return	null
655
-	*/
651
+	 * Display form
652
+	 *
653
+	 * @param	string $parents_list	Drop-down list
654
+	 * @return	null
655
+	 */
656 656
 	private function _display_cat_form($parents_list)
657 657
 	{
658 658
 		$dir_cat_desc_data = array(
@@ -724,11 +724,11 @@  discard block
 block discarded – undo
724 724
 	}
725 725
 
726 726
 	/**
727
-	* Get category details
728
-	*
729
-	* @param	int		$cat_id	The category ID
730
-	* @return 	array
731
-	*/
727
+	 * Get category details
728
+	 *
729
+	 * @param	int		$cat_id	The category ID
730
+	 * @return 	array
731
+	 */
732 732
 	private function _get_cat_info($cat_id)
733 733
 	{
734 734
 		$sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, cat_route, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next
@@ -747,10 +747,10 @@  discard block
 block discarded – undo
747 747
 	}
748 748
 
749 749
 	/**
750
-	* Update category data
751
-	*
752
-	* @return array
753
-	*/
750
+	 * Update category data
751
+	 *
752
+	 * @return array
753
+	 */
754 754
 	private function _update_cat_data()
755 755
 	{
756 756
 		if (!$this->cat_data['cat_name'])
@@ -846,14 +846,14 @@  discard block
 block discarded – undo
846 846
 	}
847 847
 
848 848
 	/**
849
-	* Remove complete category
850
-	*
851
-	* @param	string		$action_links	Action for categories links
852
-	* @param	string		$action_subcats	Action for sub-categories
853
-	* @param	int			$links_to_id	New category ID for links
854
-	* @param	int			$subcats_to_id	New category ID for sub-categories
855
-	* @return 	array|null
856
-	*/
849
+	 * Remove complete category
850
+	 *
851
+	 * @param	string		$action_links	Action for categories links
852
+	 * @param	string		$action_subcats	Action for sub-categories
853
+	 * @param	int			$links_to_id	New category ID for links
854
+	 * @param	int			$subcats_to_id	New category ID for sub-categories
855
+	 * @return 	array|null
856
+	 */
857 857
 	private function _delete_cat($action_links = 'delete', $action_subcats = 'delete', $links_to_id = 0, $subcats_to_id = 0)
858 858
 	{
859 859
 		$this->cat_data = $this->_get_cat_info($this->cat_id);
@@ -968,12 +968,12 @@  discard block
 block discarded – undo
968 968
 	}
969 969
 
970 970
 	/**
971
-	* Move category content from one to another forum
972
-	*
973
-	* @param	int	$from_id
974
-	* @param	int	$to_id
975
-	* @return	null
976
-	*/
971
+	 * Move category content from one to another forum
972
+	 *
973
+	 * @param	int	$from_id
974
+	 * @param	int	$to_id
975
+	 * @return	null
976
+	 */
977 977
 	private function _move_cat_content($from_id, $to_id)
978 978
 	{
979 979
 		$sql = 'UPDATE ' . $this->links_table . '
@@ -989,10 +989,10 @@  discard block
 block discarded – undo
989 989
 	}
990 990
 
991 991
 	/**
992
-	* Delete category content
993
-	*
994
-	* @return null
995
-	*/
992
+	 * Delete category content
993
+	 *
994
+	 * @return null
995
+	 */
996 996
 	private function _delete_cat_content()
997 997
 	{
998 998
 		$this->db->sql_transaction('begin');
@@ -1049,11 +1049,11 @@  discard block
 block discarded – undo
1049 1049
 	}
1050 1050
 
1051 1051
 	/**
1052
-	* Update links counter
1053
-	*
1054
-	* @param	int $cat_id	The category ID
1055
-	* @return	null
1056
-	*/
1052
+	 * Update links counter
1053
+	 *
1054
+	 * @param	int $cat_id	The category ID
1055
+	 * @return	null
1056
+	 */
1057 1057
 	private function _sync_dir_cat($cat_id)
1058 1058
 	{
1059 1059
 		$sql = 'SELECT COUNT(link_id) AS num_links
@@ -1071,12 +1071,12 @@  discard block
 block discarded – undo
1071 1071
 	}
1072 1072
 
1073 1073
 	/**
1074
-	* Update link data (note, vote, comment)
1075
-	*
1076
-	* @param	int	$start
1077
-	* @param	int	$stop
1078
-	* @return	null
1079
-	*/
1074
+	 * Update link data (note, vote, comment)
1075
+	 *
1076
+	 * @param	int	$start
1077
+	 * @param	int	$stop
1078
+	 * @return	null
1079
+	 */
1080 1080
 	private function _sync_dir_links($start, $stop)
1081 1081
 	{
1082 1082
 		$sql_ary = array(
@@ -1119,12 +1119,12 @@  discard block
 block discarded – undo
1119 1119
 	}
1120 1120
 
1121 1121
 	/**
1122
-	* Display icons drop-down list
1123
-	*
1124
-	* @param	string	$icons_path
1125
-	* @param	string	$img_selected
1126
-	* @return	string
1127
-	*/
1122
+	 * Display icons drop-down list
1123
+	 *
1124
+	 * @param	string	$icons_path
1125
+	 * @param	string	$img_selected
1126
+	 * @return	string
1127
+	 */
1128 1128
 	private function _get_dir_icon_list($icons_path, $img_selected)
1129 1129
 	{
1130 1130
 		$imglist = filelist($icons_path, '');
Please login to merge, or discard this patch.
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -84,23 +84,23 @@  discard block
 block discarded – undo
84 84
 	*/
85 85
 	public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category)
86 86
 	{
87
-		$this->cache				= $cache;
88
-		$this->db					= $db;
89
-		$this->helper				= $helper;
87
+		$this->cache = $cache;
88
+		$this->db = $db;
89
+		$this->helper = $helper;
90 90
 		$this->language				= $language;
91 91
 		$this->phpbb_log			= $log;
92
-		$this->request				= $request;
92
+		$this->request = $request;
93 93
 		$this->template				= $template;
94
-		$this->user					= $user;
94
+		$this->user = $user;
95 95
 		$this->categorie			= $categorie;
96
-		$this->nestedset_category	= $nestedset_category;
96
+		$this->nestedset_category = $nestedset_category;
97 97
 
98 98
 		$this->form_key = 'acp_dir_cat';
99 99
 		add_form_key($this->form_key);
100 100
 
101 101
 		$this->action		= $this->request->variable('action', '');
102 102
 		$this->cat_id		= $request->variable('c', 0);
103
-		$this->parent_id	= $request->variable('parent_id', 0);
103
+		$this->parent_id = $request->variable('parent_id', 0);
104 104
 		$this->update		= ($this->request->is_set_post('update')) ? true : false;
105 105
 	}
106 106
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	{
152 152
 		if (!$this->cat_id)
153 153
 		{
154
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
154
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING);
155 155
 		}
156 156
 
157 157
 		$this->cat_data = $this->_get_cat_info($this->cat_id);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		$cat_list = $this->categorie->make_cat_select((int) $this->cat_data['parent_id'], $subcats_id);
168 168
 
169 169
 		$sql = 'SELECT cat_id
170
-			FROM ' . $this->categories_table . '
170
+			FROM ' . $this->categories_table.'
171 171
 			WHERE cat_id <> ' . (int) $this->cat_id;
172 172
 		$result = $this->db->sql_query_limit($sql, 1);
173 173
 
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 
184 184
 		$this->template->assign_vars(array(
185 185
 			'S_DELETE_DIR_CAT'		=> true,
186
-			'U_ACTION'				=> $this->u_action . "&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$this->cat_id",
187
-			'U_BACK'				=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
186
+			'U_ACTION'				=> $this->u_action."&amp;parent_id={$parent_id}&amp;action=delete&amp;c=$this->cat_id",
187
+			'U_BACK'				=> $this->u_action.'&amp;parent_id='.$this->parent_id,
188 188
 
189 189
 			'DIR_CAT_NAME'			=> $this->cat_data['cat_name'],
190 190
 			'S_HAS_SUBCATS'			=> ($this->cat_data['right_id'] - $this->cat_data['left_id'] > 1) ? true : false,
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
 	{
236 236
 		if (!$this->cat_id)
237 237
 		{
238
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
238
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
239 239
 		}
240 240
 
241 241
 		$sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
242
-			FROM ' . $this->categories_table . '
242
+			FROM ' . $this->categories_table.'
243 243
 			WHERE cat_id = ' . (int) $this->cat_id;
244 244
 		$result = $this->db->sql_query($sql);
245 245
 		$row = $this->db->sql_fetchrow($result);
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 
248 248
 		if (!$row)
249 249
 		{
250
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
250
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
251 251
 		}
252 252
 
253 253
 		try
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 
262 262
 		if ($move_cat_name !== false)
263 263
 		{
264
-			$this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_' . strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name));
264
+			$this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_'.strtoupper($this->action), time(), array($row['cat_name'], $move_cat_name));
265 265
 			$this->cache->destroy('sql', $this->categories_table);
266 266
 		}
267 267
 
@@ -305,13 +305,13 @@  discard block
 block discarded – undo
305 305
 	{
306 306
 		if (!$this->cat_id)
307 307
 		{
308
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
308
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
309 309
 		}
310 310
 
311 311
 		@set_time_limit(0);
312 312
 
313 313
 		$sql = 'SELECT cat_name, cat_links
314
-			FROM ' . $this->categories_table . '
314
+			FROM ' . $this->categories_table.'
315 315
 			WHERE cat_id = ' . (int) $this->cat_id;
316 316
 		$result = $this->db->sql_query($sql);
317 317
 		$row = $this->db->sql_fetchrow($result);
@@ -319,12 +319,12 @@  discard block
 block discarded – undo
319 319
 
320 320
 		if (!$row)
321 321
 		{
322
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
322
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
323 323
 		}
324 324
 
325 325
 		$sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id
326
-			FROM ' . $this->links_table . '
327
-			WHERE link_cat = ' . (int) $this->cat_id . '
326
+			FROM ' . $this->links_table.'
327
+			WHERE link_cat = ' . (int) $this->cat_id.'
328 328
 				AND link_active = 1';
329 329
 		$result = $this->db->sql_query($sql);
330 330
 		$row2 = $this->db->sql_fetchrow($result);
@@ -346,22 +346,22 @@  discard block
 block discarded – undo
346 346
 		{
347 347
 			// We really need to find a way of showing statistics... no progress here
348 348
 			$sql = 'SELECT COUNT(link_id) as num_links
349
-				FROM ' . $this->links_table . '
350
-				WHERE link_cat = ' . (int) $this->cat_id . '
349
+				FROM ' . $this->links_table.'
350
+				WHERE link_cat = ' . (int) $this->cat_id.'
351 351
 						AND link_active = 1
352
-						AND link_id BETWEEN ' . $start . ' AND ' . $end;
352
+						AND link_id BETWEEN ' . $start.' AND '.$end;
353 353
 			$result = $this->db->sql_query($sql);
354 354
 			$links_done = $this->request->variable('links_done', 0) + (int) $this->db->sql_fetchfield('num_links');
355 355
 			$this->db->sql_freeresult($result);
356 356
 
357 357
 			$start += $batch_size;
358 358
 
359
-			$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync&amp;start=$start&amp;links_done=$links_done&amp;total={$row['cat_links']}";
359
+			$url = $this->u_action."&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync&amp;start=$start&amp;links_done=$links_done&amp;total={$row['cat_links']}";
360 360
 
361 361
 			meta_refresh(0, $url);
362 362
 
363 363
 			$this->template->assign_vars(array(
364
-				'UA_PROGRESS_BAR'		=> $this->u_action . "&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}",
364
+				'UA_PROGRESS_BAR'		=> $this->u_action."&amp;action=progress_bar&amp;start=$links_done&amp;total={$row['cat_links']}",
365 365
 				'S_CONTINUE_SYNC'		=> true,
366 366
 				'L_PROGRESS_EXPLAIN'	=> $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', $links_done, $row['cat_links']))
367 367
 			);
@@ -369,11 +369,11 @@  discard block
 block discarded – undo
369 369
 			return;
370 370
 		}
371 371
 
372
-		$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync_cat";
372
+		$url = $this->u_action."&amp;parent_id={$this->parent_id}&amp;c=$this->cat_id&amp;action=sync_cat";
373 373
 		meta_refresh(0, $url);
374 374
 
375 375
 		$this->template->assign_vars(array(
376
-			'UA_PROGRESS_BAR'		=> $this->u_action . '&amp;action=progress_bar',
376
+			'UA_PROGRESS_BAR'		=> $this->u_action.'&amp;action=progress_bar',
377 377
 			'S_CONTINUE_SYNC'		=> true,
378 378
 			'L_PROGRESS_EXPLAIN'	=> $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', 0, $row['cat_links']))
379 379
 		);
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 	public function action_sync_cat()
390 390
 	{
391 391
 		$sql = 'SELECT cat_name
392
-			FROM ' . $this->categories_table . '
392
+			FROM ' . $this->categories_table.'
393 393
 			WHERE cat_id = ' . (int) $this->cat_id;
394 394
 		$result = $this->db->sql_query($sql);
395 395
 		$row = $this->db->sql_fetchrow($result);
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 
398 398
 		if (!$row)
399 399
 		{
400
-			trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
400
+			trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id), E_USER_WARNING);
401 401
 		}
402 402
 
403 403
 		$this->_sync_dir_cat($this->cat_id);
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 		}
423 423
 		else
424 424
 		{
425
-			$navigation = '<a href="' . $this->u_action . '">' . $this->language->lang('DIR_INDEX') . '</a>';
425
+			$navigation = '<a href="'.$this->u_action.'">'.$this->language->lang('DIR_INDEX').'</a>';
426 426
 
427 427
 			$cats_nav = $this->nestedset_category->get_path_data($this->parent_id);
428 428
 
@@ -430,11 +430,11 @@  discard block
 block discarded – undo
430 430
 			{
431 431
 				if ($row['cat_id'] == $this->parent_id)
432 432
 				{
433
-					$navigation .= ' -&gt; ' . $row['cat_name'];
433
+					$navigation .= ' -&gt; '.$row['cat_name'];
434 434
 				}
435 435
 				else
436 436
 				{
437
-					$navigation .= ' -&gt; <a href="' . $this->u_action . '&amp;parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>';
437
+					$navigation .= ' -&gt; <a href="'.$this->u_action.'&amp;parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>';
438 438
 				}
439 439
 			}
440 440
 		}
@@ -448,8 +448,8 @@  discard block
 block discarded – undo
448 448
 		}
449 449
 
450 450
 		$sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_name, cat_icon, cat_desc_uid, cat_desc_bitfield, cat_desc, cat_desc_options, cat_links
451
-			FROM ' . $this->categories_table . '
452
-			WHERE parent_id = ' . (int) $this->parent_id . '
451
+			FROM ' . $this->categories_table.'
452
+			WHERE parent_id = ' . (int) $this->parent_id.'
453 453
 			ORDER BY left_id';
454 454
 		$result = $this->db->sql_query($sql);
455 455
 
@@ -457,23 +457,23 @@  discard block
 block discarded – undo
457 457
 		{
458 458
 			do
459 459
 			{
460
-				$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $this->language->lang('DIR_SUBCAT') . '" />' : '<img src="images/icon_folder.gif" alt="' . $this->language->lang('FOLDER') . '" />';
460
+				$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="'.$this->language->lang('DIR_SUBCAT').'" />' : '<img src="images/icon_folder.gif" alt="'.$this->language->lang('FOLDER').'" />';
461 461
 
462
-				$url = $this->u_action . "&amp;parent_id=$this->parent_id&amp;c={$row['cat_id']}";
462
+				$url = $this->u_action."&amp;parent_id=$this->parent_id&amp;c={$row['cat_id']}";
463 463
 
464 464
 				$this->template->assign_block_vars('cats', array(
465 465
 					'FOLDER_IMAGE'		=> $folder_image,
466
-					'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="' . $this->get_img_path('icons', $row['cat_icon']) . '" alt="" />' : '',
466
+					'CAT_IMAGE'			=> ($row['cat_icon']) ? '<img src="'.$this->get_img_path('icons', $row['cat_icon']).'" alt="" />' : '',
467 467
 					'CAT_NAME'			=> $row['cat_name'],
468 468
 					'CAT_DESCRIPTION'	=> generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']),
469 469
 					'CAT_LINKS'			=> $row['cat_links'],
470 470
 
471
-					'U_CAT'				=> $this->u_action . '&amp;parent_id=' . $row['cat_id'],
472
-					'U_MOVE_UP'			=> $url . '&amp;action=move_up',
473
-					'U_MOVE_DOWN'		=> $url . '&amp;action=move_down',
474
-					'U_EDIT'			=> $url . '&amp;action=edit',
475
-					'U_DELETE'			=> $url . '&amp;action=delete',
476
-					'U_SYNC'			=> $url . '&amp;action=sync')
471
+					'U_CAT'				=> $this->u_action.'&amp;parent_id='.$row['cat_id'],
472
+					'U_MOVE_UP'			=> $url.'&amp;action=move_up',
473
+					'U_MOVE_DOWN'		=> $url.'&amp;action=move_down',
474
+					'U_EDIT'			=> $url.'&amp;action=edit',
475
+					'U_DELETE'			=> $url.'&amp;action=delete',
476
+					'U_SYNC'			=> $url.'&amp;action=sync')
477 477
 				);
478 478
 			}
479 479
 			while ($row = $this->db->sql_fetchrow($result));
@@ -482,14 +482,14 @@  discard block
 block discarded – undo
482 482
 		{
483 483
 			$row = $this->_get_cat_info($this->parent_id);
484 484
 
485
-			$url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;c=' . $row['cat_id'];
485
+			$url = $this->u_action.'&amp;parent_id='.$this->parent_id.'&amp;c='.$row['cat_id'];
486 486
 
487 487
 			$this->template->assign_vars(array(
488 488
 				'S_NO_CATS'			=> true,
489 489
 
490
-				'U_EDIT'			=> $url . '&amp;action=edit',
491
-				'U_DELETE'			=> $url . '&amp;action=delete',
492
-				'U_SYNC'			=> $url . '&amp;action=sync')
490
+				'U_EDIT'			=> $url.'&amp;action=edit',
491
+				'U_DELETE'			=> $url.'&amp;action=delete',
492
+				'U_SYNC'			=> $url.'&amp;action=sync')
493 493
 			);
494 494
 		}
495 495
 		$this->db->sql_freeresult($result);
@@ -499,9 +499,9 @@  discard block
 block discarded – undo
499 499
 			'NAVIGATION'	=> $navigation,
500 500
 			'CAT_BOX'		=> $cat_box,
501 501
 			'U_SEL_ACTION'	=> $this->u_action,
502
-			'U_ACTION'		=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
502
+			'U_ACTION'		=> $this->u_action.'&amp;parent_id='.$this->parent_id,
503 503
 
504
-			'UA_PROGRESS_BAR'	=> $this->u_action . '&amp;action=progress_bar',
504
+			'UA_PROGRESS_BAR'	=> $this->u_action.'&amp;action=progress_bar',
505 505
 		));
506 506
 	}
507 507
 
@@ -534,10 +534,10 @@  discard block
 block discarded – undo
534 534
 		switch ($this->action)
535 535
 		{
536 536
 			case 'delete':
537
-				$action_subcats	= $this->request->variable('action_subcats', '');
538
-				$subcats_to_id	= $this->request->variable('subcats_to_id', 0);
539
-				$action_links	= $this->request->variable('action_links', '');
540
-				$links_to_id	= $this->request->variable('links_to_id', 0);
537
+				$action_subcats = $this->request->variable('action_subcats', '');
538
+				$subcats_to_id = $this->request->variable('subcats_to_id', 0);
539
+				$action_links = $this->request->variable('action_links', '');
540
+				$links_to_id = $this->request->variable('links_to_id', 0);
541 541
 
542 542
 				try
543 543
 				{
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 			// Purge the cache to refresh route collections
607 607
 			$this->cache->purge();
608 608
 
609
-			trigger_error($this->language->lang($message) . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
609
+			trigger_error($this->language->lang($message).adm_back_link($this->u_action.'&amp;parent_id='.$this->parent_id));
610 610
 		}
611 611
 	}
612 612
 
@@ -634,8 +634,8 @@  discard block
 block discarded – undo
634 634
 		}
635 635
 
636 636
 		$sql = 'SELECT cat_route
637
-			FROM ' . $this->categories_table  . "
638
-			WHERE cat_route = '" . $this->db->sql_escape($route) . "'
637
+			FROM ' . $this->categories_table."
638
+			WHERE cat_route = '" . $this->db->sql_escape($route)."'
639 639
 				AND cat_id <> " . $this->cat_id;
640 640
 		$result = $this->db->sql_query_limit($sql, 1);
641 641
 		$row = $this->db->sql_fetchrow($result);
@@ -685,10 +685,10 @@  discard block
 block discarded – undo
685 685
 			'S_CAT_PARENT_ID'	=> $this->cat_data['parent_id'],
686 686
 			'S_ADD_ACTION'		=> ($this->action == 'add') ? true : false,
687 687
 
688
-			'U_BACK'			=> $this->u_action . '&amp;parent_id=' . $this->parent_id,
689
-			'U_EDIT_ACTION'		=> $this->u_action . "&amp;parent_id={$this->parent_id}&amp;action=$this->action&amp;c=$this->cat_id",
688
+			'U_BACK'			=> $this->u_action.'&amp;parent_id='.$this->parent_id,
689
+			'U_EDIT_ACTION'		=> $this->u_action."&amp;parent_id={$this->parent_id}&amp;action=$this->action&amp;c=$this->cat_id",
690 690
 
691
-			'L_TITLE'					=> $this->language->lang('DIR_' . strtoupper($this->action) . '_CAT'),
691
+			'L_TITLE'					=> $this->language->lang('DIR_'.strtoupper($this->action).'_CAT'),
692 692
 			'ERROR_MSG'					=> (sizeof($this->errors)) ? implode('<br />', $this->errors) : '',
693 693
 			'ICON_IMAGE'				=> ($this->cat_data['cat_icon']) ? $this->get_img_path('icons', $this->cat_data['cat_icon']) : 'images/spacer.gif',
694 694
 
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 	private function _get_cat_info($cat_id)
733 733
 	{
734 734
 		$sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, cat_route, display_subcat_list, cat_allow_comments, cat_allow_votes, cat_must_describe, cat_count_all, cat_validate, cat_cron_freq, cat_cron_nb_check, cat_link_back, cat_cron_enable, cat_cron_next
735
-			FROM ' . $this->categories_table . '
735
+			FROM ' . $this->categories_table.'
736 736
 			WHERE cat_id = ' . (int) $cat_id;
737 737
 		$result = $this->db->sql_query($sql);
738 738
 		$row = $this->db->sql_fetchrow($result);
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
 		{
798 798
 			if ($cat_data_sql['cat_cron_enable'])
799 799
 			{
800
-				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;
800
+				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;
801 801
 			}
802 802
 
803 803
 			$this->cat_data = $this->nestedset_category->insert($cat_data_sql);
@@ -820,13 +820,13 @@  discard block
 block discarded – undo
820 820
 
821 821
 			if ($cat_data_sql['cat_cron_enable'] && ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable']))
822 822
 			{
823
-				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400;
823
+				$cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400;
824 824
 			}
825 825
 
826 826
 			if ($row['cat_name'] != $cat_data_sql['cat_name'])
827 827
 			{
828 828
 				// the cat name has changed, clear the parents list of all categories (for safety)
829
-				$sql = 'UPDATE ' . $this->categories_table . "
829
+				$sql = 'UPDATE '.$this->categories_table."
830 830
 					SET cat_parents = ''";
831 831
 				$this->db->sql_query($sql);
832 832
 			}
@@ -834,8 +834,8 @@  discard block
 block discarded – undo
834 834
 			// Setting the cat id to the categorie id is not really received well by some dbs. ;)
835 835
 			unset($cat_data_sql['cat_id']);
836 836
 
837
-			$sql = 'UPDATE ' . $this->categories_table . '
838
-				SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql) . '
837
+			$sql = 'UPDATE '.$this->categories_table.'
838
+				SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql).'
839 839
 				WHERE cat_id = ' . (int) $this->cat_id;
840 840
 			$this->db->sql_query($sql);
841 841
 
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 				$log_action_links = 'MOVE_LINKS';
877 877
 
878 878
 				$sql = 'SELECT cat_name
879
-					FROM ' . $this->categories_table . '
879
+					FROM ' . $this->categories_table.'
880 880
 					WHERE cat_id = ' . (int) $links_to_id;
881 881
 				$result = $this->db->sql_query($sql);
882 882
 				$row = $this->db->sql_fetchrow($result);
@@ -976,12 +976,12 @@  discard block
 block discarded – undo
976 976
 	*/
977 977
 	private function _move_cat_content($from_id, $to_id)
978 978
 	{
979
-		$sql = 'UPDATE ' . $this->links_table . '
980
-			SET link_cat = ' . (int) $to_id . '
979
+		$sql = 'UPDATE '.$this->links_table.'
980
+			SET link_cat = ' . (int) $to_id.'
981 981
 			WHERE link_cat = ' . (int) $from_id;
982 982
 		$this->db->sql_query($sql);
983 983
 
984
-		$sql = 'DELETE FROM ' . $this->watch_table . '
984
+		$sql = 'DELETE FROM '.$this->watch_table.'
985 985
 			WHERE cat_id = ' . (int) $from_id;
986 986
 		$this->db->sql_query($sql);
987 987
 
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
 
1000 1000
 		// Before we remove anything we make sure we are able to adjust the post counts later. ;)
1001 1001
 		$sql = 'SELECT link_id, link_banner
1002
-			FROM ' . $this->links_table . '
1002
+			FROM ' . $this->links_table.'
1003 1003
 			WHERE link_cat = ' . (int) $this->cat_id;
1004 1004
 		$result = $this->db->sql_query($sql);
1005 1005
 
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 
1031 1031
 			foreach ($link_datas_ary as $table => $field)
1032 1032
 			{
1033
-				$this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $link_ids));
1033
+				$this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $link_ids));
1034 1034
 			}
1035 1035
 		}
1036 1036
 
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
 
1043 1043
 		foreach ($cat_datas_ary as $table => $field)
1044 1044
 		{
1045
-			$this->db->sql_query("DELETE FROM $table WHERE $field = " . (int) $this->cat_id);
1045
+			$this->db->sql_query("DELETE FROM $table WHERE $field = ".(int) $this->cat_id);
1046 1046
 		}
1047 1047
 
1048 1048
 		$this->db->sql_transaction('commit');
@@ -1057,15 +1057,15 @@  discard block
 block discarded – undo
1057 1057
 	private function _sync_dir_cat($cat_id)
1058 1058
 	{
1059 1059
 		$sql = 'SELECT COUNT(link_id) AS num_links
1060
-			FROM ' . $this->links_table . '
1061
-			WHERE link_cat = ' . (int) $cat_id . '
1060
+			FROM ' . $this->links_table.'
1061
+			WHERE link_cat = ' . (int) $cat_id.'
1062 1062
 				AND link_active = 1';
1063 1063
 		$result = $this->db->sql_query($sql);
1064 1064
 		$total_links = (int) $this->db->sql_fetchfield('num_links');
1065 1065
 		$this->db->sql_freeresult($result);
1066 1066
 
1067
-		$sql = 'UPDATE ' . $this->categories_table . '
1068
-			SET cat_links = ' . $total_links . '
1067
+		$sql = 'UPDATE '.$this->categories_table.'
1068
+			SET cat_links = ' . $total_links.'
1069 1069
 			WHERE cat_id = ' . (int) $cat_id;
1070 1070
 		$this->db->sql_query($sql);
1071 1071
 	}
@@ -1085,33 +1085,33 @@  discard block
 block discarded – undo
1085 1085
 			'link_vote'		=> 0,
1086 1086
 		);
1087 1087
 
1088
-		$sql = 'UPDATE ' . $this->links_table . '
1089
-			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
1090
-			WHERE link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop;
1088
+		$sql = 'UPDATE '.$this->links_table.'
1089
+			SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).'
1090
+			WHERE link_id BETWEEN ' . (int) $start.' AND '.(int) $stop;
1091 1091
 		$this->db->sql_query($sql);
1092 1092
 
1093
-		$sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM ' . $this->votes_table . '
1094
-			WHERE vote_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . '
1093
+		$sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM '.$this->votes_table.'
1094
+			WHERE vote_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'
1095 1095
 			GROUP BY vote_link_id';
1096 1096
 		$result = $this->db->sql_query($sql);
1097 1097
 		while ($tmp = $this->db->sql_fetchrow($result))
1098 1098
 		{
1099
-			$sql = 'UPDATE ' . $this->links_table . '
1100
-				SET link_note = ' . (int) $tmp['total'] . ', link_vote = ' . (int) $tmp['nb_vote'] . '
1099
+			$sql = 'UPDATE '.$this->links_table.'
1100
+				SET link_note = ' . (int) $tmp['total'].', link_vote = '.(int) $tmp['nb_vote'].'
1101 1101
 				WHERE link_id = ' . (int) $tmp['vote_link_id'];
1102 1102
 			$this->db->sql_query($sql);
1103 1103
 		}
1104 1104
 		$this->db->sql_freeresult($result);
1105 1105
 
1106 1106
 		$sql = 'SELECT 	comment_link_id, COUNT(comment_id) AS nb_comment
1107
-			FROM ' . $this->comments_table . '
1108
-			WHERE comment_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . '
1107
+			FROM ' . $this->comments_table.'
1108
+			WHERE comment_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.'
1109 1109
 			GROUP BY comment_link_id';
1110 1110
 		$result = $this->db->sql_query($sql);
1111 1111
 		while ($tmp = $this->db->sql_fetchrow($result))
1112 1112
 		{
1113
-			$sql = 'UPDATE ' . $this->links_table . '
1114
-				SET link_comment = ' . (int) $tmp['nb_comment'] . '
1113
+			$sql = 'UPDATE '.$this->links_table.'
1114
+				SET link_comment = ' . (int) $tmp['nb_comment'].'
1115 1115
 				WHERE link_id = ' . (int) $tmp['comment_link_id'];
1116 1116
 			$this->db->sql_query($sql);
1117 1117
 		}
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
 
1137 1137
 			foreach ($img_ary as $img)
1138 1138
 			{
1139
-				$img = $path . $img;
1139
+				$img = $path.$img;
1140 1140
 				$selected = '';
1141 1141
 
1142 1142
 				if (strlen($img) > 255)
@@ -1149,7 +1149,7 @@  discard block
 block discarded – undo
1149 1149
 					$selected = ' selected="selected"';
1150 1150
 				}
1151 1151
 
1152
-				$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
1152
+				$filename_list .= '<option value="'.htmlspecialchars($img).'"'.$selected.'>'.$img.'</option>';
1153 1153
 			}
1154 1154
 		}
1155 1155
 
Please login to merge, or discard this patch.