| @@ -60,13 +60,13 @@ discard block | ||
| 60 | 60 | */ | 
| 61 | 61 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\language\language $language, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\request\request $request, \phpbb\auth\auth $auth, \phpbb\cron\manager $cron) | 
| 62 | 62 |  	{ | 
| 63 | - $this->db = $db; | |
| 64 | - $this->config = $config; | |
| 63 | + $this->db = $db; | |
| 64 | + $this->config = $config; | |
| 65 | 65 | $this->language = $language; | 
| 66 | 66 | $this->template = $template; | 
| 67 | 67 | $this->user = $user; | 
| 68 | - $this->helper = $helper; | |
| 69 | - $this->request = $request; | |
| 68 | + $this->helper = $helper; | |
| 69 | + $this->request = $request; | |
| 70 | 70 | $this->auth = $auth; | 
| 71 | 71 | $this->cron = $cron; | 
| 72 | 72 | } | 
| @@ -90,7 +90,7 @@ discard block | ||
| 90 | 90 | public function make_cat_jumpbox() | 
| 91 | 91 |  	{ | 
| 92 | 92 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id | 
| 93 | - FROM ' . $this->categories_table . ' | |
| 93 | + FROM ' . $this->categories_table.' | |
| 94 | 94 | ORDER BY left_id ASC'; | 
| 95 | 95 | $result = $this->db->sql_query($sql); | 
| 96 | 96 | |
| @@ -119,7 +119,7 @@ discard block | ||
| 119 | 119 | 'FORUM_ID' => $row['cat_id'], | 
| 120 | 120 | 'FORUM_NAME' => $row['cat_name'], | 
| 121 | 121 | 'S_FORUM_COUNT' => $iteration, | 
| 122 | -				'LINK'			=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $row['cat_id']), | |
| 122 | +				'LINK'			=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$row['cat_id']), | |
| 123 | 123 | )); | 
| 124 | 124 | |
| 125 | 125 | for ($i = 0; $i < $padding; $i++) | 
| @@ -151,7 +151,7 @@ discard block | ||
| 151 | 151 | |
| 152 | 152 | // This query is identical to the jumpbox one | 
| 153 | 153 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id | 
| 154 | - FROM ' . $this->categories_table . ' | |
| 154 | + FROM ' . $this->categories_table.' | |
| 155 | 155 | ORDER BY left_id ASC'; | 
| 156 | 156 | $result = $this->db->sql_query($sql); | 
| 157 | 157 | |
| @@ -181,7 +181,7 @@ discard block | ||
| 181 | 181 | } | 
| 182 | 182 | |
| 183 | 183 | $selected = (($row['cat_id'] == $select_id) ? ' selected="selected"' : ''); | 
| 184 | - $cat_list .= '<option value="' . $row['cat_id'] . '"' . (($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected) . '>' . $padding . $row['cat_name'] . '</option>'; | |
| 184 | + $cat_list .= '<option value="'.$row['cat_id'].'"'.(($disabled) ? ' disabled="disabled" class="disabled-option"' : $selected).'>'.$padding.$row['cat_name'].'</option>'; | |
| 185 | 185 | } | 
| 186 | 186 | $this->db->sql_freeresult($result); | 
| 187 | 187 | unset($padding_store); | 
| @@ -196,7 +196,7 @@ discard block | ||
| 196 | 196 | */ | 
| 197 | 197 | public function display() | 
| 198 | 198 |  	{ | 
| 199 | - $cat_rows = $subcats = array(); | |
| 199 | + $cat_rows = $subcats = array(); | |
| 200 | 200 | $parent_id = $visible_cats = 0; | 
| 201 | 201 | |
| 202 | 202 | $sql_array = array( | 
| @@ -214,7 +214,7 @@ discard block | ||
| 214 | 214 | else | 
| 215 | 215 |  		{ | 
| 216 | 216 | $root_data = $this->data; | 
| 217 | - $sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id']; | |
| 217 | + $sql_where = 'left_id > '.$root_data['left_id'].' AND left_id < '.$root_data['right_id']; | |
| 218 | 218 | } | 
| 219 | 219 | |
| 220 | 220 |  		$sql = $this->db->sql_build_query('SELECT', array( | 
| @@ -261,12 +261,12 @@ discard block | ||
| 261 | 261 |  			{ | 
| 262 | 262 | foreach ($subcats[$dir_cat_id] as $subcat_id => $subcat_row) | 
| 263 | 263 |  				{ | 
| 264 | - $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links']+$subcat_row['links']) : $row['cat_links']; | |
| 264 | + $row['cat_links'] = ($row['cat_count_all']) ? ($row['cat_links'] + $subcat_row['links']) : $row['cat_links']; | |
| 265 | 265 | |
| 266 | 266 | if ($subcat_row['display'] && $subcat_row['parent_id'] == $dir_cat_id) | 
| 267 | 267 |  					{ | 
| 268 | 268 | $subcats_list[] = array( | 
| 269 | -							'link'		=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $subcat_id), | |
| 269 | +							'link'		=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$subcat_id), | |
| 270 | 270 | 'name' => $subcat_row['name'], | 
| 271 | 271 | 'links' => $subcat_row['links'] | 
| 272 | 272 | ); | 
| @@ -284,7 +284,7 @@ discard block | ||
| 284 | 284 | 'CAT_LINKS' => $row['cat_links'], | 
| 285 | 285 |  				'CAT_IMG'				=> $this->get_img_path('icons', $row['cat_icon']), | 
| 286 | 286 | |
| 287 | -				'U_CAT'					=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $row['cat_id']), | |
| 287 | +				'U_CAT'					=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$row['cat_id']), | |
| 288 | 288 | )); | 
| 289 | 289 | |
| 290 | 290 | // Assign subcats loop for style authors | 
| @@ -316,7 +316,7 @@ discard block | ||
| 316 | 316 | if ($task->is_ready()) | 
| 317 | 317 |  			{ | 
| 318 | 318 | $url = $task->get_url(); | 
| 319 | -				$this->template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="" />'); | |
| 319 | +				$this->template->assign_var('RUN_CRON_TASK', '<img src="'.$url.'" width="1" height="1" alt="" />'); | |
| 320 | 320 | } | 
| 321 | 321 | } | 
| 322 | 322 | } | 
| @@ -338,10 +338,10 @@ discard block | ||
| 338 | 338 | 'LEFT_JOIN' => array( | 
| 339 | 339 | array( | 
| 340 | 340 | 'FROM' => array($this->watch_table => 'w'), | 
| 341 | - 'ON' => 'c.cat_id = w.cat_id AND w.user_id = ' . (int) $this->user->data['user_id'] | |
| 341 | + 'ON' => 'c.cat_id = w.cat_id AND w.user_id = '.(int) $this->user->data['user_id'] | |
| 342 | 342 | ), | 
| 343 | 343 | ), | 
| 344 | - 'WHERE' => 'c.cat_id = ' . (int) $cat_id | |
| 344 | + 'WHERE' => 'c.cat_id = '.(int) $cat_id | |
| 345 | 345 | ); | 
| 346 | 346 |  			$sql = $this->db->sql_build_query('SELECT', $sql_array); | 
| 347 | 347 | $result = $this->db->sql_query($sql); | 
| @@ -378,8 +378,8 @@ discard block | ||
| 378 | 378 |  				$this->template->assign_block_vars('dir_navlinks', array( | 
| 379 | 379 | 'FORUM_NAME' => $parent_data['cat_name'], | 
| 380 | 380 | 'FORUM_ID' => $parent_cat_id, | 
| 381 | - 'MICRODATA' => $microdata_attr . '="' . $parent_cat_id . '"', | |
| 382 | -					'U_VIEW_FORUM'	=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $parent_cat_id), | |
| 381 | + 'MICRODATA' => $microdata_attr.'="'.$parent_cat_id.'"', | |
| 382 | +					'U_VIEW_FORUM'	=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$parent_cat_id), | |
| 383 | 383 | )); | 
| 384 | 384 | } | 
| 385 | 385 | } | 
| @@ -387,8 +387,8 @@ discard block | ||
| 387 | 387 |  		$this->template->assign_block_vars('dir_navlinks', array( | 
| 388 | 388 | 'FORUM_NAME' => $dir_cat_data['cat_name'], | 
| 389 | 389 | 'FORUM_ID' => $dir_cat_data['cat_id'], | 
| 390 | - 'MICRODATA' => $microdata_attr . '="' . $dir_cat_data['cat_id'] . '"', | |
| 391 | -			'U_VIEW_FORUM'	=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $dir_cat_data['cat_id']), | |
| 390 | + 'MICRODATA' => $microdata_attr.'="'.$dir_cat_data['cat_id'].'"', | |
| 391 | +			'U_VIEW_FORUM'	=> $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$dir_cat_data['cat_id']), | |
| 392 | 392 | )); | 
| 393 | 393 | |
| 394 | 394 | return; | 
| @@ -444,17 +444,17 @@ discard block | ||
| 444 | 444 |  			{ | 
| 445 | 445 | if ($mode == 'unwatch') | 
| 446 | 446 |  				{ | 
| 447 | - $sql = 'DELETE FROM ' . $this->watch_table . " | |
| 447 | + $sql = 'DELETE FROM '.$this->watch_table." | |
| 448 | 448 | WHERE cat_id = $cat_id | 
| 449 | 449 | AND user_id = $user_id"; | 
| 450 | 450 | $this->db->sql_query($sql); | 
| 451 | 451 | |
| 452 | -					$redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id); | |
| 452 | +					$redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id); | |
| 453 | 453 |  					$message = $this->language->lang('DIR_NOT_WATCHING_CAT'); | 
| 454 | 454 | |
| 455 | 455 | if (!$this->request->is_ajax()) | 
| 456 | 456 |  					{ | 
| 457 | -						$message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); | |
| 457 | +						$message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); | |
| 458 | 458 | } | 
| 459 | 459 | |
| 460 | 460 | meta_refresh(3, $redirect_url); | 
| @@ -466,8 +466,8 @@ discard block | ||
| 466 | 466 | |
| 467 | 467 | if ($notify_status != NOTIFY_YES) | 
| 468 | 468 |  					{ | 
| 469 | - $sql = 'UPDATE ' . $this->watch_table . ' | |
| 470 | - SET notify_status = ' . NOTIFY_YES . " | |
| 469 | + $sql = 'UPDATE '.$this->watch_table.' | |
| 470 | + SET notify_status = ' . NOTIFY_YES." | |
| 471 | 471 | WHERE cat_id = $cat_id | 
| 472 | 472 | AND user_id = $user_id"; | 
| 473 | 473 | $this->db->sql_query($sql); | 
| @@ -478,16 +478,16 @@ discard block | ||
| 478 | 478 |  			{ | 
| 479 | 479 | if ($mode == 'watch') | 
| 480 | 480 |  				{ | 
| 481 | - $sql = 'INSERT INTO ' . $this->watch_table . " (user_id, cat_id, notify_status) | |
| 482 | - VALUES ($user_id, $cat_id, " . NOTIFY_YES . ')'; | |
| 481 | + $sql = 'INSERT INTO '.$this->watch_table." (user_id, cat_id, notify_status) | |
| 482 | + VALUES ($user_id, $cat_id, ".NOTIFY_YES.')'; | |
| 483 | 483 | $this->db->sql_query($sql); | 
| 484 | 484 | |
| 485 | -					$redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_' . $cat_id); | |
| 485 | +					$redirect_url = $this->helper->route('ernadoo_phpbbdirectory_dynamic_route_'.$cat_id); | |
| 486 | 486 |  					$message = $this->language->lang('DIR_ARE_WATCHING_CAT'); | 
| 487 | 487 | |
| 488 | 488 | if (!$this->request->is_ajax()) | 
| 489 | 489 |  					{ | 
| 490 | -						$message .= '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $redirect_url . '">', '</a>'); | |
| 490 | +						$message .= '<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$redirect_url.'">', '</a>'); | |
| 491 | 491 | } | 
| 492 | 492 | |
| 493 | 493 | meta_refresh(3, $redirect_url); | 
| @@ -507,10 +507,10 @@ discard block | ||
| 507 | 507 | |
| 508 | 508 | if ($can_watch) | 
| 509 | 509 |  		{ | 
| 510 | -			$s_watching['link'] 		= $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); | |
| 510 | +			$s_watching['link'] = $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => (($is_watching) ? 'unwatch' : 'watch'))); | |
| 511 | 511 |  			$s_watching['link_toggle'] 	= $this->helper->route('ernadoo_phpbbdirectory_suscribe_controller', array('cat_id' => $cat_id, 'mode' => ((!$is_watching) ? 'unwatch' : 'watch'))); | 
| 512 | - $s_watching['title'] = $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT'); | |
| 513 | - $s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START') . '_WATCHING_CAT'); | |
| 512 | + $s_watching['title'] = $this->language->lang((($is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT'); | |
| 513 | + $s_watching['title_toggle'] = $this->language->lang(((!$is_watching) ? 'DIR_STOP' : 'DIR_START').'_WATCHING_CAT'); | |
| 514 | 514 | $s_watching['is_watching'] = $is_watching; | 
| 515 | 515 | } | 
| 516 | 516 | |
| @@ -530,7 +530,7 @@ discard block | ||
| 530 | 530 |  		$categories_table = $phpbb_container->getParameter('tables.dir.categories'); | 
| 531 | 531 | |
| 532 | 532 | $sql = 'SELECT cat_name | 
| 533 | - FROM ' . $categories_table . ' | |
| 533 | + FROM ' . $categories_table.' | |
| 534 | 534 | WHERE cat_id = ' . (int) $cat_id; | 
| 535 | 535 | $result = $db->sql_query($sql); | 
| 536 | 536 | $row = $db->sql_fetchrow($result); |