@@ -18,11 +18,11 @@ |
||
18 | 18 | 'filename' => '\ernadoo\phpbbdirectory\acp\phpbbdirectory_module', |
19 | 19 | 'title' => 'ACP_DIRECTORY', |
20 | 20 | 'modes' => array( |
21 | - '' => array('title' => 'ACP_DIRECTORY', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('')), |
|
22 | - 'main' => array('title' => 'ACP_DIRECTORY_MAIN', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
23 | - 'settings' => array('title' => 'ACP_DIRECTORY_SETTINGS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
24 | - 'cat' => array('title' => 'ACP_DIRECTORY_CATS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
25 | - 'val' => array('title' => 'ACP_DIRECTORY_VAL', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
21 | + '' => array('title' => 'ACP_DIRECTORY', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('')), |
|
22 | + 'main' => array('title' => 'ACP_DIRECTORY_MAIN', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
23 | + 'settings' => array('title' => 'ACP_DIRECTORY_SETTINGS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
24 | + 'cat' => array('title' => 'ACP_DIRECTORY_CATS', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
25 | + 'val' => array('title' => 'ACP_DIRECTORY_VAL', 'auth' => 'ext_ernadoo/phpbbdirectory', 'cat' => array('ACP_DIRECTORY')), |
|
26 | 26 | ), |
27 | 27 | ); |
28 | 28 | } |
@@ -86,24 +86,24 @@ discard block |
||
86 | 86 | */ |
87 | 87 | 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\helper $dir_helper, \ernadoo\phpbbdirectory\core\nestedset_category $nestedset_category) |
88 | 88 | { |
89 | - $this->cache = $cache; |
|
90 | - $this->db = $db; |
|
91 | - $this->helper = $helper; |
|
89 | + $this->cache = $cache; |
|
90 | + $this->db = $db; |
|
91 | + $this->helper = $helper; |
|
92 | 92 | $this->language = $language; |
93 | 93 | $this->phpbb_log = $log; |
94 | - $this->request = $request; |
|
94 | + $this->request = $request; |
|
95 | 95 | $this->template = $template; |
96 | - $this->user = $user; |
|
96 | + $this->user = $user; |
|
97 | 97 | $this->categorie = $categorie; |
98 | - $this->dir_helper = $dir_helper; |
|
99 | - $this->nestedset_category = $nestedset_category; |
|
98 | + $this->dir_helper = $dir_helper; |
|
99 | + $this->nestedset_category = $nestedset_category; |
|
100 | 100 | |
101 | 101 | $this->form_key = 'acp_dir_cat'; |
102 | 102 | add_form_key($this->form_key); |
103 | 103 | |
104 | 104 | $this->action = $this->request->variable('action', ''); |
105 | 105 | $this->cat_id = $request->variable('c', 0); |
106 | - $this->parent_id = $request->variable('parent_id', 0); |
|
106 | + $this->parent_id = $request->variable('parent_id', 0); |
|
107 | 107 | $this->update = ($this->request->is_set_post('update')) ? true : false; |
108 | 108 | } |
109 | 109 | |
@@ -538,10 +538,10 @@ discard block |
||
538 | 538 | switch ($this->action) |
539 | 539 | { |
540 | 540 | case 'delete': |
541 | - $action_subcats = $this->request->variable('action_subcats', ''); |
|
542 | - $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
543 | - $action_links = $this->request->variable('action_links', ''); |
|
544 | - $links_to_id = $this->request->variable('links_to_id', 0); |
|
541 | + $action_subcats = $this->request->variable('action_subcats', ''); |
|
542 | + $subcats_to_id = $this->request->variable('subcats_to_id', 0); |
|
543 | + $action_links = $this->request->variable('action_links', ''); |
|
544 | + $links_to_id = $this->request->variable('links_to_id', 0); |
|
545 | 545 | |
546 | 546 | try |
547 | 547 | { |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | { |
766 | 766 | if ($cat_data_sql['cat_cron_enable']) |
767 | 767 | { |
768 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
768 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
769 | 769 | } |
770 | 770 | |
771 | 771 | $this->cat_data = $this->nestedset_category->insert($cat_data_sql); |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | |
789 | 789 | if ($cat_data_sql['cat_cron_enable'] && ($row['cat_cron_freq'] != $cat_data_sql['cat_cron_freq'] || !$row['cat_cron_enable'])) |
790 | 790 | { |
791 | - $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq']*86400; |
|
791 | + $cat_data_sql['cat_cron_next'] = time() + $cat_data_sql['cat_cron_freq'] * 86400; |
|
792 | 792 | } |
793 | 793 | |
794 | 794 | if ($row['cat_name'] != $cat_data_sql['cat_name']) |
@@ -29,8 +29,8 @@ |
||
29 | 29 | */ |
30 | 30 | public function __construct(\phpbb\extension\manager $phpbb_extension_manager, \phpbb\path_helper $path_helper) |
31 | 31 | { |
32 | - $this->extension_manager = $phpbb_extension_manager; |
|
33 | - $this->path_helper = $path_helper; |
|
32 | + $this->extension_manager = $phpbb_extension_manager; |
|
33 | + $this->path_helper = $path_helper; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -37,8 +37,8 @@ |
||
37 | 37 | */ |
38 | 38 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \ernadoo\phpbbdirectory\core\link $directory_cron, $php_ext) |
39 | 39 | { |
40 | - $this->db = $db; |
|
41 | - $this->config = $config; |
|
40 | + $this->db = $db; |
|
41 | + $this->config = $config; |
|
42 | 42 | $this->dir_cron = $directory_cron; |
43 | 43 | $this->php_ext = $php_ext; |
44 | 44 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | 'module_auth' => 'ext_ernadoo/phpbbdirectory' |
57 | 57 | ); |
58 | 58 | |
59 | - $sql = 'UPDATE ' . $this->table_prefix . 'modules |
|
59 | + $sql = 'UPDATE ' . $this->table_prefix . 'modules |
|
60 | 60 | SET ' . $this->db->sql_build_array('UPDATE', $module_data) . " |
61 | 61 | WHERE module_basename = 'acp_directory' |
62 | 62 | AND module_mode IN ('main', 'settings', 'cat', 'val')"; |
@@ -144,7 +144,7 @@ |
||
144 | 144 | */ |
145 | 145 | public function get_url() |
146 | 146 | { |
147 | - return append_sid($this->phpbb_root_path . 'directory/categorie/' . (int) $this->get_data('cat_id')); |
|
147 | + return append_sid($this->phpbb_root_path . 'directory/categorie/' . (int) $this->get_data('cat_id')); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -67,7 +67,7 @@ |
||
67 | 67 | $match_search_query = ''; |
68 | 68 | foreach ($matches as $match) |
69 | 69 | { |
70 | - $match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER('. $match . ') '; |
|
70 | + $match_search_query .= (($match_search_query) ? ' OR ' : '') . 'LOWER(' . $match . ') '; |
|
71 | 71 | $match_search_query .= $this->db->sql_like_expression(str_replace('*', $this->db->get_any_char(), $this->db->get_any_char() . strtolower($word) . $this->db->get_any_char())); |
72 | 72 | } |
73 | 73 | $search_query .= ((!$search_query) ? '' : (($terms == 'all') ? ' AND ' : ' OR ')) . '(' . $match_search_query . ')'; |
@@ -144,7 +144,7 @@ |
||
144 | 144 | */ |
145 | 145 | public function get_url() |
146 | 146 | { |
147 | - return append_sid($this->phpbb_root_path . 'directory/categorie/' . (int) $this->get_data('cat_id')); |
|
147 | + return append_sid($this->phpbb_root_path . 'directory/categorie/' . (int) $this->get_data('cat_id')); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user, \ernadoo\phpbbdirectory\core\helper $dir_helper) |
43 | 43 | { |
44 | - $this->db = $db; |
|
45 | - $this->template = $template; |
|
46 | - $this->user = $user; |
|
47 | - $this->request = $request; |
|
48 | - $this->dir_helper = $dir_helper; |
|
44 | + $this->db = $db; |
|
45 | + $this->template = $template; |
|
46 | + $this->user = $user; |
|
47 | + $this->request = $request; |
|
48 | + $this->dir_helper = $dir_helper; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | 'U_ACTION' => $this->u_action, |
171 | 171 | |
172 | 172 | 'TOTAL_CATS' => $total_cats, |
173 | - 'TOTAL_LINKS' => $total_links-$waiting_links, |
|
173 | + 'TOTAL_LINKS' => $total_links - $waiting_links, |
|
174 | 174 | 'WAITING_LINKS' => $waiting_links, |
175 | 175 | 'TOTAL_COMMENTS' => $total_comments, |
176 | 176 | 'TOTAL_VOTES' => $total_votes, |