@@ -13,8 +13,8 @@ |
||
13 | 13 | class comment_text extends \phpbb\textreparser\row_based_plugin |
14 | 14 | { |
15 | 15 | /** |
16 | - * {@inheritdoc} |
|
17 | - */ |
|
16 | + * {@inheritdoc} |
|
17 | + */ |
|
18 | 18 | public function get_columns() |
19 | 19 | { |
20 | 20 | return array( |
@@ -19,10 +19,10 @@ discard block |
||
19 | 19 | public $u_action; |
20 | 20 | |
21 | 21 | /** |
22 | - * |
|
23 | - * @param int $id |
|
24 | - * @param string $mode |
|
25 | - */ |
|
22 | + * |
|
23 | + * @param int $id |
|
24 | + * @param string $mode |
|
25 | + */ |
|
26 | 26 | public function main($id, $mode) |
27 | 27 | { |
28 | 28 | global $request, $phpbb_container; |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
190 | - * Display thumb services available |
|
191 | - * |
|
192 | - * @param string $url_selected |
|
193 | - * @return string |
|
194 | - */ |
|
190 | + * Display thumb services available |
|
191 | + * |
|
192 | + * @param string $url_selected |
|
193 | + * @return string |
|
194 | + */ |
|
195 | 195 | public function get_thumb_service_list($url_selected) |
196 | 196 | { |
197 | 197 | $thumbshot = array( |
@@ -211,11 +211,11 @@ discard block |
||
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
214 | - * Display order drop-down list |
|
215 | - * |
|
216 | - * @param string $order_selected |
|
217 | - * @return string |
|
218 | - */ |
|
214 | + * Display order drop-down list |
|
215 | + * |
|
216 | + * @param string $order_selected |
|
217 | + * @return string |
|
218 | + */ |
|
219 | 219 | public function get_order_list($order_selected) |
220 | 220 | { |
221 | 221 | global $user; |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
247 | - * Adjust all three max_filesize config vars for display |
|
248 | - */ |
|
247 | + * Adjust all three max_filesize config vars for display |
|
248 | + */ |
|
249 | 249 | public function max_filesize($value, $key = '') |
250 | 250 | { |
251 | 251 | // Determine size var and adjust the value accordingly |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | $selected = ($url == $url_selected) ? 'selected="selected"' : ''; |
206 | 206 | |
207 | - $select_options .= '<option value="' . $url . '" ' . $selected . '>' . parse_url($url, PHP_URL_HOST) . '</option>'; |
|
207 | + $select_options .= '<option value="'.$url.'" '.$selected.'>'.parse_url($url, PHP_URL_HOST).'</option>'; |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | return $select_options; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | { |
238 | 238 | $selected = ($i == $order_selected) ? 'selected="selected"' : ''; |
239 | 239 | $order_substr = trim(str_replace(' ', '_', $i)); |
240 | - $tpl .= '<option value="' . $i . '" ' . $selected . '>' . $user->lang['DIR_ORDER_' . strtoupper($order_substr)] . '</option>'; |
|
240 | + $tpl .= '<option value="'.$i.'" '.$selected.'>'.$user->lang['DIR_ORDER_'.strtoupper($order_substr)].'</option>'; |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | return ($tpl); |
@@ -254,6 +254,6 @@ discard block |
||
254 | 254 | $value = $filesize['value']; |
255 | 255 | |
256 | 256 | // size and maxlength must not be specified for input of type number |
257 | - return '<input type="number" id="' . $key . '" min="0" max="999999999999999" step="any" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>'; |
|
257 | + return '<input type="number" id="'.$key.'" min="0" max="999999999999999" step="any" name="config['.$key.']" value="'.$value.'" /> <select name="'.$key.'">'.size_select_options($size_var).'</select>'; |
|
258 | 258 | } |
259 | 259 | } |
@@ -69,22 +69,22 @@ discard block |
||
69 | 69 | protected $php_ext; |
70 | 70 | |
71 | 71 | /** |
72 | - * Constructor |
|
73 | - * |
|
74 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
75 | - * @param \phpbb\config\config $config Config object |
|
76 | - * @param \phpbb\language\language $language Language object |
|
77 | - * @param \phpbb\template\template $template Template object |
|
78 | - * @param \phpbb\user $user User object |
|
79 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
80 | - * @param \phpbb\request\request $request Request object |
|
81 | - * @param \phpbb\auth\auth $auth Auth object |
|
82 | - * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
83 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
84 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
85 | - * @param string $root_path phpBB root path |
|
86 | - * @param string $php_ext phpEx |
|
87 | - */ |
|
72 | + * Constructor |
|
73 | + * |
|
74 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
75 | + * @param \phpbb\config\config $config Config object |
|
76 | + * @param \phpbb\language\language $language Language object |
|
77 | + * @param \phpbb\template\template $template Template object |
|
78 | + * @param \phpbb\user $user User object |
|
79 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
80 | + * @param \phpbb\request\request $request Request object |
|
81 | + * @param \phpbb\auth\auth $auth Auth object |
|
82 | + * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
83 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
84 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
85 | + * @param string $root_path phpBB root path |
|
86 | + * @param string $php_ext phpEx |
|
87 | + */ |
|
88 | 88 | 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\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext) |
89 | 89 | { |
90 | 90 | $this->db = $db; |
@@ -109,12 +109,12 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
112 | - * Delete a link |
|
113 | - * |
|
114 | - * @param int $cat_id The category ID |
|
115 | - * @param int $link_id The link ID |
|
116 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
117 | - */ |
|
112 | + * Delete a link |
|
113 | + * |
|
114 | + * @param int $cat_id The category ID |
|
115 | + * @param int $link_id The link ID |
|
116 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
117 | + */ |
|
118 | 118 | public function delete_link($cat_id, $link_id) |
119 | 119 | { |
120 | 120 | if ($this->request->is_set_post('cancel')) |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
160 | - * Edit a link |
|
161 | - * |
|
162 | - * @param int $cat_id The category ID |
|
163 | - * @param int $link_id The link ID |
|
164 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
165 | - * @throws \phpbb\exception\http_exception |
|
166 | - */ |
|
160 | + * Edit a link |
|
161 | + * |
|
162 | + * @param int $cat_id The category ID |
|
163 | + * @param int $link_id The link ID |
|
164 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
165 | + * @throws \phpbb\exception\http_exception |
|
166 | + */ |
|
167 | 167 | public function edit_link($cat_id, $link_id) |
168 | 168 | { |
169 | 169 | $sql = 'SELECT link_user_id |
@@ -238,12 +238,12 @@ discard block |
||
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
241 | - * Display add form |
|
242 | - * |
|
243 | - * @param int $cat_id The category ID |
|
244 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
245 | - * @throws \phpbb\exception\http_exception |
|
246 | - */ |
|
241 | + * Display add form |
|
242 | + * |
|
243 | + * @param int $cat_id The category ID |
|
244 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
245 | + * @throws \phpbb\exception\http_exception |
|
246 | + */ |
|
247 | 247 | public function new_link($cat_id) |
248 | 248 | { |
249 | 249 | if (!$this->auth->acl_get('u_submit_dir')) |
@@ -285,23 +285,23 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | /** |
288 | - * View link controller |
|
289 | - * |
|
290 | - * @param int $link_id The link ID |
|
291 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
292 | - */ |
|
288 | + * View link controller |
|
289 | + * |
|
290 | + * @param int $link_id The link ID |
|
291 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
292 | + */ |
|
293 | 293 | public function view_link($link_id) |
294 | 294 | { |
295 | 295 | return $this->link->view($link_id); |
296 | 296 | } |
297 | 297 | |
298 | 298 | /** |
299 | - * Vote for a link |
|
300 | - * |
|
301 | - * @param int $cat_id The category ID |
|
302 | - * @param int $link_id The link ID |
|
303 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
304 | - */ |
|
299 | + * Vote for a link |
|
300 | + * |
|
301 | + * @param int $cat_id The category ID |
|
302 | + * @param int $link_id The link ID |
|
303 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
304 | + */ |
|
305 | 305 | public function vote_link($cat_id, $link_id) |
306 | 306 | { |
307 | 307 | $this->categorie->get($cat_id); |
@@ -337,14 +337,14 @@ discard block |
||
337 | 337 | } |
338 | 338 | |
339 | 339 | /** |
340 | - * Routine |
|
341 | - * |
|
342 | - * @param int $cat_id The category ID |
|
343 | - * @param int $link_id The link ID |
|
344 | - * @param string $mode add|edit |
|
345 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
346 | - * @throws \phpbb\exception\http_exception |
|
347 | - */ |
|
340 | + * Routine |
|
341 | + * |
|
342 | + * @param int $cat_id The category ID |
|
343 | + * @param int $link_id The link ID |
|
344 | + * @param string $mode add|edit |
|
345 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
346 | + * @throws \phpbb\exception\http_exception |
|
347 | + */ |
|
348 | 348 | private function _data_processing($cat_id, $link_id = 0, $mode = 'new') |
349 | 349 | { |
350 | 350 | if (($mode == 'edit' && !$this->auth->acl_get('m_edit_dir') && !$this->auth->acl_get('u_edit_dir')) || ($mode == 'new' && !$this->auth->acl_get('u_submit_dir'))) |
@@ -434,8 +434,8 @@ discard block |
||
434 | 434 | if (!$error) |
435 | 435 | { |
436 | 436 | /** |
437 | - * No errrors, we execute heavy tasks wich need a valid url |
|
438 | - */ |
|
437 | + * No errrors, we execute heavy tasks wich need a valid url |
|
438 | + */ |
|
439 | 439 | |
440 | 440 | // Banner |
441 | 441 | $this->link->banner_process($this->banner, $error); |
@@ -520,11 +520,11 @@ discard block |
||
520 | 520 | } |
521 | 521 | |
522 | 522 | /** |
523 | - * Display a banner |
|
524 | - * |
|
525 | - * @param string $banner_img Path to banner file |
|
526 | - * @return Response object |
|
527 | - */ |
|
523 | + * Display a banner |
|
524 | + * |
|
525 | + * @param string $banner_img Path to banner file |
|
526 | + * @return Response object |
|
527 | + */ |
|
528 | 528 | public function return_banner($banner_img) |
529 | 529 | { |
530 | 530 | if (!function_exists('file_gc')) |
@@ -558,13 +558,13 @@ discard block |
||
558 | 558 | } |
559 | 559 | |
560 | 560 | /** |
561 | - * Populate form when an error occurred |
|
562 | - * |
|
563 | - * @param int $cat_id The category ID |
|
564 | - * @param string $mode add|edit |
|
565 | - * @param string $title Page title (depends of $mode) |
|
566 | - * @return null |
|
567 | - */ |
|
561 | + * Populate form when an error occurred |
|
562 | + * |
|
563 | + * @param int $cat_id The category ID |
|
564 | + * @param string $mode add|edit |
|
565 | + * @param string $title Page title (depends of $mode) |
|
566 | + * @return null |
|
567 | + */ |
|
568 | 568 | private function _populate_form($cat_id, $mode, $title) |
569 | 569 | { |
570 | 570 | global $phpbb_extension_manager; |
@@ -87,19 +87,19 @@ discard block |
||
87 | 87 | */ |
88 | 88 | 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\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext) |
89 | 89 | { |
90 | - $this->db = $db; |
|
91 | - $this->config = $config; |
|
90 | + $this->db = $db; |
|
91 | + $this->config = $config; |
|
92 | 92 | $this->language = $language; |
93 | 93 | $this->template = $template; |
94 | 94 | $this->user = $user; |
95 | - $this->helper = $helper; |
|
96 | - $this->request = $request; |
|
95 | + $this->helper = $helper; |
|
96 | + $this->request = $request; |
|
97 | 97 | $this->auth = $auth; |
98 | - $this->captcha_factory = $captcha_factory; |
|
98 | + $this->captcha_factory = $captcha_factory; |
|
99 | 99 | $this->categorie = $categorie; |
100 | 100 | $this->link = $link; |
101 | 101 | $this->root_path = $root_path; |
102 | - $this->php_ext = $php_ext; |
|
102 | + $this->php_ext = $php_ext; |
|
103 | 103 | |
104 | 104 | $language->add_lang('directory', 'ernadoo/phpbbdirectory'); |
105 | 105 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | $sql = 'SELECT link_user_id |
127 | - FROM ' . $this->links_table . ' |
|
127 | + FROM ' . $this->links_table.' |
|
128 | 128 | WHERE link_id = ' . (int) $link_id; |
129 | 129 | $result = $this->db->sql_query($sql); |
130 | 130 | $link_data = $this->db->sql_fetchrow($result); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); |
149 | 149 | meta_refresh(3, $meta_info); |
150 | - $message = $this->language->lang('DIR_DELETE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>'); |
|
150 | + $message = $this->language->lang('DIR_DELETE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)).'">', '</a>'); |
|
151 | 151 | return $this->helper->message($message); |
152 | 152 | } |
153 | 153 | else |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | public function edit_link($cat_id, $link_id) |
168 | 168 | { |
169 | 169 | $sql = 'SELECT link_user_id |
170 | - FROM ' . $this->links_table . ' |
|
170 | + FROM ' . $this->links_table.' |
|
171 | 171 | WHERE link_id = ' . (int) $link_id; |
172 | 172 | $result = $this->db->sql_query($sql); |
173 | 173 | $link_data = $this->db->sql_fetchrow($result); |
@@ -183,7 +183,7 @@ discard block |
||
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->language->lang('DIR_EDIT_SITE'); |
|
186 | + $title = $this->language->lang('DIR_EDIT_SITE'); |
|
187 | 187 | |
188 | 188 | $this->template->assign_block_vars('dir_navlinks', array( |
189 | 189 | 'FORUM_NAME' => $title, |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | else |
204 | 204 | { |
205 | 205 | $sql = 'SELECT link_id, link_uid, link_flags, link_bitfield, link_cat, link_url, link_description, link_guest_email, link_name, link_rss, link_back, link_banner, link_flag, link_cat, link_time |
206 | - FROM ' . $this->links_table . ' |
|
206 | + FROM ' . $this->links_table.' |
|
207 | 207 | WHERE link_id = ' . (int) $link_id; |
208 | 208 | $result = $this->db->sql_query($sql); |
209 | 209 | |
@@ -219,15 +219,15 @@ discard block |
||
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 |
||
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->language->lang('DIR_NEW_SITE'); |
|
257 | + $title = $this->language->lang('DIR_NEW_SITE'); |
|
258 | 258 | |
259 | 259 | $this->template->assign_block_vars('dir_navlinks', array( |
260 | 260 | 'FORUM_NAME' => $title, |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | |
319 | 319 | // We check if user had already vot for this website. |
320 | 320 | $sql = 'SELECT vote_link_id |
321 | - FROM ' . $this->votes_table . ' |
|
321 | + FROM ' . $this->votes_table.' |
|
322 | 322 | WHERE ' . $this->db->sql_build_array('SELECT', $data); |
323 | 323 | $result = $this->db->sql_query($sql); |
324 | 324 | $data = $this->db->sql_fetchrow($result); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); |
334 | 334 | meta_refresh(3, $meta_info); |
335 | - $message = $this->language->lang('DIR_VOTE_OK') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $meta_info . '">', '</a>'); |
|
335 | + $message = $this->language->lang('DIR_VOTE_OK').'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="'.$meta_info.'">', '</a>'); |
|
336 | 336 | return $this->helper->message($message); |
337 | 337 | } |
338 | 338 | |
@@ -357,18 +357,18 @@ discard block |
||
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 | |
369 | 369 | if (!function_exists('validate_data')) |
370 | 370 | { |
371 | - include($this->root_path . 'includes/functions_user.' . $this->php_ext); |
|
371 | + include($this->root_path.'includes/functions_user.'.$this->php_ext); |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | // We define variables to check |
@@ -391,17 +391,17 @@ discard block |
||
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 |
||
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, |
@@ -500,7 +500,7 @@ discard block |
||
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 | 502 | $message = ($need_approval) ? $this->language->lang('DIR_'.strtoupper($mode).'_SITE_ACTIVE') : $this->language->lang('DIR_'.strtoupper($mode).'_SITE_OK'); |
503 | - $message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_base_controller') . '">', '</a>') . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_CAT', '<a href="' . $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)) . '">', '</a>'); |
|
503 | + $message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_DIR', '<a href="'.$this->helper->route('ernadoo_phpbbdirectory_base_controller').'">', '</a>').'<br /><br />'.$this->language->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 | } |
506 | 506 | else |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | { |
530 | 530 | if (!function_exists('file_gc')) |
531 | 531 | { |
532 | - include($this->root_path . 'includes/functions_download.' . $this->php_ext); |
|
532 | + include($this->root_path.'includes/functions_download.'.$this->php_ext); |
|
533 | 533 | } |
534 | 534 | |
535 | 535 | $file_path = $this->get_banner_path($banner_img); |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | |
585 | 585 | if (!function_exists('display_custom_bbcodes')) |
586 | 586 | { |
587 | - include($this->root_path . 'includes/functions_display.' . $this->php_ext); |
|
587 | + include($this->root_path.'includes/functions_display.'.$this->php_ext); |
|
588 | 588 | } |
589 | 589 | display_custom_bbcodes(); |
590 | 590 | add_form_key('dir_form'); |
@@ -593,17 +593,17 @@ discard block |
||
593 | 593 | $flag_path = $ext_path.'images/flags/'; |
594 | 594 | |
595 | 595 | $s_guest = (!$this->user->data['is_registered'] || !empty($this->guest_email)); |
596 | - $s_rss = $this->config['dir_activ_rss']; |
|
597 | - $s_banner = $this->config['dir_activ_banner']; |
|
596 | + $s_rss = $this->config['dir_activ_rss']; |
|
597 | + $s_banner = $this->config['dir_activ_banner']; |
|
598 | 598 | $s_back = $this->categorie->data['cat_link_back']; |
599 | 599 | $s_flag = $this->config['dir_activ_flag']; |
600 | 600 | |
601 | 601 | $this->template->assign_vars(array( |
602 | - 'BBCODE_STATUS' => ($this->config['allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="' . append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode') . '">', '</a>'), |
|
603 | - 'IMG_STATUS' => ($this->config['allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), |
|
602 | + 'BBCODE_STATUS' => ($this->config['allow_bbcode']) ? $this->language->lang('BBCODE_IS_ON', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>') : $this->language->lang('BBCODE_IS_OFF', '<a href="'.append_sid($this->root_path."faq.$this->php_ext", 'mode=bbcode').'">', '</a>'), |
|
603 | + 'IMG_STATUS' => ($this->config['allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), |
|
604 | 604 | 'SMILIES_STATUS' => ($this->config['allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'), |
605 | 605 | 'URL_STATUS' => ($this->config['allow_post_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'), |
606 | - 'FLASH_STATUS' => ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), |
|
606 | + 'FLASH_STATUS' => ($this->config['allow_bbcode'] && $this->config['allow_post_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), |
|
607 | 607 | |
608 | 608 | 'L_TITLE' => $title, |
609 | 609 | 'L_DIR_DESCRIPTION_EXP' => $this->language->lang('DIR_DESCRIPTION_EXP', $this->config['dir_length_describe']), |
@@ -66,22 +66,22 @@ discard block |
||
66 | 66 | private $links_data; |
67 | 67 | |
68 | 68 | /** |
69 | - * Constructor |
|
70 | - * |
|
71 | - * @param \phpbb\config\config $config Config object |
|
72 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
73 | - * @param \phpbb\pagination $pagination Pagination object |
|
74 | - * @param \phpbb\language\language $language Language object |
|
75 | - * @param \phpbb\log\log $log Log object |
|
76 | - * @param \phpbb\notification\manager $notification Notification object |
|
77 | - * @param \phpbb\request\request $request Request object |
|
78 | - * @param \phpbb\template\template $template Template object |
|
79 | - * @param \phpbb\user $user User object |
|
80 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
81 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
82 | - * @param string $root_path phpBB root path |
|
83 | - * @param string $php_ext phpEx |
|
84 | - */ |
|
69 | + * Constructor |
|
70 | + * |
|
71 | + * @param \phpbb\config\config $config Config object |
|
72 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
73 | + * @param \phpbb\pagination $pagination Pagination object |
|
74 | + * @param \phpbb\language\language $language Language object |
|
75 | + * @param \phpbb\log\log $log Log object |
|
76 | + * @param \phpbb\notification\manager $notification Notification object |
|
77 | + * @param \phpbb\request\request $request Request object |
|
78 | + * @param \phpbb\template\template $template Template object |
|
79 | + * @param \phpbb\user $user User object |
|
80 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
81 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
82 | + * @param string $root_path phpBB root path |
|
83 | + * @param string $php_ext phpEx |
|
84 | + */ |
|
85 | 85 | public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\notification\manager $notification, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext) |
86 | 86 | { |
87 | 87 | $this->config = $config; |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
105 | - * Display confirm box |
|
106 | - * |
|
107 | - * @param array $mark Website selected for (dis)approval |
|
108 | - * @return null |
|
109 | - */ |
|
105 | + * Display confirm box |
|
106 | + * |
|
107 | + * @param array $mark Website selected for (dis)approval |
|
108 | + * @return null |
|
109 | + */ |
|
110 | 110 | public function display_confirm($mark) |
111 | 111 | { |
112 | 112 | $s_hidden_fields = array( |
@@ -118,10 +118,10 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * Display website list for (dis)approval |
|
122 | - * |
|
123 | - * @return null |
|
124 | - */ |
|
121 | + * Display website list for (dis)approval |
|
122 | + * |
|
123 | + * @return null |
|
124 | + */ |
|
125 | 125 | public function display_websites() |
126 | 126 | { |
127 | 127 | global $phpbb_admin_path; |
@@ -225,11 +225,11 @@ discard block |
||
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
228 | - * Get link's information and call appropriate action |
|
229 | - * |
|
230 | - * @param array $mark Website selected for (dis)approval |
|
231 | - * @return null |
|
232 | - */ |
|
228 | + * Get link's information and call appropriate action |
|
229 | + * |
|
230 | + * @param array $mark Website selected for (dis)approval |
|
231 | + * @return null |
|
232 | + */ |
|
233 | 233 | public function exec_action($mark) |
234 | 234 | { |
235 | 235 | $this->_get_infos_links($mark); |
@@ -252,10 +252,10 @@ discard block |
||
252 | 252 | } |
253 | 253 | |
254 | 254 | /** |
255 | - * Notify users which had submitted their websites |
|
256 | - * |
|
257 | - * @return null |
|
258 | - */ |
|
255 | + * Notify users which had submitted their websites |
|
256 | + * |
|
257 | + * @return null |
|
258 | + */ |
|
259 | 259 | public function notifiy_submiters() |
260 | 260 | { |
261 | 261 | if (!class_exists('messenger')) |
@@ -299,22 +299,22 @@ discard block |
||
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
302 | - * Set page url |
|
303 | - * |
|
304 | - * @param string $u_action Custom form action |
|
305 | - * @return null |
|
306 | - * @access public |
|
307 | - */ |
|
302 | + * Set page url |
|
303 | + * |
|
304 | + * @param string $u_action Custom form action |
|
305 | + * @return null |
|
306 | + * @access public |
|
307 | + */ |
|
308 | 308 | public function set_page_url($u_action) |
309 | 309 | { |
310 | 310 | $this->u_action = $u_action; |
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
314 | - * Approve action |
|
315 | - * |
|
316 | - * @return null |
|
317 | - */ |
|
314 | + * Approve action |
|
315 | + * |
|
316 | + * @return null |
|
317 | + */ |
|
318 | 318 | private function _action_approved() |
319 | 319 | { |
320 | 320 | foreach ($this->links_data as $row) |
@@ -343,10 +343,10 @@ discard block |
||
343 | 343 | } |
344 | 344 | |
345 | 345 | /** |
346 | - * Disapprove action |
|
347 | - * |
|
348 | - * @return null |
|
349 | - */ |
|
346 | + * Disapprove action |
|
347 | + * |
|
348 | + * @return null |
|
349 | + */ |
|
350 | 350 | private function _action_disapproved() |
351 | 351 | { |
352 | 352 | foreach ($this->links_data as $row) |
@@ -367,11 +367,11 @@ discard block |
||
367 | 367 | } |
368 | 368 | |
369 | 369 | /** |
370 | - * Get informations about links selected |
|
371 | - * |
|
372 | - * @param $mark Website selected for (dis)approval |
|
373 | - * @return null |
|
374 | - */ |
|
370 | + * Get informations about links selected |
|
371 | + * |
|
372 | + * @param $mark Website selected for (dis)approval |
|
373 | + * @return null |
|
374 | + */ |
|
375 | 375 | private function _get_infos_links($mark) |
376 | 376 | { |
377 | 377 | $sql_array = array( |
@@ -406,11 +406,11 @@ discard block |
||
406 | 406 | } |
407 | 407 | |
408 | 408 | /** |
409 | - * Notify users which watch categories |
|
410 | - * |
|
411 | - * @param $row Informations about website |
|
412 | - * @return null |
|
413 | - */ |
|
409 | + * Notify users which watch categories |
|
410 | + * |
|
411 | + * @param $row Informations about website |
|
412 | + * @return null |
|
413 | + */ |
|
414 | 414 | private function _notify_suscribers($row) |
415 | 415 | { |
416 | 416 | $notification_data = array( |
@@ -84,21 +84,21 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\notification\manager $notification, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link, $root_path, $php_ext) |
86 | 86 | { |
87 | - $this->config = $config; |
|
88 | - $this->db = $db; |
|
89 | - $this->pagination = $pagination; |
|
87 | + $this->config = $config; |
|
88 | + $this->db = $db; |
|
89 | + $this->pagination = $pagination; |
|
90 | 90 | $this->language = $language; |
91 | 91 | $this->phpbb_log = $log; |
92 | - $this->notification = $notification; |
|
93 | - $this->request = $request; |
|
92 | + $this->notification = $notification; |
|
93 | + $this->request = $request; |
|
94 | 94 | $this->template = $template; |
95 | 95 | $this->user = $user; |
96 | 96 | $this->categorie = $categorie; |
97 | 97 | $this->link = $link; |
98 | 98 | $this->root_path = $root_path; |
99 | - $this->php_ext = $php_ext; |
|
99 | + $this->php_ext = $php_ext; |
|
100 | 100 | |
101 | - $this->action = $this->request->variable('action', ''); |
|
101 | + $this->action = $this->request->variable('action', ''); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | global $phpbb_admin_path; |
128 | 128 | |
129 | 129 | // Sort keys |
130 | - $sort_days = $this->request->variable('st', 0); |
|
130 | + $sort_days = $this->request->variable('st', 0); |
|
131 | 131 | $sort_key = $this->request->variable('sk', 't'); |
132 | 132 | $sort_dir = $this->request->variable('sd', 'd'); |
133 | 133 | |
134 | 134 | // Number of entries to display |
135 | 135 | $per_page = $this->request->variable('links_per_page', (int) $this->config['dir_show']); |
136 | 136 | |
137 | - $start = $this->request->variable('start', 0); |
|
137 | + $start = $this->request->variable('start', 0); |
|
138 | 138 | |
139 | 139 | // Categorie ordering options |
140 | 140 | $limit_days = array(0 => $this->language->lang('SEE_ALL'), 1 => $this->language->lang('1_DAY'), 7 => $this->language->lang('7_DAYS'), 14 => $this->language->lang('2_WEEKS'), 30 => $this->language->lang('1_MONTH'), 90 => $this->language->lang('3_MONTHS'), 180 => $this->language->lang('6_MONTHS'), 365 => $this->language->lang('1_YEAR')); |
@@ -150,15 +150,15 @@ discard block |
||
150 | 150 | |
151 | 151 | if (is_array($sort_by_sql[$sort_key])) |
152 | 152 | { |
153 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
153 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
154 | 154 | } |
155 | 155 | else |
156 | 156 | { |
157 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
157 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | $sql = 'SELECT COUNT(1) AS total_links |
161 | - FROM ' . $this->links_table . ' |
|
161 | + FROM ' . $this->links_table.' |
|
162 | 162 | WHERE link_active = 0' . |
163 | 163 | (($sql_where) ? " AND link_time >= $sql_where" : ''); |
164 | 164 | $result = $this->db->sql_query($sql); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | 'ON' => 'u.user_id = l.link_user_id' |
183 | 183 | ) |
184 | 184 | ), |
185 | - 'WHERE' => 'l.link_active = 0' . (($sql_where) ? " AND l.link_time >= $sql_where" : ''), |
|
185 | + 'WHERE' => 'l.link_active = 0'.(($sql_where) ? " AND l.link_time >= $sql_where" : ''), |
|
186 | 186 | 'ORDER_BY' => $sql_sort_order); |
187 | 187 | |
188 | 188 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | $option_ary = array('approved' => 'DIR_LINK_ACTIVATE', 'disapproved' => 'DIR_LINK_DELETE'); |
211 | 211 | |
212 | - $base_url = $this->u_action . "&$u_sort_param&links_per_page=$per_page"; |
|
212 | + $base_url = $this->u_action."&$u_sort_param&links_per_page=$per_page"; |
|
213 | 213 | $this->pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_links, $per_page, $start); |
214 | 214 | |
215 | 215 | $this->template->assign_vars(array( |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | 'S_SORT_DIR' => $s_sort_dir, |
221 | 221 | 'LINKS_PER_PAGE' => $per_page, |
222 | 222 | |
223 | - 'U_ACTION' => $this->u_action . "&$u_sort_param&links_per_page=$per_page&start=$start", |
|
223 | + 'U_ACTION' => $this->u_action."&$u_sort_param&links_per_page=$per_page&start=$start", |
|
224 | 224 | )); |
225 | 225 | } |
226 | 226 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | return; |
249 | 249 | } |
250 | 250 | |
251 | - $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LINK_' . strtoupper($this->action), time(), array(implode(', ', $this->affected_link_name))); |
|
251 | + $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LINK_'.strtoupper($this->action), time(), array(implode(', ', $this->affected_link_name))); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | /** |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | { |
261 | 261 | if (!class_exists('messenger')) |
262 | 262 | { |
263 | - include($this->root_path . 'includes/functions_messenger.' . $this->php_ext); |
|
263 | + include($this->root_path.'includes/functions_messenger.'.$this->php_ext); |
|
264 | 264 | } |
265 | 265 | $messenger = new \messenger(false); |
266 | 266 | |
@@ -327,15 +327,15 @@ discard block |
||
327 | 327 | 'link_cat' => (int) $row['link_cat'], |
328 | 328 | ); |
329 | 329 | |
330 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
331 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
330 | + $sql = 'UPDATE '.$this->links_table.' |
|
331 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
332 | 332 | WHERE link_id = ' . (int) $row['link_id']; |
333 | 333 | $this->db->sql_query($sql); |
334 | 334 | } |
335 | 335 | |
336 | 336 | foreach ($this->cat_data as $cat_id => $count) |
337 | 337 | { |
338 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
338 | + $sql = 'UPDATE '.$this->categories_table.' |
|
339 | 339 | SET cat_links = cat_links + '.$count.' |
340 | 340 | WHERE cat_id = ' . (int) $cat_id; |
341 | 341 | $this->db->sql_query($sql); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | } |
362 | 362 | } |
363 | 363 | |
364 | - $sql = 'DELETE FROM ' . $this->links_table . ' WHERE link_id = ' . (int) $row['link_id']; |
|
364 | + $sql = 'DELETE FROM '.$this->links_table.' WHERE link_id = '.(int) $row['link_id']; |
|
365 | 365 | $this->db->sql_query($sql); |
366 | 366 | } |
367 | 367 | } |
@@ -69,19 +69,19 @@ discard block |
||
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 |
||
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; |
@@ -142,10 +142,10 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
145 | - * Display deleting page |
|
146 | - * |
|
147 | - * @return null |
|
148 | - */ |
|
145 | + * Display deleting page |
|
146 | + * |
|
147 | + * @return null |
|
148 | + */ |
|
149 | 149 | public function action_delete() |
150 | 150 | { |
151 | 151 | if (!$this->cat_id) |
@@ -196,10 +196,10 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
199 | - * Initialize data for edit page |
|
200 | - * |
|
201 | - * @return null |
|
202 | - */ |
|
199 | + * Initialize data for edit page |
|
200 | + * |
|
201 | + * @return null |
|
202 | + */ |
|
203 | 203 | public function action_edit() |
204 | 204 | { |
205 | 205 | $row = $this->_get_cat_info($this->cat_id); |
@@ -226,10 +226,10 @@ discard block |
||
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
229 | - * Move order categories |
|
230 | - * |
|
231 | - * @return null |
|
232 | - */ |
|
229 | + * Move order categories |
|
230 | + * |
|
231 | + * @return null |
|
232 | + */ |
|
233 | 233 | public function action_move() |
234 | 234 | { |
235 | 235 | if (!$this->cat_id) |
@@ -272,10 +272,10 @@ discard block |
||
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
275 | - * Display progress bar for syncinc categories |
|
276 | - * |
|
277 | - * @return null |
|
278 | - */ |
|
275 | + * Display progress bar for syncinc categories |
|
276 | + * |
|
277 | + * @return null |
|
278 | + */ |
|
279 | 279 | public function action_progress_bar() |
280 | 280 | { |
281 | 281 | $start = $this->request->variable('start', 0); |
@@ -296,10 +296,10 @@ discard block |
||
296 | 296 | } |
297 | 297 | |
298 | 298 | /** |
299 | - * Get link's ID interval for _sync_dir_links() |
|
300 | - * |
|
301 | - * @return null |
|
302 | - */ |
|
299 | + * Get link's ID interval for _sync_dir_links() |
|
300 | + * |
|
301 | + * @return null |
|
302 | + */ |
|
303 | 303 | public function action_sync() |
304 | 304 | { |
305 | 305 | if (!$this->cat_id) |
@@ -383,10 +383,10 @@ discard block |
||
383 | 383 | } |
384 | 384 | |
385 | 385 | /** |
386 | - * Sync category data |
|
387 | - * |
|
388 | - * @return null |
|
389 | - */ |
|
386 | + * Sync category data |
|
387 | + * |
|
388 | + * @return null |
|
389 | + */ |
|
390 | 390 | public function action_sync_cat() |
391 | 391 | { |
392 | 392 | $sql = 'SELECT cat_name |
@@ -410,10 +410,10 @@ discard block |
||
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
413 | - * Display categories page |
|
414 | - * |
|
415 | - * @return null |
|
416 | - */ |
|
413 | + * Display categories page |
|
414 | + * |
|
415 | + * @return null |
|
416 | + */ |
|
417 | 417 | public function display_cats() |
418 | 418 | { |
419 | 419 | // Default management page |
@@ -508,22 +508,22 @@ discard block |
||
508 | 508 | } |
509 | 509 | |
510 | 510 | /** |
511 | - * Set page url |
|
512 | - * |
|
513 | - * @param string $u_action Custom form action |
|
514 | - * @return null |
|
515 | - * @access public |
|
516 | - */ |
|
511 | + * Set page url |
|
512 | + * |
|
513 | + * @param string $u_action Custom form action |
|
514 | + * @return null |
|
515 | + * @access public |
|
516 | + */ |
|
517 | 517 | public function set_page_url($u_action) |
518 | 518 | { |
519 | 519 | $this->u_action = $u_action; |
520 | 520 | } |
521 | 521 | |
522 | 522 | /** |
523 | - * Update cat table |
|
524 | - * |
|
525 | - * @return null |
|
526 | - */ |
|
523 | + * Update cat table |
|
524 | + * |
|
525 | + * @return null |
|
526 | + */ |
|
527 | 527 | public function update() |
528 | 528 | { |
529 | 529 | if (!check_form_key($this->form_key)) |
@@ -617,11 +617,11 @@ discard block |
||
617 | 617 | } |
618 | 618 | |
619 | 619 | /** |
620 | - * Display form |
|
621 | - * |
|
622 | - * @param string $parents_list Drop-down list |
|
623 | - * @return null |
|
624 | - */ |
|
620 | + * Display form |
|
621 | + * |
|
622 | + * @param string $parents_list Drop-down list |
|
623 | + * @return null |
|
624 | + */ |
|
625 | 625 | private function _display_cat_form($parents_list) |
626 | 626 | { |
627 | 627 | $dir_cat_desc_data = array( |
@@ -691,11 +691,11 @@ discard block |
||
691 | 691 | } |
692 | 692 | |
693 | 693 | /** |
694 | - * Get category details |
|
695 | - * |
|
696 | - * @param int $cat_id The category ID |
|
697 | - * @return array |
|
698 | - */ |
|
694 | + * Get category details |
|
695 | + * |
|
696 | + * @param int $cat_id The category ID |
|
697 | + * @return array |
|
698 | + */ |
|
699 | 699 | private function _get_cat_info($cat_id) |
700 | 700 | { |
701 | 701 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, 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 |
@@ -714,10 +714,10 @@ discard block |
||
714 | 714 | } |
715 | 715 | |
716 | 716 | /** |
717 | - * Update category data |
|
718 | - * |
|
719 | - * @return array |
|
720 | - */ |
|
717 | + * Update category data |
|
718 | + * |
|
719 | + * @return array |
|
720 | + */ |
|
721 | 721 | private function _update_cat_data() |
722 | 722 | { |
723 | 723 | if (!$this->cat_data['cat_name']) |
@@ -811,14 +811,14 @@ discard block |
||
811 | 811 | } |
812 | 812 | |
813 | 813 | /** |
814 | - * Remove complete category |
|
815 | - * |
|
816 | - * @param string $action_links Action for categories links |
|
817 | - * @param string $action_subcats Action for sub-categories |
|
818 | - * @param int $links_to_id New category ID for links |
|
819 | - * @param int $subcats_to_id New category ID for sub-categories |
|
820 | - * @return array |
|
821 | - */ |
|
814 | + * Remove complete category |
|
815 | + * |
|
816 | + * @param string $action_links Action for categories links |
|
817 | + * @param string $action_subcats Action for sub-categories |
|
818 | + * @param int $links_to_id New category ID for links |
|
819 | + * @param int $subcats_to_id New category ID for sub-categories |
|
820 | + * @return array |
|
821 | + */ |
|
822 | 822 | private function _delete_cat($action_links = 'delete', $action_subcats = 'delete', $links_to_id = 0, $subcats_to_id = 0) |
823 | 823 | { |
824 | 824 | $this->cat_data = $this->_get_cat_info($this->cat_id); |
@@ -935,12 +935,12 @@ discard block |
||
935 | 935 | } |
936 | 936 | |
937 | 937 | /** |
938 | - * Move category content from one to another forum |
|
939 | - * |
|
940 | - * @param int $from_id |
|
941 | - * @param int $to_id |
|
942 | - * @return null |
|
943 | - */ |
|
938 | + * Move category content from one to another forum |
|
939 | + * |
|
940 | + * @param int $from_id |
|
941 | + * @param int $to_id |
|
942 | + * @return null |
|
943 | + */ |
|
944 | 944 | private function _move_cat_content($from_id, $to_id) |
945 | 945 | { |
946 | 946 | $sql = 'UPDATE ' . $this->links_table . ' |
@@ -956,10 +956,10 @@ discard block |
||
956 | 956 | } |
957 | 957 | |
958 | 958 | /** |
959 | - * Delete category content |
|
960 | - * |
|
961 | - * @return array |
|
962 | - */ |
|
959 | + * Delete category content |
|
960 | + * |
|
961 | + * @return array |
|
962 | + */ |
|
963 | 963 | private function _delete_cat_content() |
964 | 964 | { |
965 | 965 | $this->db->sql_transaction('begin'); |
@@ -1018,11 +1018,11 @@ discard block |
||
1018 | 1018 | } |
1019 | 1019 | |
1020 | 1020 | /** |
1021 | - * Update links counter |
|
1022 | - * |
|
1023 | - * @param int $cat_id The category ID |
|
1024 | - * @return null |
|
1025 | - */ |
|
1021 | + * Update links counter |
|
1022 | + * |
|
1023 | + * @param int $cat_id The category ID |
|
1024 | + * @return null |
|
1025 | + */ |
|
1026 | 1026 | private function _sync_dir_cat($cat_id) |
1027 | 1027 | { |
1028 | 1028 | $sql = 'SELECT COUNT(link_id) AS num_links |
@@ -1040,12 +1040,12 @@ discard block |
||
1040 | 1040 | } |
1041 | 1041 | |
1042 | 1042 | /** |
1043 | - * Update link data (note, vote, comment) |
|
1044 | - * |
|
1045 | - * @param int $start |
|
1046 | - * @param int $stop |
|
1047 | - * @return null |
|
1048 | - */ |
|
1043 | + * Update link data (note, vote, comment) |
|
1044 | + * |
|
1045 | + * @param int $start |
|
1046 | + * @param int $stop |
|
1047 | + * @return null |
|
1048 | + */ |
|
1049 | 1049 | private function _sync_dir_links($start, $stop) |
1050 | 1050 | { |
1051 | 1051 | $sql_ary = array( |
@@ -1088,12 +1088,12 @@ discard block |
||
1088 | 1088 | } |
1089 | 1089 | |
1090 | 1090 | /** |
1091 | - * Display icons drop-down list |
|
1092 | - * |
|
1093 | - * @param string $icons_path |
|
1094 | - * @param string $img_selected |
|
1095 | - * @return string |
|
1096 | - */ |
|
1091 | + * Display icons drop-down list |
|
1092 | + * |
|
1093 | + * @param string $icons_path |
|
1094 | + * @param string $img_selected |
|
1095 | + * @return string |
|
1096 | + */ |
|
1097 | 1097 | private function _get_dir_icon_list($icons_path, $img_selected) |
1098 | 1098 | { |
1099 | 1099 | $imglist = filelist($icons_path, ''); |
@@ -84,23 +84,23 @@ discard block |
||
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 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | if (!$this->cat_id) |
152 | 152 | { |
153 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
153 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | $this->cat_data = $this->_get_cat_info($this->cat_id); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $cat_list = $this->categorie->make_cat_select((int) $this->cat_data['parent_id'], $subcats_id); |
167 | 167 | |
168 | 168 | $sql = 'SELECT cat_id |
169 | - FROM ' . $this->categories_table . ' |
|
169 | + FROM ' . $this->categories_table.' |
|
170 | 170 | WHERE cat_id <> ' . (int) $this->cat_id; |
171 | 171 | $result = $this->db->sql_query_limit($sql, 1); |
172 | 172 | |
@@ -182,8 +182,8 @@ discard block |
||
182 | 182 | |
183 | 183 | $this->template->assign_vars(array( |
184 | 184 | 'S_DELETE_DIR_CAT' => true, |
185 | - 'U_ACTION' => $this->u_action . "&parent_id={$parent_id}&action=delete&c=$this->cat_id", |
|
186 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
185 | + 'U_ACTION' => $this->u_action."&parent_id={$parent_id}&action=delete&c=$this->cat_id", |
|
186 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id, |
|
187 | 187 | |
188 | 188 | 'DIR_CAT_NAME' => $this->cat_data['cat_name'], |
189 | 189 | 'S_HAS_SUBCATS' => ($this->cat_data['right_id'] - $this->cat_data['left_id'] > 1) ? true : false, |
@@ -234,11 +234,11 @@ discard block |
||
234 | 234 | { |
235 | 235 | if (!$this->cat_id) |
236 | 236 | { |
237 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
237 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
241 | - FROM ' . $this->categories_table . ' |
|
241 | + FROM ' . $this->categories_table.' |
|
242 | 242 | WHERE cat_id = ' . (int) $this->cat_id; |
243 | 243 | $result = $this->db->sql_query($sql); |
244 | 244 | $row = $this->db->sql_fetchrow($result); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | if (!$row) |
248 | 248 | { |
249 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
249 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | try |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | if ($move_cat_name !== false) |
262 | 262 | { |
263 | - $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)); |
|
263 | + $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 | 264 | $this->cache->destroy('sql', $this->categories_table); |
265 | 265 | } |
266 | 266 | |
@@ -304,13 +304,13 @@ discard block |
||
304 | 304 | { |
305 | 305 | if (!$this->cat_id) |
306 | 306 | { |
307 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
307 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | @set_time_limit(0); |
311 | 311 | |
312 | 312 | $sql = 'SELECT cat_name, cat_links |
313 | - FROM ' . $this->categories_table . ' |
|
313 | + FROM ' . $this->categories_table.' |
|
314 | 314 | WHERE cat_id = ' . (int) $this->cat_id; |
315 | 315 | $result = $this->db->sql_query($sql); |
316 | 316 | $row = $this->db->sql_fetchrow($result); |
@@ -318,12 +318,12 @@ discard block |
||
318 | 318 | |
319 | 319 | if (!$row) |
320 | 320 | { |
321 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
321 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | $sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id |
325 | - FROM ' . $this->links_table . ' |
|
326 | - WHERE link_cat = ' . (int) $this->cat_id . ' |
|
325 | + FROM ' . $this->links_table.' |
|
326 | + WHERE link_cat = ' . (int) $this->cat_id.' |
|
327 | 327 | AND link_active = 1'; |
328 | 328 | $result = $this->db->sql_query($sql); |
329 | 329 | $row2 = $this->db->sql_fetchrow($result); |
@@ -345,23 +345,23 @@ discard block |
||
345 | 345 | { |
346 | 346 | // We really need to find a way of showing statistics... no progress here |
347 | 347 | $sql = 'SELECT COUNT(link_id) as num_links |
348 | - FROM ' . $this->links_table . ' |
|
349 | - WHERE link_cat = ' . (int) $this->cat_id . ' |
|
348 | + FROM ' . $this->links_table.' |
|
349 | + WHERE link_cat = ' . (int) $this->cat_id.' |
|
350 | 350 | AND link_active = 1 |
351 | - AND link_id BETWEEN ' . $start . ' AND ' . $end; |
|
351 | + AND link_id BETWEEN ' . $start.' AND '.$end; |
|
352 | 352 | $result = $this->db->sql_query($sql); |
353 | 353 | $links_done = $this->request->variable('links_done', 0) + (int) $this->db->sql_fetchfield('num_links'); |
354 | 354 | $this->db->sql_freeresult($result); |
355 | 355 | |
356 | 356 | $start += $batch_size; |
357 | 357 | |
358 | - $url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; |
|
358 | + $url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync&start=$start&links_done=$links_done&total={$row['cat_links']}"; |
|
359 | 359 | |
360 | 360 | meta_refresh(0, $url); |
361 | 361 | |
362 | 362 | $this->template->assign_vars(array( |
363 | - 'U_PROGRESS_BAR' => $this->u_action . "&action=progress_bar&start=$links_done&total={$row['cat_links']}", |
|
364 | - 'UA_PROGRESS_BAR' => addslashes($this->u_action . "&action=progress_bar&start=$links_done&total={$row['cat_links']}"), |
|
363 | + 'U_PROGRESS_BAR' => $this->u_action."&action=progress_bar&start=$links_done&total={$row['cat_links']}", |
|
364 | + 'UA_PROGRESS_BAR' => addslashes($this->u_action."&action=progress_bar&start=$links_done&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,12 +369,12 @@ discard block |
||
369 | 369 | return; |
370 | 370 | } |
371 | 371 | |
372 | - $url = $this->u_action . "&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; |
|
372 | + $url = $this->u_action."&parent_id={$this->parent_id}&c=$this->cat_id&action=sync_cat"; |
|
373 | 373 | meta_refresh(0, $url); |
374 | 374 | |
375 | 375 | $this->template->assign_vars(array( |
376 | - 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', |
|
377 | - 'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'), |
|
376 | + 'U_PROGRESS_BAR' => $this->u_action.'&action=progress_bar', |
|
377 | + 'UA_PROGRESS_BAR' => addslashes($this->u_action.'&action=progress_bar'), |
|
378 | 378 | 'S_CONTINUE_SYNC' => true, |
379 | 379 | 'L_PROGRESS_EXPLAIN' => $this->language->lang('SYNC_IN_PROGRESS_EXPLAIN', 0, $row['cat_links'])) |
380 | 380 | ); |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | public function action_sync_cat() |
391 | 391 | { |
392 | 392 | $sql = 'SELECT cat_name |
393 | - FROM ' . $this->categories_table . ' |
|
393 | + FROM ' . $this->categories_table.' |
|
394 | 394 | WHERE cat_id = ' . (int) $this->cat_id; |
395 | 395 | $result = $this->db->sql_query($sql); |
396 | 396 | $row = $this->db->sql_fetchrow($result); |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | |
399 | 399 | if (!$row) |
400 | 400 | { |
401 | - trigger_error($this->language->lang('DIR_NO_CAT') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); |
|
401 | + trigger_error($this->language->lang('DIR_NO_CAT').adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | $this->_sync_dir_cat($this->cat_id); |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | } |
424 | 424 | else |
425 | 425 | { |
426 | - $navigation = '<a href="' . $this->u_action . '">' . $this->language->lang('DIR_INDEX') . '</a>'; |
|
426 | + $navigation = '<a href="'.$this->u_action.'">'.$this->language->lang('DIR_INDEX').'</a>'; |
|
427 | 427 | |
428 | 428 | $cats_nav = $this->nestedset_category->get_path_data($this->parent_id); |
429 | 429 | |
@@ -431,11 +431,11 @@ discard block |
||
431 | 431 | { |
432 | 432 | if ($row['cat_id'] == $this->parent_id) |
433 | 433 | { |
434 | - $navigation .= ' -> ' . $row['cat_name']; |
|
434 | + $navigation .= ' -> '.$row['cat_name']; |
|
435 | 435 | } |
436 | 436 | else |
437 | 437 | { |
438 | - $navigation .= ' -> <a href="' . $this->u_action . '&parent_id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a>'; |
|
438 | + $navigation .= ' -> <a href="'.$this->u_action.'&parent_id='.$row['cat_id'].'">'.$row['cat_name'].'</a>'; |
|
439 | 439 | } |
440 | 440 | } |
441 | 441 | } |
@@ -449,8 +449,8 @@ discard block |
||
449 | 449 | } |
450 | 450 | |
451 | 451 | $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 |
452 | - FROM ' . $this->categories_table . ' |
|
453 | - WHERE parent_id = ' . (int) $this->parent_id . ' |
|
452 | + FROM ' . $this->categories_table.' |
|
453 | + WHERE parent_id = ' . (int) $this->parent_id.' |
|
454 | 454 | ORDER BY left_id'; |
455 | 455 | $result = $this->db->sql_query($sql); |
456 | 456 | |
@@ -458,23 +458,23 @@ discard block |
||
458 | 458 | { |
459 | 459 | do |
460 | 460 | { |
461 | - $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 | + $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').'" />'; |
|
462 | 462 | |
463 | - $url = $this->u_action . "&parent_id=$this->parent_id&c={$row['cat_id']}"; |
|
463 | + $url = $this->u_action."&parent_id=$this->parent_id&c={$row['cat_id']}"; |
|
464 | 464 | |
465 | 465 | $this->template->assign_block_vars('cats', array( |
466 | 466 | 'FOLDER_IMAGE' => $folder_image, |
467 | - 'CAT_IMAGE' => ($row['cat_icon']) ? '<img src="' . $this->get_img_path('icons', $row['cat_icon']) . '" alt="" />' : '', |
|
467 | + 'CAT_IMAGE' => ($row['cat_icon']) ? '<img src="'.$this->get_img_path('icons', $row['cat_icon']).'" alt="" />' : '', |
|
468 | 468 | 'CAT_NAME' => $row['cat_name'], |
469 | 469 | 'CAT_DESCRIPTION' => generate_text_for_display($row['cat_desc'], $row['cat_desc_uid'], $row['cat_desc_bitfield'], $row['cat_desc_options']), |
470 | 470 | 'CAT_LINKS' => $row['cat_links'], |
471 | 471 | |
472 | - 'U_CAT' => $this->u_action . '&parent_id=' . $row['cat_id'], |
|
473 | - 'U_MOVE_UP' => $url . '&action=move_up', |
|
474 | - 'U_MOVE_DOWN' => $url . '&action=move_down', |
|
475 | - 'U_EDIT' => $url . '&action=edit', |
|
476 | - 'U_DELETE' => $url . '&action=delete', |
|
477 | - 'U_SYNC' => $url . '&action=sync') |
|
472 | + 'U_CAT' => $this->u_action.'&parent_id='.$row['cat_id'], |
|
473 | + 'U_MOVE_UP' => $url.'&action=move_up', |
|
474 | + 'U_MOVE_DOWN' => $url.'&action=move_down', |
|
475 | + 'U_EDIT' => $url.'&action=edit', |
|
476 | + 'U_DELETE' => $url.'&action=delete', |
|
477 | + 'U_SYNC' => $url.'&action=sync') |
|
478 | 478 | ); |
479 | 479 | } |
480 | 480 | while ($row = $this->db->sql_fetchrow($result)); |
@@ -483,14 +483,14 @@ discard block |
||
483 | 483 | { |
484 | 484 | $row = $this->_get_cat_info($this->parent_id); |
485 | 485 | |
486 | - $url = $this->u_action . '&parent_id=' . $this->parent_id . '&c=' . $row['cat_id']; |
|
486 | + $url = $this->u_action.'&parent_id='.$this->parent_id.'&c='.$row['cat_id']; |
|
487 | 487 | |
488 | 488 | $this->template->assign_vars(array( |
489 | 489 | 'S_NO_CATS' => true, |
490 | 490 | |
491 | - 'U_EDIT' => $url . '&action=edit', |
|
492 | - 'U_DELETE' => $url . '&action=delete', |
|
493 | - 'U_SYNC' => $url . '&action=sync') |
|
491 | + 'U_EDIT' => $url.'&action=edit', |
|
492 | + 'U_DELETE' => $url.'&action=delete', |
|
493 | + 'U_SYNC' => $url.'&action=sync') |
|
494 | 494 | ); |
495 | 495 | } |
496 | 496 | $this->db->sql_freeresult($result); |
@@ -500,10 +500,10 @@ discard block |
||
500 | 500 | 'NAVIGATION' => $navigation, |
501 | 501 | 'CAT_BOX' => $cat_box, |
502 | 502 | 'U_SEL_ACTION' => $this->u_action, |
503 | - 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
503 | + 'U_ACTION' => $this->u_action.'&parent_id='.$this->parent_id, |
|
504 | 504 | |
505 | - 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', |
|
506 | - 'UA_PROGRESS_BAR' => addslashes($this->u_action . '&action=progress_bar'), |
|
505 | + 'U_PROGRESS_BAR' => $this->u_action.'&action=progress_bar', |
|
506 | + 'UA_PROGRESS_BAR' => addslashes($this->u_action.'&action=progress_bar'), |
|
507 | 507 | )); |
508 | 508 | } |
509 | 509 | |
@@ -535,10 +535,10 @@ discard block |
||
535 | 535 | switch ($this->action) |
536 | 536 | { |
537 | 537 | case 'delete': |
538 | - $action_subcats = $this->request->variable('action_subcats', ''); |
|
539 | - $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
540 | - $action_links = $this->request->variable('action_links', ''); |
|
541 | - $links_to_id = $this->request->variable('links_to_id', 0); |
|
538 | + $action_subcats = $this->request->variable('action_subcats', ''); |
|
539 | + $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
540 | + $action_links = $this->request->variable('action_links', ''); |
|
541 | + $links_to_id = $this->request->variable('links_to_id', 0); |
|
542 | 542 | |
543 | 543 | try |
544 | 544 | { |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | |
557 | 557 | $this->cache->destroy('sql', $this->categories_table); |
558 | 558 | |
559 | - trigger_error($this->language->lang('DIR_CAT_DELETED') . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); |
|
559 | + trigger_error($this->language->lang('DIR_CAT_DELETED').adm_back_link($this->u_action.'&parent_id='.$this->parent_id)); |
|
560 | 560 | |
561 | 561 | break; |
562 | 562 | |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | |
610 | 610 | $message = ($this->action == 'add') ? $this->language->lang('DIR_CAT_CREATED') : $this->language->lang('DIR_CAT_UPDATED'); |
611 | 611 | |
612 | - trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); |
|
612 | + trigger_error($message.adm_back_link($this->u_action.'&parent_id='.$this->parent_id)); |
|
613 | 613 | } |
614 | 614 | |
615 | 615 | break; |
@@ -654,10 +654,10 @@ discard block |
||
654 | 654 | 'S_CAT_PARENT_ID' => $this->cat_data['parent_id'], |
655 | 655 | 'S_ADD_ACTION' => ($this->action == 'add') ? true : false, |
656 | 656 | |
657 | - 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, |
|
658 | - 'U_EDIT_ACTION' => $this->u_action . "&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", |
|
657 | + 'U_BACK' => $this->u_action.'&parent_id='.$this->parent_id, |
|
658 | + 'U_EDIT_ACTION' => $this->u_action."&parent_id={$this->parent_id}&action=$this->action&c=$this->cat_id", |
|
659 | 659 | |
660 | - 'L_TITLE' => $this->language->lang('DIR_' . strtoupper($this->action) . '_CAT'), |
|
660 | + 'L_TITLE' => $this->language->lang('DIR_'.strtoupper($this->action).'_CAT'), |
|
661 | 661 | 'ERROR_MSG' => (sizeof($this->errors)) ? implode('<br />', $this->errors) : '', |
662 | 662 | 'ICON_IMAGE' => ($this->cat_data['cat_icon']) ? $this->get_img_path('icons', $this->cat_data['cat_icon']) : 'images/spacer.gif', |
663 | 663 | |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | private function _get_cat_info($cat_id) |
700 | 700 | { |
701 | 701 | $sql = 'SELECT cat_id, parent_id, right_id, left_id, cat_desc, cat_desc_uid, cat_desc_options, cat_icon, cat_name, 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 |
702 | - FROM ' . $this->categories_table . ' |
|
702 | + FROM ' . $this->categories_table.' |
|
703 | 703 | WHERE cat_id = ' . (int) $cat_id; |
704 | 704 | $result = $this->db->sql_query($sql); |
705 | 705 | $row = $this->db->sql_fetchrow($result); |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | { |
763 | 763 | if ($cat_data_sql['cat_cron_enable']) |
764 | 764 | { |
765 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
765 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
766 | 766 | } |
767 | 767 | |
768 | 768 | $this->cat_data = $this->nestedset_category->insert($cat_data_sql); |
@@ -785,13 +785,13 @@ discard block |
||
785 | 785 | |
786 | 786 | if ($cat_data_sql['cat_cron_enable'] && ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable'])) |
787 | 787 | { |
788 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
788 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
789 | 789 | } |
790 | 790 | |
791 | 791 | if ($row['cat_name'] != $cat_data_sql['cat_name']) |
792 | 792 | { |
793 | 793 | // the cat name has changed, clear the parents list of all categories (for safety) |
794 | - $sql = 'UPDATE ' . $this->categories_table . " |
|
794 | + $sql = 'UPDATE '.$this->categories_table." |
|
795 | 795 | SET cat_parents = ''"; |
796 | 796 | $this->db->sql_query($sql); |
797 | 797 | } |
@@ -799,8 +799,8 @@ discard block |
||
799 | 799 | // Setting the cat id to the categorie id is not really received well by some dbs. ;) |
800 | 800 | unset($cat_data_sql['cat_id']); |
801 | 801 | |
802 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
803 | - SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql) . ' |
|
802 | + $sql = 'UPDATE '.$this->categories_table.' |
|
803 | + SET ' . $this->db->sql_build_array('UPDATE', $cat_data_sql).' |
|
804 | 804 | WHERE cat_id = ' . (int) $this->cat_id; |
805 | 805 | $this->db->sql_query($sql); |
806 | 806 | |
@@ -841,7 +841,7 @@ discard block |
||
841 | 841 | $log_action_links = 'MOVE_LINKS'; |
842 | 842 | |
843 | 843 | $sql = 'SELECT cat_name |
844 | - FROM ' . $this->categories_table . ' |
|
844 | + FROM ' . $this->categories_table.' |
|
845 | 845 | WHERE cat_id = ' . (int) $links_to_id; |
846 | 846 | $result = $this->db->sql_query($sql); |
847 | 847 | $row = $this->db->sql_fetchrow($result); |
@@ -943,12 +943,12 @@ discard block |
||
943 | 943 | */ |
944 | 944 | private function _move_cat_content($from_id, $to_id) |
945 | 945 | { |
946 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
947 | - SET link_cat = ' . (int) $to_id . ' |
|
946 | + $sql = 'UPDATE '.$this->links_table.' |
|
947 | + SET link_cat = ' . (int) $to_id.' |
|
948 | 948 | WHERE link_cat = ' . (int) $from_id; |
949 | 949 | $this->db->sql_query($sql); |
950 | 950 | |
951 | - $sql = 'DELETE FROM ' . $this->watch_table . ' |
|
951 | + $sql = 'DELETE FROM '.$this->watch_table.' |
|
952 | 952 | WHERE cat_id = ' . (int) $from_id; |
953 | 953 | $this->db->sql_query($sql); |
954 | 954 | |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | |
967 | 967 | // Before we remove anything we make sure we are able to adjust the post counts later. ;) |
968 | 968 | $sql = 'SELECT link_id, link_banner |
969 | - FROM ' . $this->links_table . ' |
|
969 | + FROM ' . $this->links_table.' |
|
970 | 970 | WHERE link_cat = ' . (int) $this->cat_id; |
971 | 971 | $result = $this->db->sql_query($sql); |
972 | 972 | |
@@ -997,7 +997,7 @@ discard block |
||
997 | 997 | |
998 | 998 | foreach ($link_datas_ary as $table => $field) |
999 | 999 | { |
1000 | - $this->db->sql_query("DELETE FROM $table WHERE " . $this->db->sql_in_set($field, $link_ids)); |
|
1000 | + $this->db->sql_query("DELETE FROM $table WHERE ".$this->db->sql_in_set($field, $link_ids)); |
|
1001 | 1001 | } |
1002 | 1002 | } |
1003 | 1003 | |
@@ -1009,7 +1009,7 @@ discard block |
||
1009 | 1009 | |
1010 | 1010 | foreach ($cat_datas_ary as $table => $field) |
1011 | 1011 | { |
1012 | - $this->db->sql_query("DELETE FROM $table WHERE $field = " . (int) $this->cat_id); |
|
1012 | + $this->db->sql_query("DELETE FROM $table WHERE $field = ".(int) $this->cat_id); |
|
1013 | 1013 | } |
1014 | 1014 | |
1015 | 1015 | $this->db->sql_transaction('commit'); |
@@ -1026,15 +1026,15 @@ discard block |
||
1026 | 1026 | private function _sync_dir_cat($cat_id) |
1027 | 1027 | { |
1028 | 1028 | $sql = 'SELECT COUNT(link_id) AS num_links |
1029 | - FROM ' . $this->links_table . ' |
|
1030 | - WHERE link_cat = ' . (int) $cat_id . ' |
|
1029 | + FROM ' . $this->links_table.' |
|
1030 | + WHERE link_cat = ' . (int) $cat_id.' |
|
1031 | 1031 | AND link_active = 1'; |
1032 | 1032 | $result = $this->db->sql_query($sql); |
1033 | 1033 | $total_links = (int) $this->db->sql_fetchfield('num_links'); |
1034 | 1034 | $this->db->sql_freeresult($result); |
1035 | 1035 | |
1036 | - $sql = 'UPDATE ' . $this->categories_table . ' |
|
1037 | - SET cat_links = ' . $total_links . ' |
|
1036 | + $sql = 'UPDATE '.$this->categories_table.' |
|
1037 | + SET cat_links = ' . $total_links.' |
|
1038 | 1038 | WHERE cat_id = ' . (int) $cat_id; |
1039 | 1039 | $this->db->sql_query($sql); |
1040 | 1040 | } |
@@ -1054,33 +1054,33 @@ discard block |
||
1054 | 1054 | 'link_vote' => 0, |
1055 | 1055 | ); |
1056 | 1056 | |
1057 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
1058 | - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
1059 | - WHERE link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop; |
|
1057 | + $sql = 'UPDATE '.$this->links_table.' |
|
1058 | + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary).' |
|
1059 | + WHERE link_id BETWEEN ' . (int) $start.' AND '.(int) $stop; |
|
1060 | 1060 | $this->db->sql_query($sql); |
1061 | 1061 | |
1062 | - $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM ' . $this->votes_table . ' |
|
1063 | - WHERE vote_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . ' |
|
1062 | + $sql = 'SELECT vote_link_id, COUNT(vote_note) AS nb_vote, SUM(vote_note) AS total FROM '.$this->votes_table.' |
|
1063 | + WHERE vote_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.' |
|
1064 | 1064 | GROUP BY vote_link_id'; |
1065 | 1065 | $result = $this->db->sql_query($sql); |
1066 | 1066 | while ($tmp = $this->db->sql_fetchrow($result)) |
1067 | 1067 | { |
1068 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
1069 | - SET link_note = ' . (int) $tmp['total'] . ', link_vote = ' . (int) $tmp['nb_vote'] . ' |
|
1068 | + $sql = 'UPDATE '.$this->links_table.' |
|
1069 | + SET link_note = ' . (int) $tmp['total'].', link_vote = '.(int) $tmp['nb_vote'].' |
|
1070 | 1070 | WHERE link_id = ' . (int) $tmp['vote_link_id']; |
1071 | 1071 | $this->db->sql_query($sql); |
1072 | 1072 | } |
1073 | 1073 | $this->db->sql_freeresult($result); |
1074 | 1074 | |
1075 | 1075 | $sql = 'SELECT comment_link_id, COUNT(comment_id) AS nb_comment |
1076 | - FROM ' . $this->comments_table . ' |
|
1077 | - WHERE comment_link_id BETWEEN ' . (int) $start . ' AND ' . (int) $stop . ' |
|
1076 | + FROM ' . $this->comments_table.' |
|
1077 | + WHERE comment_link_id BETWEEN ' . (int) $start.' AND '.(int) $stop.' |
|
1078 | 1078 | GROUP BY comment_link_id'; |
1079 | 1079 | $result = $this->db->sql_query($sql); |
1080 | 1080 | while ($tmp = $this->db->sql_fetchrow($result)) |
1081 | 1081 | { |
1082 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
1083 | - SET link_comment = ' . (int) $tmp['nb_comment'] . ' |
|
1082 | + $sql = 'UPDATE '.$this->links_table.' |
|
1083 | + SET link_comment = ' . (int) $tmp['nb_comment'].' |
|
1084 | 1084 | WHERE link_id = ' . (int) $tmp['comment_link_id']; |
1085 | 1085 | $this->db->sql_query($sql); |
1086 | 1086 | } |
@@ -1105,7 +1105,7 @@ discard block |
||
1105 | 1105 | |
1106 | 1106 | foreach ($img_ary as $img) |
1107 | 1107 | { |
1108 | - $img = $path . $img; |
|
1108 | + $img = $path.$img; |
|
1109 | 1109 | $selected = ''; |
1110 | 1110 | |
1111 | 1111 | if (strlen($img) > 255) |
@@ -1118,7 +1118,7 @@ discard block |
||
1118 | 1118 | $selected = ' selected="selected"'; |
1119 | 1119 | } |
1120 | 1120 | |
1121 | - $filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>'; |
|
1121 | + $filename_list .= '<option value="'.htmlspecialchars($img).'"'.$selected.'>'.$img.'</option>'; |
|
1122 | 1122 | } |
1123 | 1123 | } |
1124 | 1124 |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | protected $u_action; |
31 | 31 | |
32 | 32 | /** |
33 | - * Constructor |
|
34 | - * |
|
35 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
36 | - * @param \phpbb\language\language $language Language object |
|
37 | - * @param \phpbb\request\request $request Request object |
|
38 | - * @param \phpbb\template\template $template Template object |
|
39 | - */ |
|
33 | + * Constructor |
|
34 | + * |
|
35 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
36 | + * @param \phpbb\language\language $language Language object |
|
37 | + * @param \phpbb\request\request $request Request object |
|
38 | + * @param \phpbb\template\template $template Template object |
|
39 | + */ |
|
40 | 40 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\request\request $request, \phpbb\template\template $template) |
41 | 41 | { |
42 | 42 | $this->db = $db; |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
49 | - * Display confirm box |
|
50 | - * |
|
51 | - * @param string $action Requested action |
|
52 | - * @return null |
|
53 | - */ |
|
49 | + * Display confirm box |
|
50 | + * |
|
51 | + * @param string $action Requested action |
|
52 | + * @return null |
|
53 | + */ |
|
54 | 54 | public function display_confirm($action) |
55 | 55 | { |
56 | 56 | switch ($action) |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | - * Display phpBB Directory statistics |
|
92 | - * |
|
93 | - * @return null |
|
94 | - */ |
|
91 | + * Display phpBB Directory statistics |
|
92 | + * |
|
93 | + * @return null |
|
94 | + */ |
|
95 | 95 | public function display_stats() |
96 | 96 | { |
97 | 97 | // Count number of categories |
@@ -178,11 +178,11 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
181 | - * Execute action requested |
|
182 | - * |
|
183 | - * @param string $action Requested action |
|
184 | - * @return null |
|
185 | - */ |
|
181 | + * Execute action requested |
|
182 | + * |
|
183 | + * @param string $action Requested action |
|
184 | + * @return null |
|
185 | + */ |
|
186 | 186 | public function exec_action($action) |
187 | 187 | { |
188 | 188 | switch ($action) |
@@ -257,23 +257,23 @@ discard block |
||
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
260 | - * Set page url |
|
261 | - * |
|
262 | - * @param string $u_action Custom form action |
|
263 | - * @return null |
|
264 | - * @access public |
|
265 | - */ |
|
260 | + * Set page url |
|
261 | + * |
|
262 | + * @param string $u_action Custom form action |
|
263 | + * @return null |
|
264 | + * @access public |
|
265 | + */ |
|
266 | 266 | public function set_page_url($u_action) |
267 | 267 | { |
268 | 268 | $this->u_action = $u_action; |
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
272 | - * Get orphan banners |
|
273 | - * |
|
274 | - * @param bool $delete True if we want to delete banners, else false |
|
275 | - * @return null|int Number of orphan files, else null |
|
276 | - */ |
|
272 | + * Get orphan banners |
|
273 | + * |
|
274 | + * @param bool $delete True if we want to delete banners, else false |
|
275 | + * @return null|int Number of orphan files, else null |
|
276 | + */ |
|
277 | 277 | private function _orphan_files($delete = false) |
278 | 278 | { |
279 | 279 | $banner_path = $this->get_banner_path(); |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\request\request $request, \phpbb\template\template $template) |
41 | 41 | { |
42 | - $this->db = $db; |
|
42 | + $this->db = $db; |
|
43 | 43 | $this->language = $language; |
44 | 44 | $this->template = $template; |
45 | - $this->request = $request; |
|
45 | + $this->request = $request; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | { |
149 | 149 | if ($file[0] != '.' && $file[0] != '..' && strpos($file, 'index.') === false && strpos($file, '.db') === false) |
150 | 150 | { |
151 | - $banners_dir_size += filesize($banners_path . $file); |
|
151 | + $banners_dir_size += filesize($banners_path.$file); |
|
152 | 152 | } |
153 | 153 | } |
154 | 154 | closedir($banners_dir); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | 'U_ACTION' => $this->u_action, |
168 | 168 | |
169 | 169 | 'TOTAL_CATS' => $total_cats, |
170 | - 'TOTAL_LINKS' => $total_links-$waiting_links, |
|
170 | + 'TOTAL_LINKS' => $total_links - $waiting_links, |
|
171 | 171 | 'WAITING_LINKS' => $waiting_links, |
172 | 172 | 'TOTAL_COMMENTS' => $total_comments, |
173 | 173 | 'TOTAL_VOTES' => $total_votes, |
@@ -192,15 +192,15 @@ discard block |
||
192 | 192 | { |
193 | 193 | case 'sqlite': |
194 | 194 | case 'firebird': |
195 | - $this->db->sql_query('DELETE FROM ' . $this->votes_table); |
|
195 | + $this->db->sql_query('DELETE FROM '.$this->votes_table); |
|
196 | 196 | break; |
197 | 197 | |
198 | 198 | default: |
199 | - $this->db->sql_query('TRUNCATE TABLE ' . $this->votes_table); |
|
199 | + $this->db->sql_query('TRUNCATE TABLE '.$this->votes_table); |
|
200 | 200 | break; |
201 | 201 | } |
202 | 202 | |
203 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
203 | + $sql = 'UPDATE '.$this->links_table.' |
|
204 | 204 | SET link_vote = 0, link_note = 0'; |
205 | 205 | $this->db->sql_query($sql); |
206 | 206 | |
@@ -215,15 +215,15 @@ discard block |
||
215 | 215 | { |
216 | 216 | case 'sqlite': |
217 | 217 | case 'firebird': |
218 | - $this->db->sql_query('DELETE FROM ' . $this->comments_table); |
|
218 | + $this->db->sql_query('DELETE FROM '.$this->comments_table); |
|
219 | 219 | break; |
220 | 220 | |
221 | 221 | default: |
222 | - $this->db->sql_query('TRUNCATE TABLE ' . $this->comments_table); |
|
222 | + $this->db->sql_query('TRUNCATE TABLE '.$this->comments_table); |
|
223 | 223 | break; |
224 | 224 | } |
225 | 225 | |
226 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
226 | + $sql = 'UPDATE '.$this->links_table.' |
|
227 | 227 | SET link_comment = 0'; |
228 | 228 | $this->db->sql_query($sql); |
229 | 229 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | break; |
236 | 236 | |
237 | 237 | case 'clicks': |
238 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
238 | + $sql = 'UPDATE '.$this->links_table.' |
|
239 | 239 | SET link_view = 0'; |
240 | 240 | $this->db->sql_query($sql); |
241 | 241 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | { |
290 | 290 | $physical_files[] = $img; |
291 | 291 | } |
292 | - $sql = 'SELECT link_banner FROM ' . $this->links_table . ' |
|
292 | + $sql = 'SELECT link_banner FROM '.$this->links_table.' |
|
293 | 293 | WHERE link_banner <> \'\''; |
294 | 294 | $result = $this->db->sql_query($sql); |
295 | 295 |
@@ -37,16 +37,16 @@ discard block |
||
37 | 37 | protected $php_ext; |
38 | 38 | |
39 | 39 | /** |
40 | - * Constructor |
|
41 | - * |
|
42 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
43 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
44 | - * @param \phpbb\language\language $language Language object |
|
45 | - * @param \phpbb\template\template $template Template object |
|
46 | - * @param string $table_prefix prefix table |
|
47 | - * @param string $php_ext phpEx |
|
48 | - * @access public |
|
49 | - */ |
|
40 | + * Constructor |
|
41 | + * |
|
42 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
43 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
44 | + * @param \phpbb\language\language $language Language object |
|
45 | + * @param \phpbb\template\template $template Template object |
|
46 | + * @param string $table_prefix prefix table |
|
47 | + * @param string $php_ext phpEx |
|
48 | + * @access public |
|
49 | + */ |
|
50 | 50 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\template\template $template, $table_prefix, $php_ext) |
51 | 51 | { |
52 | 52 | $this->db = $db; |
@@ -58,12 +58,12 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
61 | - * Assign functions defined in this class to event listeners in the core |
|
62 | - * |
|
63 | - * @return array |
|
64 | - * @static |
|
65 | - * @access public |
|
66 | - */ |
|
61 | + * Assign functions defined in this class to event listeners in the core |
|
62 | + * |
|
63 | + * @return array |
|
64 | + * @static |
|
65 | + * @access public |
|
66 | + */ |
|
67 | 67 | static public function getSubscribedEvents() |
68 | 68 | { |
69 | 69 | return array( |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | - * Display links to Directory |
|
80 | - * |
|
81 | - * @return null |
|
82 | - */ |
|
79 | + * Display links to Directory |
|
80 | + * |
|
81 | + * @return null |
|
82 | + */ |
|
83 | 83 | public function add_page_header_variables() |
84 | 84 | { |
85 | 85 | $ext_theme_path = $this->get_ext_name() . '/styles/prosilver/theme/'; |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
102 | - * Show users as viewing Directory on Who Is Online page |
|
103 | - * |
|
104 | - * @param object $event The event object |
|
105 | - * @return null |
|
106 | - */ |
|
102 | + * Show users as viewing Directory on Who Is Online page |
|
103 | + * |
|
104 | + * @param object $event The event object |
|
105 | + * @return null |
|
106 | + */ |
|
107 | 107 | public function add_page_viewonline($event) |
108 | 108 | { |
109 | 109 | if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0) |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
117 | - * Load common language files during user setup |
|
118 | - * |
|
119 | - * @param object $event The event object |
|
120 | - * @return null |
|
121 | - */ |
|
117 | + * Load common language files during user setup |
|
118 | + * |
|
119 | + * @param object $event The event object |
|
120 | + * @return null |
|
121 | + */ |
|
122 | 122 | public function load_language_on_setup($event) |
123 | 123 | { |
124 | 124 | $lang_set_ext = $event['lang_set_ext']; |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
133 | - * Add administrative permissions to manage Directory |
|
134 | - * |
|
135 | - * @param object $event The event object |
|
136 | - * @return null |
|
137 | - */ |
|
133 | + * Add administrative permissions to manage Directory |
|
134 | + * |
|
135 | + * @param object $event The event object |
|
136 | + * @return null |
|
137 | + */ |
|
138 | 138 | public function permissions_add_directory($event) |
139 | 139 | { |
140 | 140 | $categories = $event['categories']; |
@@ -163,11 +163,11 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
166 | - * Update Directory tables if needed, after deleted an user |
|
167 | - * |
|
168 | - * @param object $event The event object |
|
169 | - * @return null |
|
170 | - */ |
|
166 | + * Update Directory tables if needed, after deleted an user |
|
167 | + * |
|
168 | + * @param object $event The event object |
|
169 | + * @return null |
|
170 | + */ |
|
171 | 171 | public function update_links_with_anonymous($event) |
172 | 172 | { |
173 | 173 | $user_ids = $event['user_ids']; |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\controller\helper $helper, \phpbb\language\language $language, \phpbb\template\template $template, $table_prefix, $php_ext) |
51 | 51 | { |
52 | - $this->db = $db; |
|
53 | - $this->helper = $helper; |
|
52 | + $this->db = $db; |
|
53 | + $this->helper = $helper; |
|
54 | 54 | $this->language = $language; |
55 | 55 | $this->template = $template; |
56 | 56 | $this->table_prefix = $table_prefix; |
57 | - $this->php_ext = $php_ext; |
|
57 | + $this->php_ext = $php_ext; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function add_page_header_variables() |
84 | 84 | { |
85 | - $ext_theme_path = $this->get_ext_name() . '/styles/prosilver/theme/'; |
|
85 | + $ext_theme_path = $this->get_ext_name().'/styles/prosilver/theme/'; |
|
86 | 86 | $theme_lang_path = $this->language->get_used_language(); |
87 | 87 | |
88 | 88 | // Prevent 'Twig_Error_Loader' if user's lang directory doesn't exist |
89 | - if (!file_exists($ext_theme_path . $theme_lang_path . '/directory.css')) |
|
89 | + if (!file_exists($ext_theme_path.$theme_lang_path.'/directory.css')) |
|
90 | 90 | { |
91 | 91 | // Fallback to English language. |
92 | 92 | $theme_lang_path = \phpbb\language\language::FALLBACK_LANGUAGE; |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function add_page_viewonline($event) |
108 | 108 | { |
109 | - if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/directory') === 0) |
|
109 | + if (strrpos($event['row']['session_page'], 'app.'.$this->php_ext.'/directory') === 0) |
|
110 | 110 | { |
111 | - $event['location'] = $this->language->lang('DIRECTORY'); |
|
112 | - $event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); |
|
111 | + $event['location'] = $this->language->lang('DIRECTORY'); |
|
112 | + $event['location_url'] = $this->helper->route('ernadoo_phpbbdirectory_base_controller'); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -139,24 +139,24 @@ discard block |
||
139 | 139 | { |
140 | 140 | $categories = $event['categories']; |
141 | 141 | $categories = array_merge($categories, array('dir' => 'ACL_CAT_DIRECTORY')); |
142 | - $event['categories'] = $categories; |
|
142 | + $event['categories'] = $categories; |
|
143 | 143 | |
144 | 144 | $permissions = $event['permissions']; |
145 | 145 | |
146 | 146 | $permissions = array_merge($permissions, array( |
147 | - 'm_delete_dir' => array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir'), |
|
148 | - 'm_delete_comment_dir' => array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
149 | - 'm_edit_dir' => array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir'), |
|
150 | - 'm_edit_comment_dir' => array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
151 | - |
|
152 | - 'u_comment_dir' => array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir'), |
|
153 | - 'u_delete_dir' => array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir'), |
|
154 | - 'u_delete_comment_dir' => array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
155 | - 'u_edit_dir' => array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir'), |
|
156 | - 'u_edit_comment_dir' => array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
157 | - 'u_search_dir' => array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir'), |
|
158 | - 'u_submit_dir' => array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir'), |
|
159 | - 'u_vote_dir' => array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir'), |
|
147 | + 'm_delete_dir' => array('lang' => 'ACL_M_DELETE_DIR', 'cat' => 'dir'), |
|
148 | + 'm_delete_comment_dir' => array('lang' => 'ACL_M_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
149 | + 'm_edit_dir' => array('lang' => 'ACL_M_EDIT_DIR', 'cat' => 'dir'), |
|
150 | + 'm_edit_comment_dir' => array('lang' => 'ACL_M_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
151 | + |
|
152 | + 'u_comment_dir' => array('lang' => 'ACL_U_COMMENT_DIR', 'cat' => 'dir'), |
|
153 | + 'u_delete_dir' => array('lang' => 'ACL_U_DELETE_DIR', 'cat' => 'dir'), |
|
154 | + 'u_delete_comment_dir' => array('lang' => 'ACL_U_DELETE_COMMENT_DIR', 'cat' => 'dir'), |
|
155 | + 'u_edit_dir' => array('lang' => 'ACL_U_EDIT_DIR', 'cat' => 'dir'), |
|
156 | + 'u_edit_comment_dir' => array('lang' => 'ACL_U_EDIT_COMMENT_DIR', 'cat' => 'dir'), |
|
157 | + 'u_search_dir' => array('lang' => 'ACL_U_SEARCH_DIR', 'cat' => 'dir'), |
|
158 | + 'u_submit_dir' => array('lang' => 'ACL_U_SUBMIT_DIR', 'cat' => 'dir'), |
|
159 | + 'u_vote_dir' => array('lang' => 'ACL_U_VOTE_DIR', 'cat' => 'dir'), |
|
160 | 160 | )); |
161 | 161 | |
162 | 162 | $event['permissions'] = $permissions; |
@@ -177,17 +177,17 @@ discard block |
||
177 | 177 | $user_ids = array($user_ids); |
178 | 178 | } |
179 | 179 | |
180 | - $sql = 'UPDATE ' . $this->comments_table . ' |
|
181 | - SET comment_user_id = ' . ANONYMOUS . ' |
|
180 | + $sql = 'UPDATE '.$this->comments_table.' |
|
181 | + SET comment_user_id = ' . ANONYMOUS.' |
|
182 | 182 | WHERE ' . $this->db->sql_in_set('comment_user_id', $user_ids); |
183 | 183 | $this->db->sql_query($sql); |
184 | 184 | |
185 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
186 | - SET link_user_id = ' . ANONYMOUS . ' |
|
185 | + $sql = 'UPDATE '.$this->links_table.' |
|
186 | + SET link_user_id = ' . ANONYMOUS.' |
|
187 | 187 | WHERE ' . $this->db->sql_in_set('link_user_id', $user_ids); |
188 | 188 | $this->db->sql_query($sql); |
189 | 189 | |
190 | - $sql = 'DELETE FROM ' . $this->watch_table . ' |
|
190 | + $sql = 'DELETE FROM '.$this->watch_table.' |
|
191 | 191 | WHERE ' . $this->db->sql_in_set('user_id', $user_ids); |
192 | 192 | $this->db->sql_query($sql); |
193 | 193 | } |
@@ -13,12 +13,12 @@ |
||
13 | 13 | class nestedset_category extends \phpbb\tree\nestedset |
14 | 14 | { |
15 | 15 | /** |
16 | - * Construct |
|
17 | - * |
|
18 | - * @param \phpbb\db\driver\driver_interface $db Database connection |
|
19 | - * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around |
|
20 | - * @param string $categorie_table Categories table |
|
21 | - */ |
|
16 | + * Construct |
|
17 | + * |
|
18 | + * @param \phpbb\db\driver\driver_interface $db Database connection |
|
19 | + * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around |
|
20 | + * @param string $categorie_table Categories table |
|
21 | + */ |
|
22 | 22 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\lock\db $lock, $categorie_table) |
23 | 23 | { |
24 | 24 | parent::__construct( |
@@ -46,18 +46,18 @@ discard block |
||
46 | 46 | public $data = array(); |
47 | 47 | |
48 | 48 | /** |
49 | - * Constructor |
|
50 | - * |
|
51 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
52 | - * @param \phpbb\config\config $config Config object |
|
53 | - * @param \phpbb\language\language $language Language object |
|
54 | - * @param \phpbb\template\template $template Template object |
|
55 | - * @param \phpbb\user $user User object |
|
56 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
57 | - * @param \phpbb\request\request $request Request object |
|
58 | - * @param \phpbb\auth\auth $auth Auth object |
|
59 | - * @param \phpbb\cron\manager $cron Cron object |
|
60 | - */ |
|
49 | + * Constructor |
|
50 | + * |
|
51 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
52 | + * @param \phpbb\config\config $config Config object |
|
53 | + * @param \phpbb\language\language $language Language object |
|
54 | + * @param \phpbb\template\template $template Template object |
|
55 | + * @param \phpbb\user $user User object |
|
56 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
57 | + * @param \phpbb\request\request $request Request object |
|
58 | + * @param \phpbb\auth\auth $auth Auth object |
|
59 | + * @param \phpbb\cron\manager $cron Cron object |
|
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 | 63 | $this->db = $db; |
@@ -72,21 +72,21 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
75 | - * Function for get approval setting |
|
76 | - * used in edit mode for test the setting of new category's link |
|
77 | - * |
|
78 | - * @return bool |
|
79 | - */ |
|
75 | + * Function for get approval setting |
|
76 | + * used in edit mode for test the setting of new category's link |
|
77 | + * |
|
78 | + * @return bool |
|
79 | + */ |
|
80 | 80 | public function need_approval() |
81 | 81 | { |
82 | 82 | return (bool) $this->data['cat_validate']; |
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
86 | - * Generate Jumpbox |
|
87 | - * |
|
88 | - * @return null |
|
89 | - */ |
|
86 | + * Generate Jumpbox |
|
87 | + * |
|
88 | + * @return null |
|
89 | + */ |
|
90 | 90 | public function make_cat_jumpbox() |
91 | 91 | { |
92 | 92 | $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id |
@@ -139,12 +139,12 @@ discard block |
||
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
142 | - * Generate a list of directory's categories |
|
143 | - * |
|
144 | - * @param int $select_id Selected category |
|
145 | - * @param array $ignore_id Array of ignored categories |
|
146 | - * @return string $cat_list html code |
|
147 | - */ |
|
142 | + * Generate a list of directory's categories |
|
143 | + * |
|
144 | + * @param int $select_id Selected category |
|
145 | + * @param array $ignore_id Array of ignored categories |
|
146 | + * @return string $cat_list html code |
|
147 | + */ |
|
148 | 148 | public function make_cat_select($select_id = 0, $ignore_id = array()) |
149 | 149 | { |
150 | 150 | $ignore_id = is_array($ignore_id) ? $ignore_id : array($ignore_id); |
@@ -190,10 +190,10 @@ discard block |
||
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
193 | - * Display cat or subcat |
|
194 | - * |
|
195 | - * @return null |
|
196 | - */ |
|
193 | + * Display cat or subcat |
|
194 | + * |
|
195 | + * @return null |
|
196 | + */ |
|
197 | 197 | public function display() |
198 | 198 | { |
199 | 199 | $cat_rows = $subcats = array(); |
@@ -322,11 +322,11 @@ discard block |
||
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
325 | - * Get informations about a cat or subcat |
|
326 | - * |
|
327 | - * @param int $cat_id The category ID |
|
328 | - * @return null|false |
|
329 | - */ |
|
325 | + * Get informations about a cat or subcat |
|
326 | + * |
|
327 | + * @param int $cat_id The category ID |
|
328 | + * @return null|false |
|
329 | + */ |
|
330 | 330 | public function get($cat_id = 0) |
331 | 331 | { |
332 | 332 | if ($cat_id) |
@@ -354,11 +354,11 @@ discard block |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | /** |
357 | - * Create category navigation links for given category, create parent |
|
358 | - * list if currently null, assign basic category info to template |
|
359 | - * |
|
360 | - * @param array $dir_cat_data |
|
361 | - */ |
|
357 | + * Create category navigation links for given category, create parent |
|
358 | + * list if currently null, assign basic category info to template |
|
359 | + * |
|
360 | + * @param array $dir_cat_data |
|
361 | + */ |
|
362 | 362 | public function generate_dir_nav(&$dir_cat_data) |
363 | 363 | { |
364 | 364 | global $phpbb_container; |
@@ -395,12 +395,12 @@ discard block |
||
395 | 395 | } |
396 | 396 | |
397 | 397 | /** |
398 | - * Return good key language |
|
399 | - * |
|
400 | - * @param bool $validate True if approbation needed before publication |
|
401 | - * @return string Information about approval, depends on user auth level |
|
402 | - * @throws \phpbb\exception\runtime_exception |
|
403 | - */ |
|
398 | + * Return good key language |
|
399 | + * |
|
400 | + * @param bool $validate True if approbation needed before publication |
|
401 | + * @return string Information about approval, depends on user auth level |
|
402 | + * @throws \phpbb\exception\runtime_exception |
|
403 | + */ |
|
404 | 404 | public function dir_submit_type($validate) |
405 | 405 | { |
406 | 406 | if ($validate && !$this->auth->acl_get('a_')) |
@@ -424,15 +424,15 @@ discard block |
||
424 | 424 | } |
425 | 425 | |
426 | 426 | /** |
427 | - * Category watching common code |
|
428 | - * |
|
429 | - * @param string $mode Watch or unwatch a category |
|
430 | - * @param array $s_watching An empty array, passed by reference |
|
431 | - * @param int $user_id The user ID |
|
432 | - * @param int $cat_id The category ID |
|
433 | - * @param string $notify_status User is watching the category? |
|
434 | - * @return null|string |
|
435 | - */ |
|
427 | + * Category watching common code |
|
428 | + * |
|
429 | + * @param string $mode Watch or unwatch a category |
|
430 | + * @param array $s_watching An empty array, passed by reference |
|
431 | + * @param int $user_id The user ID |
|
432 | + * @param int $cat_id The category ID |
|
433 | + * @param string $notify_status User is watching the category? |
|
434 | + * @return null|string |
|
435 | + */ |
|
436 | 436 | public function watch_categorie($mode, &$s_watching, $user_id, $cat_id, $notify_status) |
437 | 437 | { |
438 | 438 | // Is user watching this thread? |
@@ -518,11 +518,11 @@ discard block |
||
518 | 518 | } |
519 | 519 | |
520 | 520 | /** |
521 | - * Return Category name |
|
522 | - * |
|
523 | - * @param int $cat_id The category ID |
|
524 | - * @return string The category name |
|
525 | - */ |
|
521 | + * Return Category name |
|
522 | + * |
|
523 | + * @param int $cat_id The category ID |
|
524 | + * @return string The category name |
|
525 | + */ |
|
526 | 526 | static public function getname($cat_id) |
527 | 527 | { |
528 | 528 | global $db, $phpbb_container; |
@@ -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, 600); |
96 | 96 | |
@@ -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, 600); |
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,7 +261,7 @@ 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 | { |
@@ -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,7 +378,7 @@ 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 . '"', |
|
381 | + 'MICRODATA' => $microdata_attr.'="'.$parent_cat_id.'"', |
|
382 | 382 | 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $parent_cat_id)), |
383 | 383 | )); |
384 | 384 | } |
@@ -387,7 +387,7 @@ 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'] . '"', |
|
390 | + 'MICRODATA' => $microdata_attr.'="'.$dir_cat_data['cat_id'].'"', |
|
391 | 391 | 'U_VIEW_FORUM' => $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $dir_cat_data['cat_id'])), |
392 | 392 | )); |
393 | 393 | |
@@ -444,7 +444,7 @@ 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); |
@@ -454,7 +454,7 @@ discard block |
||
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,8 +478,8 @@ 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 | 485 | $redirect_url = $this->helper->route('ernadoo_phpbbdirectory_page_controller', array('cat_id' => (int) $cat_id)); |
@@ -487,7 +487,7 @@ discard block |
||
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); |