@@ -144,7 +144,7 @@ |
||
144 | 144 | * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com> |
145 | 145 | * @license GNU General Public License, version 2 (GPL-2.0) |
146 | 146 | * @param string $step The step (enable, disable, purge) |
147 | - * @param array $notification_types The notification type names |
|
147 | + * @param string[] $notification_types The notification type names |
|
148 | 148 | * @return string Return notifications as temporary state |
149 | 149 | * @access protected |
150 | 150 | */ |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | class ext extends \phpbb\extension\base |
18 | 18 | { |
19 | 19 | /** |
20 | - * Enable extension if requirements are met |
|
21 | - * |
|
22 | - * @return bool |
|
23 | - * @aceess public |
|
24 | - */ |
|
20 | + * Enable extension if requirements are met |
|
21 | + * |
|
22 | + * @return bool |
|
23 | + * @aceess public |
|
24 | + */ |
|
25 | 25 | public function is_enableable() |
26 | 26 | { |
27 | 27 | $config = $this->container->get('config'); |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | - * Single enable step that installs any included migrations |
|
46 | - * |
|
47 | - * @param mixed $old_state State returned by previous call of this method |
|
48 | - * @return mixed Returns false after last step, otherwise temporary state |
|
49 | - */ |
|
45 | + * Single enable step that installs any included migrations |
|
46 | + * |
|
47 | + * @param mixed $old_state State returned by previous call of this method |
|
48 | + * @return mixed Returns false after last step, otherwise temporary state |
|
49 | + */ |
|
50 | 50 | public function enable_step($old_state) |
51 | 51 | { |
52 | 52 | switch ($old_state) |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
77 | - * Single disable step that does nothing |
|
78 | - * |
|
79 | - * @param mixed $old_state State returned by previous call of this method |
|
80 | - * @return mixed Returns false after last step, otherwise temporary state |
|
81 | - */ |
|
77 | + * Single disable step that does nothing |
|
78 | + * |
|
79 | + * @param mixed $old_state State returned by previous call of this method |
|
80 | + * @return mixed Returns false after last step, otherwise temporary state |
|
81 | + */ |
|
82 | 82 | public function disable_step($old_state) |
83 | 83 | { |
84 | 84 | switch ($old_state) |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * Single purge step that reverts any included and installed migrations |
|
110 | - * |
|
111 | - * @param mixed $old_state State returned by previous call of this method |
|
112 | - * @return mixed Returns false after last step, otherwise temporary state |
|
113 | - */ |
|
109 | + * Single purge step that reverts any included and installed migrations |
|
110 | + * |
|
111 | + * @param mixed $old_state State returned by previous call of this method |
|
112 | + * @return mixed Returns false after last step, otherwise temporary state |
|
113 | + */ |
|
114 | 114 | public function purge_step($old_state) |
115 | 115 | { |
116 | 116 | switch ($old_state) |
@@ -138,16 +138,16 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
141 | - * Notification handler to call notification enable/disable/purge steps |
|
142 | - * |
|
143 | - * @author VSEphpbb (Matt Friedman) |
|
144 | - * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com> |
|
145 | - * @license GNU General Public License, version 2 (GPL-2.0) |
|
146 | - * @param string $step The step (enable, disable, purge) |
|
147 | - * @param array $notification_types The notification type names |
|
148 | - * @return string Return notifications as temporary state |
|
149 | - * @access protected |
|
150 | - */ |
|
141 | + * Notification handler to call notification enable/disable/purge steps |
|
142 | + * |
|
143 | + * @author VSEphpbb (Matt Friedman) |
|
144 | + * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com> |
|
145 | + * @license GNU General Public License, version 2 (GPL-2.0) |
|
146 | + * @param string $step The step (enable, disable, purge) |
|
147 | + * @param array $notification_types The notification type names |
|
148 | + * @return string Return notifications as temporary state |
|
149 | + * @access protected |
|
150 | + */ |
|
151 | 151 | protected function notification_handler($step, $notification_types) |
152 | 152 | { |
153 | 153 | $phpbb_notifications = $this->container->get('notification_manager'); |
@@ -155,7 +155,7 @@ |
||
155 | 155 | |
156 | 156 | foreach ($notification_types as $notification_type) |
157 | 157 | { |
158 | - call_user_func(array($phpbb_notifications, $step . '_notifications'), $notification_type); |
|
158 | + call_user_func(array($phpbb_notifications, $step.'_notifications'), $notification_type); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | return 'notifications'; |
@@ -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 | } |
@@ -40,15 +40,15 @@ discard block |
||
40 | 40 | private $display_vars; |
41 | 41 | |
42 | 42 | /** |
43 | - * Constructor |
|
44 | - * |
|
45 | - * @param \phpbb\config\config $config Config object |
|
46 | - * @param \phpbb\language\language $language Language object |
|
47 | - * @param \phpbb\log\log $log Log object |
|
48 | - * @param \phpbb\request\request $request Request object |
|
49 | - * @param \phpbb\template\template $template Template object |
|
50 | - * @param \phpbb\user $user User object |
|
51 | - */ |
|
43 | + * Constructor |
|
44 | + * |
|
45 | + * @param \phpbb\config\config $config Config object |
|
46 | + * @param \phpbb\language\language $language Language object |
|
47 | + * @param \phpbb\log\log $log Log object |
|
48 | + * @param \phpbb\request\request $request Request object |
|
49 | + * @param \phpbb\template\template $template Template object |
|
50 | + * @param \phpbb\user $user User object |
|
51 | + */ |
|
52 | 52 | public function __construct(\phpbb\config\config $config, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) |
53 | 53 | { |
54 | 54 | $this->config = $config; |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | - * Display config page |
|
66 | - * |
|
67 | - * @return null |
|
68 | - */ |
|
65 | + * Display config page |
|
66 | + * |
|
67 | + * @return null |
|
68 | + */ |
|
69 | 69 | public function display_config() |
70 | 70 | { |
71 | 71 | // Output relevant page |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
114 | - * Validate config vars and update config table if needed |
|
115 | - * |
|
116 | - * @return null |
|
117 | - */ |
|
114 | + * Validate config vars and update config table if needed |
|
115 | + * |
|
116 | + * @return null |
|
117 | + */ |
|
118 | 118 | public function process() |
119 | 119 | { |
120 | 120 | $submit = ($this->request->is_set_post('submit')) ? true : false; |
@@ -167,22 +167,22 @@ discard block |
||
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
170 | - * Set page url |
|
171 | - * |
|
172 | - * @param string $u_action Custom form action |
|
173 | - * @return null |
|
174 | - * @access public |
|
175 | - */ |
|
170 | + * Set page url |
|
171 | + * |
|
172 | + * @param string $u_action Custom form action |
|
173 | + * @return null |
|
174 | + * @access public |
|
175 | + */ |
|
176 | 176 | public function set_page_url($u_action) |
177 | 177 | { |
178 | 178 | $this->u_action = $u_action; |
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
182 | - * Build config matrice |
|
183 | - * |
|
184 | - * @return null |
|
185 | - */ |
|
182 | + * Build config matrice |
|
183 | + * |
|
184 | + * @return null |
|
185 | + */ |
|
186 | 186 | private function _generate_config() |
187 | 187 | { |
188 | 188 | $this->display_vars = array( |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function __construct(\phpbb\config\config $config, \phpbb\language\language $language, \phpbb\log\log $log, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\user $user) |
53 | 53 | { |
54 | - $this->config = $config; |
|
54 | + $this->config = $config; |
|
55 | 55 | $this->language = $language; |
56 | - $this->log = $log; |
|
56 | + $this->log = $log; |
|
57 | 57 | $this->template = $template; |
58 | - $this->user = $user; |
|
59 | - $this->request = $request; |
|
58 | + $this->user = $user; |
|
59 | + $this->request = $request; |
|
60 | 60 | |
61 | 61 | $this->_generate_config(); |
62 | 62 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | else if ($vars['explain']) |
97 | 97 | { |
98 | - $l_explain = $this->language->lang($vars['lang'] . '_EXPLAIN'); |
|
98 | + $l_explain = $this->language->lang($vars['lang'].'_EXPLAIN'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $this->template->assign_block_vars('options', array( |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function process() |
119 | 119 | { |
120 | - $submit = ($this->request->is_set_post('submit')) ? true : false; |
|
120 | + $submit = ($this->request->is_set_post('submit')) ? true : false; |
|
121 | 121 | |
122 | 122 | $this->new_config = $this->config; |
123 | 123 | $cfg_array = ($this->request->is_set('config')) ? $this->request->variable('config', array('' => ''), true) : $this->new_config; |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | { |
159 | 159 | $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'DIR_CONFIG_SETTINGS'); |
160 | 160 | |
161 | - trigger_error($this->language->lang('CONFIG_UPDATED') . adm_back_link($this->u_action)); |
|
161 | + trigger_error($this->language->lang('CONFIG_UPDATED').adm_back_link($this->u_action)); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | $this->template->assign_vars(array( |
165 | 165 | 'L_TITLE' => $this->language->lang($this->display_vars['title']), |
166 | - 'L_TITLE_EXPLAIN' => $this->language->lang($this->display_vars['title'] . '_EXPLAIN'), |
|
166 | + 'L_TITLE_EXPLAIN' => $this->language->lang($this->display_vars['title'].'_EXPLAIN'), |
|
167 | 167 | |
168 | 168 | 'S_ERROR' => (sizeof($error)) ? true : false, |
169 | 169 | 'ERROR_MSG' => implode('<br />', $error), |
@@ -199,45 +199,45 @@ discard block |
||
199 | 199 | 'dir_banner_width' => '', |
200 | 200 | 'dir_banner_height' => '', |
201 | 201 | |
202 | - 'dir_mail' => array('lang' => 'DIR_MAIL_VALIDATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
203 | - 'dir_activ_checkurl' => array('lang' => 'DIR_ACTIVE_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
204 | - 'dir_activ_flag' => array('lang' => 'DIR_ACTIV_FLAG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
205 | - 'dir_activ_rss' => array('lang' => 'DIR_ACTIV_RSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
206 | - 'dir_activ_pagerank' => array('lang' => 'DIR_ACTIV_PAGERANK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
207 | - 'dir_show' => array('lang' => 'DIR_SHOW', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
208 | - 'dir_length_describe' => array('lang' => 'DIR_MAX_DESC', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
209 | - 'dir_new_time' => array('lang' => 'DIR_NEW_TIME', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
210 | - 'dir_default_order' => array('lang' => 'DIR_DEFAULT_ORDER', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')), |
|
202 | + 'dir_mail' => array('lang' => 'DIR_MAIL_VALIDATION', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
203 | + 'dir_activ_checkurl' => array('lang' => 'DIR_ACTIVE_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
204 | + 'dir_activ_flag' => array('lang' => 'DIR_ACTIV_FLAG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
205 | + 'dir_activ_rss' => array('lang' => 'DIR_ACTIV_RSS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
206 | + 'dir_activ_pagerank' => array('lang' => 'DIR_ACTIV_PAGERANK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
207 | + 'dir_show' => array('lang' => 'DIR_SHOW', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
208 | + 'dir_length_describe' => array('lang' => 'DIR_MAX_DESC', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
209 | + 'dir_new_time' => array('lang' => 'DIR_NEW_TIME', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
210 | + 'dir_default_order' => array('lang' => 'DIR_DEFAULT_ORDER', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_order_list', 'params' => array('{CONFIG_VALUE}')), |
|
211 | 211 | |
212 | 212 | 'legend2' => 'DIR_RECENT_GUEST', |
213 | - 'dir_recent_block' => array('lang' => 'DIR_RECENT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
214 | - 'dir_recent_rows' => array('lang' => 'DIR_RECENT_ROWS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
215 | - 'dir_recent_columns' => array('lang' => 'DIR_RECENT_COLUMNS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
216 | - 'dir_recent_exclude' => array('lang' => 'DIR_RECENT_EXCLUDE', 'validate' => 'string', 'type' => 'text:6:99', 'explain' => true), |
|
213 | + 'dir_recent_block' => array('lang' => 'DIR_RECENT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
214 | + 'dir_recent_rows' => array('lang' => 'DIR_RECENT_ROWS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
215 | + 'dir_recent_columns' => array('lang' => 'DIR_RECENT_COLUMNS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => false), |
|
216 | + 'dir_recent_exclude' => array('lang' => 'DIR_RECENT_EXCLUDE', 'validate' => 'string', 'type' => 'text:6:99', 'explain' => true), |
|
217 | 217 | |
218 | 218 | 'legend3' => 'DIR_ADD_GUEST', |
219 | - 'dir_visual_confirm' => array('lang' => 'DIR_VISUAL_CONFIRM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
220 | - 'dir_visual_confirm_max_attempts' => array('lang' => 'DIR_MAX_ADD_ATTEMPTS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), |
|
219 | + 'dir_visual_confirm' => array('lang' => 'DIR_VISUAL_CONFIRM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
220 | + 'dir_visual_confirm_max_attempts' => array('lang' => 'DIR_MAX_ADD_ATTEMPTS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), |
|
221 | 221 | |
222 | 222 | 'legend4' => 'DIR_THUMB_PARAM', |
223 | - 'dir_activ_thumb' => array('lang' => 'DIR_ACTIVE_THUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
224 | - 'dir_activ_thumb_remote' => array('lang' => 'DIR_ACTIVE_THUMB_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
225 | - 'dir_thumb_service' => array('lang' => 'DIR_THUMB_SERVICE', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')), |
|
226 | - 'dir_thumb_service_reverse' => array('lang' => 'DIR_THUMB_SERVICE_REVERSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
223 | + 'dir_activ_thumb' => array('lang' => 'DIR_ACTIVE_THUMB', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
224 | + 'dir_activ_thumb_remote' => array('lang' => 'DIR_ACTIVE_THUMB_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
225 | + 'dir_thumb_service' => array('lang' => 'DIR_THUMB_SERVICE', 'validate' => 'string', 'type' => 'select', 'explain' => true, 'method' => 'get_thumb_service_list', 'params' => array('{CONFIG_VALUE}')), |
|
226 | + 'dir_thumb_service_reverse' => array('lang' => 'DIR_THUMB_SERVICE_REVERSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
227 | 227 | |
228 | 228 | 'legend5' => 'DIR_COMM_PARAM', |
229 | - 'dir_allow_bbcode' => array('lang' => 'DIR_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
230 | - 'dir_allow_flash' => array('lang' => 'DIR_ALLOW_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
231 | - 'dir_allow_links' => array('lang' => 'DIR_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
232 | - 'dir_allow_smilies' => array('lang' => 'DIR_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
233 | - 'dir_length_comments' => array('lang' => 'DIR_LENGTH_COMMENTS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
234 | - 'dir_comments_per_page' => array('lang' => 'DIR_COMM_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
229 | + 'dir_allow_bbcode' => array('lang' => 'DIR_ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
230 | + 'dir_allow_flash' => array('lang' => 'DIR_ALLOW_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
231 | + 'dir_allow_links' => array('lang' => 'DIR_ALLOW_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
232 | + 'dir_allow_smilies' => array('lang' => 'DIR_ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
233 | + 'dir_length_comments' => array('lang' => 'DIR_LENGTH_COMMENTS', 'validate' => 'int:1:999', 'type' => 'number:1:999', 'explain' => true), |
|
234 | + 'dir_comments_per_page' => array('lang' => 'DIR_COMM_PER_PAGE', 'validate' => 'int:1:9999', 'type' => 'number:1:9999', 'explain' => false), |
|
235 | 235 | |
236 | 236 | 'legend6' => 'DIR_BANN_PARAM', |
237 | - 'dir_activ_banner' => array('lang' => 'DIR_ACTIV_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
238 | - 'dir_banner' => array('lang' => 'DIR_MAX_BANN', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' ' . $this->user->lang['PIXEL']), |
|
239 | - 'dir_banner_filesize' => array('lang' => 'DIR_MAX_SIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), |
|
240 | - 'dir_storage_banner' => array('lang' => 'DIR_STORAGE_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
237 | + 'dir_activ_banner' => array('lang' => 'DIR_ACTIV_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), |
|
238 | + 'dir_banner' => array('lang' => 'DIR_MAX_BANN', 'validate' => 'int:0', 'type' => 'dimension:0', 'explain' => true, 'append' => ' '.$this->user->lang['PIXEL']), |
|
239 | + 'dir_banner_filesize' => array('lang' => 'DIR_MAX_SIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), |
|
240 | + 'dir_storage_banner' => array('lang' => 'DIR_STORAGE_BANNER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), |
|
241 | 241 | ) |
242 | 242 | ); |
243 | 243 | } |
@@ -46,20 +46,20 @@ discard block |
||
46 | 46 | protected $link; |
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\pagination $pagination Pagination object |
|
60 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
61 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
62 | - */ |
|
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\pagination $pagination Pagination object |
|
60 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
61 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
62 | + */ |
|
63 | 63 | 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\pagination $pagination, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
64 | 64 | { |
65 | 65 | $this->db = $db; |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
86 | - * Base controller to be accessed with the URL /directory |
|
87 | - * |
|
88 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
89 | - */ |
|
86 | + * Base controller to be accessed with the URL /directory |
|
87 | + * |
|
88 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
89 | + */ |
|
90 | 90 | public function base() |
91 | 91 | { |
92 | 92 | $this->categorie->display(); |
@@ -96,17 +96,17 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | - * View controller for display a category |
|
100 | - * |
|
101 | - * @param int $cat_id The category ID |
|
102 | - * @param int $page Page number taken from the URL |
|
103 | - * @param int $sort_days Specifies the maximum amount of days a link may be old |
|
104 | - * @param string $sort_key is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p |
|
105 | - * @param string $sort_dir is either a or d representing ASC and DESC (ascending|descending) |
|
106 | - * @param string $mode watch|unwatch |
|
107 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
108 | - * @throws \phpbb\exception\http_exception |
|
109 | - */ |
|
99 | + * View controller for display a category |
|
100 | + * |
|
101 | + * @param int $cat_id The category ID |
|
102 | + * @param int $page Page number taken from the URL |
|
103 | + * @param int $sort_days Specifies the maximum amount of days a link may be old |
|
104 | + * @param string $sort_key is the key of $sort_by_sql for the selected sorting: a|t|r|s|v|p |
|
105 | + * @param string $sort_dir is either a or d representing ASC and DESC (ascending|descending) |
|
106 | + * @param string $mode watch|unwatch |
|
107 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
108 | + * @throws \phpbb\exception\http_exception |
|
109 | + */ |
|
110 | 110 | public function view($cat_id, $page, $sort_days, $sort_key, $sort_dir, $mode = '') |
111 | 111 | { |
112 | 112 | if (false === $this->categorie->get($cat_id)) |
@@ -366,11 +366,11 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | /** |
369 | - * date controller for return a date |
|
370 | - * |
|
371 | - * @return \phpbb\json_response A Json Response |
|
372 | - * @throws \phpbb\exception\http_exception |
|
373 | - */ |
|
369 | + * date controller for return a date |
|
370 | + * |
|
371 | + * @return \phpbb\json_response A Json Response |
|
372 | + * @throws \phpbb\exception\http_exception |
|
373 | + */ |
|
374 | 374 | public function return_date() |
375 | 375 | { |
376 | 376 | if (!$this->request->is_ajax()) |
@@ -64,16 +64,16 @@ discard block |
||
64 | 64 | */ |
65 | 65 | 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\pagination $pagination, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
66 | 66 | { |
67 | - $this->db = $db; |
|
68 | - $this->config = $config; |
|
67 | + $this->db = $db; |
|
68 | + $this->config = $config; |
|
69 | 69 | $this->language = $language; |
70 | 70 | $this->template = $template; |
71 | 71 | $this->user = $user; |
72 | - $this->helper = $helper; |
|
73 | - $this->request = $request; |
|
72 | + $this->helper = $helper; |
|
73 | + $this->request = $request; |
|
74 | 74 | $this->auth = $auth; |
75 | - $this->pagination = $pagination; |
|
76 | - $this->categorie = $categorie; |
|
75 | + $this->pagination = $pagination; |
|
76 | + $this->categorie = $categorie; |
|
77 | 77 | $this->link = $link; |
78 | 78 | |
79 | 79 | $language->add_lang('directory', 'ernadoo/phpbbdirectory'); |
@@ -117,18 +117,18 @@ discard block |
||
117 | 117 | |
118 | 118 | $start = ($page - 1) * $this->config['dir_show']; |
119 | 119 | |
120 | - $default_sort_days = 0; |
|
120 | + $default_sort_days = 0; |
|
121 | 121 | $default_sort_key = (string) substr($this->config['dir_default_order'], 0, 1); |
122 | 122 | $default_sort_dir = (string) substr($this->config['dir_default_order'], 2); |
123 | 123 | |
124 | 124 | $sort_days = (!$sort_days) ? $this->request->variable('st', $default_sort_days) : $sort_days; |
125 | 125 | $sort_key = (!$sort_key) ? $this->request->variable('sk', $default_sort_key) : $sort_key; |
126 | - $sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; |
|
126 | + $sort_dir = (!$sort_dir) ? $this->request->variable('sd', $default_sort_dir) : $sort_dir; |
|
127 | 127 | $link_list = $rowset = array(); |
128 | 128 | |
129 | 129 | // Categorie ordering options |
130 | 130 | $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')); |
131 | - $sort_by_text = array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' => $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); |
|
131 | + $sort_by_text = array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' => $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); |
|
132 | 132 | $sort_by_sql = array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'LOWER(l.link_name)', 'v' => 'l.link_view'); |
133 | 133 | |
134 | 134 | if ($this->config['dir_activ_pagerank']) |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | $min_post_time = time() - ($sort_days * 86400); |
168 | 168 | |
169 | 169 | $sql = 'SELECT COUNT(link_id) AS nb_links |
170 | - FROM ' . $this->links_table . ' |
|
171 | - WHERE link_cat = ' . (int) $cat_id . ' |
|
170 | + FROM ' . $this->links_table.' |
|
171 | + WHERE link_cat = ' . (int) $cat_id.' |
|
172 | 172 | AND link_time >= ' . $min_post_time; |
173 | 173 | $result = $this->db->sql_query($sql); |
174 | 174 | $nb_links = (int) $this->db->sql_fetchfield('nb_links'); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | else |
184 | 184 | { |
185 | 185 | $sql_limit_time = ''; |
186 | - $nb_links = (int) $this->categorie->data['cat_links']; |
|
186 | + $nb_links = (int) $this->categorie->data['cat_links']; |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | // Make sure $start is set to the last page if it exceeds the amount |
@@ -246,11 +246,11 @@ discard block |
||
246 | 246 | |
247 | 247 | if (is_array($sort_by_sql[$sort_key])) |
248 | 248 | { |
249 | - $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; |
|
249 | + $sql_sort_order = implode(' '.$direction.', ', $sort_by_sql[$sort_key]).' '.$direction; |
|
250 | 250 | } |
251 | 251 | else |
252 | 252 | { |
253 | - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; |
|
253 | + $sql_sort_order = $sort_by_sql[$sort_key].' '.$direction; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | // Grab just the sorted link ids |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | ), |
294 | 294 | array( |
295 | 295 | 'FROM' => array($this->votes_table => 'v'), |
296 | - 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = ' . $this->user->data['user_id'] |
|
296 | + 'ON' => 'l.link_id = v.vote_link_id AND v.vote_user_id = '.$this->user->data['user_id'] |
|
297 | 297 | ) |
298 | 298 | ), |
299 | 299 | 'WHERE' => $this->db->sql_in_set('l.link_id', $link_list) |
@@ -310,8 +310,8 @@ discard block |
||
310 | 310 | |
311 | 311 | $link_list = ($store_reverse) ? array_reverse($link_list) : $link_list; |
312 | 312 | |
313 | - $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
314 | - $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
313 | + $votes_status = ($this->categorie->data['cat_allow_votes']) ? true : false; |
|
314 | + $comments_status = ($this->categorie->data['cat_allow_comments']) ? true : false; |
|
315 | 315 | |
316 | 316 | foreach ($link_list as $link_id) |
317 | 317 | { |
@@ -321,11 +321,11 @@ discard block |
||
321 | 321 | $s_note = $this->link->display_note($site['link_note'], $site['link_vote'], $votes_status); |
322 | 322 | $s_thumb = $this->link->display_thumb($site); |
323 | 323 | $s_vote = $this->link->display_vote($site); |
324 | - $s_banner = $this->link->display_bann($site); |
|
325 | - $s_pr = $this->link->display_pagerank($site); |
|
326 | - $s_rss = $this->link->display_rss($site); |
|
324 | + $s_banner = $this->link->display_bann($site); |
|
325 | + $s_pr = $this->link->display_pagerank($site); |
|
326 | + $s_rss = $this->link->display_rss($site); |
|
327 | 327 | |
328 | - $edit_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir')))); |
|
328 | + $edit_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_edit_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_edit_dir')))); |
|
329 | 329 | $delete_allowed = ($this->user->data['is_registered'] && ($this->auth->acl_get('m_delete_dir') || ($this->user->data['user_id'] == $site['link_user_id'] && $this->auth->acl_get('u_delete_dir')))); |
330 | 330 | |
331 | 331 | $this->template->assign_block_vars('site', array( |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | $this->template->assign_block_vars('no_draw_link', array()); |
363 | 363 | } |
364 | 364 | |
365 | - $page_title = $this->language->lang('DIRECTORY') . ' - ' . $this->categorie->data['cat_name']; |
|
365 | + $page_title = $this->language->lang('DIRECTORY').' - '.$this->categorie->data['cat_name']; |
|
366 | 366 | |
367 | 367 | $this->categorie->display(); |
368 | 368 |
@@ -59,23 +59,23 @@ discard block |
||
59 | 59 | protected $php_ext; |
60 | 60 | |
61 | 61 | /** |
62 | - * Constructor |
|
63 | - * |
|
64 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
65 | - * @param \phpbb\config\config $config Config object |
|
66 | - * @param \phpbb\language\language $language Language object |
|
67 | - * @param \phpbb\template\template $template Template object |
|
68 | - * @param \phpbb\user $user User object |
|
69 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
70 | - * @param \phpbb\request\request $request Request object |
|
71 | - * @param \phpbb\auth\auth $auth Auth object |
|
72 | - * @param \phpbb\pagination $pagination Pagination object |
|
73 | - * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
74 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
75 | - * @param \ernadoo\phpbbdirectory\core\comment $comment PhpBB Directory extension comment object |
|
76 | - * @param string $root_path phpBB root path |
|
77 | - * @param string $php_ext phpEx |
|
78 | - */ |
|
62 | + * Constructor |
|
63 | + * |
|
64 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
65 | + * @param \phpbb\config\config $config Config object |
|
66 | + * @param \phpbb\language\language $language Language object |
|
67 | + * @param \phpbb\template\template $template Template object |
|
68 | + * @param \phpbb\user $user User object |
|
69 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
70 | + * @param \phpbb\request\request $request Request object |
|
71 | + * @param \phpbb\auth\auth $auth Auth object |
|
72 | + * @param \phpbb\pagination $pagination Pagination object |
|
73 | + * @param \phpbb\captcha\factory $captcha_factory Captcha object |
|
74 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
75 | + * @param \ernadoo\phpbbdirectory\core\comment $comment PhpBB Directory extension comment object |
|
76 | + * @param string $root_path phpBB root path |
|
77 | + * @param string $php_ext phpEx |
|
78 | + */ |
|
79 | 79 | 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\pagination $pagination, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\comment $comment, $root_path, $php_ext) |
80 | 80 | { |
81 | 81 | $this->db = $db; |
@@ -111,13 +111,13 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
114 | - * Populate form when an error occurred |
|
115 | - * |
|
116 | - * @param int $link_id The link ID |
|
117 | - * @param int $comment_id The comment ID |
|
118 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
119 | - * @throws \phpbb\exception\http_exception |
|
120 | - */ |
|
114 | + * Populate form when an error occurred |
|
115 | + * |
|
116 | + * @param int $link_id The link ID |
|
117 | + * @param int $comment_id The comment ID |
|
118 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
119 | + * @throws \phpbb\exception\http_exception |
|
120 | + */ |
|
121 | 121 | public function delete_comment($link_id, $comment_id) |
122 | 122 | { |
123 | 123 | $this->_check_comments_enable($link_id); |
@@ -156,13 +156,13 @@ discard block |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
159 | - * Edit a comment |
|
160 | - * |
|
161 | - * @param int $link_id The category ID |
|
162 | - * @param int $comment_id The comment ID |
|
163 | - * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
164 | - * @throws \phpbb\exception\http_exception |
|
165 | - */ |
|
159 | + * Edit a comment |
|
160 | + * |
|
161 | + * @param int $link_id The category ID |
|
162 | + * @param int $comment_id The comment ID |
|
163 | + * @return null|\Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
164 | + * @throws \phpbb\exception\http_exception |
|
165 | + */ |
|
166 | 166 | public function edit_comment($link_id, $comment_id) |
167 | 167 | { |
168 | 168 | $this->_check_comments_enable($link_id); |
@@ -193,12 +193,12 @@ discard block |
||
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
196 | - * Post a new comment |
|
197 | - * |
|
198 | - * @param int $link_id The category ID |
|
199 | - * @return null |
|
200 | - * @throws \phpbb\exception\http_exception |
|
201 | - */ |
|
196 | + * Post a new comment |
|
197 | + * |
|
198 | + * @param int $link_id The category ID |
|
199 | + * @return null |
|
200 | + * @throws \phpbb\exception\http_exception |
|
201 | + */ |
|
202 | 202 | public function new_comment($link_id) |
203 | 203 | { |
204 | 204 | $this->_check_comments_enable($link_id); |
@@ -224,14 +224,14 @@ discard block |
||
224 | 224 | } |
225 | 225 | |
226 | 226 | /** |
227 | - * Display popup comment |
|
228 | - * |
|
229 | - * @param int $link_id The category ID |
|
230 | - * @param int $page Page number taken from the URL |
|
231 | - * @param string $mode add|edit |
|
232 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
233 | - * @throws \phpbb\exception\http_exception |
|
234 | - */ |
|
227 | + * Display popup comment |
|
228 | + * |
|
229 | + * @param int $link_id The category ID |
|
230 | + * @param int $page Page number taken from the URL |
|
231 | + * @param string $mode add|edit |
|
232 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
233 | + * @throws \phpbb\exception\http_exception |
|
234 | + */ |
|
235 | 235 | public function view($link_id, $page, $mode = 'new') |
236 | 236 | { |
237 | 237 | $this->_check_comments_enable($link_id); |
@@ -324,13 +324,13 @@ discard block |
||
324 | 324 | } |
325 | 325 | |
326 | 326 | /** |
327 | - * Routine |
|
328 | - * |
|
329 | - * @param int $link_id The link ID |
|
330 | - * @param int $comment_id The comment ID |
|
331 | - * @param string $mode new|edit |
|
332 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
333 | - */ |
|
327 | + * Routine |
|
328 | + * |
|
329 | + * @param int $link_id The link ID |
|
330 | + * @param int $comment_id The comment ID |
|
331 | + * @param string $mode new|edit |
|
332 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
333 | + */ |
|
334 | 334 | private function _data_processing($link_id, $comment_id = 0, $mode = 'new') |
335 | 335 | { |
336 | 336 | if (!check_form_key('dir_form_comment')) |
@@ -418,12 +418,12 @@ discard block |
||
418 | 418 | } |
419 | 419 | |
420 | 420 | /** |
421 | - * Check if comments are enable in a category |
|
422 | - * |
|
423 | - * @param int $link_id The link ID |
|
424 | - * @return null Retun null if comments are allowed, http_exception if not |
|
425 | - * @throws \phpbb\exception\http_exception |
|
426 | - */ |
|
421 | + * Check if comments are enable in a category |
|
422 | + * |
|
423 | + * @param int $link_id The link ID |
|
424 | + * @return null Retun null if comments are allowed, http_exception if not |
|
425 | + * @throws \phpbb\exception\http_exception |
|
426 | + */ |
|
427 | 427 | private function _check_comments_enable($link_id) |
428 | 428 | { |
429 | 429 | $sql = 'SELECT link_cat |
@@ -449,12 +449,12 @@ discard block |
||
449 | 449 | } |
450 | 450 | |
451 | 451 | /** |
452 | - * Populate form when an error occurred |
|
453 | - * |
|
454 | - * @param int $link_id The link ID |
|
455 | - * @param string $mode add|edit |
|
456 | - * @return null |
|
457 | - */ |
|
452 | + * Populate form when an error occurred |
|
453 | + * |
|
454 | + * @param int $link_id The link ID |
|
455 | + * @param string $mode add|edit |
|
456 | + * @return null |
|
457 | + */ |
|
458 | 458 | private function _populate_form($link_id, $mode) |
459 | 459 | { |
460 | 460 | if (!$this->user->data['is_registered'] && $this->config['dir_visual_confirm'] && $mode != 'edit') |
@@ -191,7 +191,7 @@ |
||
191 | 191 | * Post a new comment |
192 | 192 | * |
193 | 193 | * @param int $link_id The category ID |
194 | - * @return null |
|
194 | + * @return \Symfony\Component\HttpFoundation\Response|null |
|
195 | 195 | * @throws \phpbb\exception\http_exception |
196 | 196 | */ |
197 | 197 | public function new_comment($link_id) |
@@ -80,16 +80,16 @@ discard block |
||
80 | 80 | */ |
81 | 81 | 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\pagination $pagination, \phpbb\captcha\factory $captcha_factory, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\comment $comment, $root_path, $php_ext) |
82 | 82 | { |
83 | - $this->db = $db; |
|
84 | - $this->config = $config; |
|
83 | + $this->db = $db; |
|
84 | + $this->config = $config; |
|
85 | 85 | $this->language = $language; |
86 | 86 | $this->template = $template; |
87 | 87 | $this->user = $user; |
88 | - $this->helper = $helper; |
|
89 | - $this->request = $request; |
|
88 | + $this->helper = $helper; |
|
89 | + $this->request = $request; |
|
90 | 90 | $this->auth = $auth; |
91 | - $this->pagination = $pagination; |
|
92 | - $this->captcha_factory = $captcha_factory; |
|
91 | + $this->pagination = $pagination; |
|
92 | + $this->captcha_factory = $captcha_factory; |
|
93 | 93 | $this->categorie = $categorie; |
94 | 94 | $this->comment = $comment; |
95 | 95 | $this->root_path = $root_path; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | $sql = 'SELECT * |
133 | - FROM ' . $this->comments_table . ' |
|
133 | + FROM ' . $this->comments_table.' |
|
134 | 134 | WHERE comment_id = ' . (int) $comment_id; |
135 | 135 | $result = $this->db->sql_query($sql); |
136 | 136 | $value = $this->db->sql_fetchrow($result); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id)); |
148 | 148 | meta_refresh(3, $meta_info); |
149 | 149 | $message = $this->language->lang('DIR_COMMENT_DELETE_OK'); |
150 | - $message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>'); |
|
150 | + $message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>'); |
|
151 | 151 | return $this->helper->message($message); |
152 | 152 | } |
153 | 153 | else |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $this->_check_comments_enable($link_id); |
170 | 170 | |
171 | 171 | $sql = 'SELECT * |
172 | - FROM ' . $this->comments_table . ' |
|
172 | + FROM ' . $this->comments_table.' |
|
173 | 173 | WHERE comment_id = ' . (int) $comment_id; |
174 | 174 | $result = $this->db->sql_query($sql); |
175 | 175 | $value = $this->db->sql_fetchrow($result); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $comment_text = generate_text_for_edit($value['comment_text'], $value['comment_uid'], $value['comment_flags']); |
183 | 183 | $this->s_comment = $comment_text['text']; |
184 | 184 | |
185 | - $submit = $this->request->is_set_post('update_comment') ? true : false; |
|
185 | + $submit = $this->request->is_set_post('update_comment') ? true : false; |
|
186 | 186 | |
187 | 187 | // If form is done |
188 | 188 | if ($submit) |
@@ -238,15 +238,15 @@ discard block |
||
238 | 238 | $this->_check_comments_enable($link_id); |
239 | 239 | |
240 | 240 | $comment_id = $this->request->variable('c', 0); |
241 | - $view = $this->request->variable('view', ''); |
|
242 | - $start = ($page - 1) * $this->config['dir_comments_per_page']; |
|
241 | + $view = $this->request->variable('view', ''); |
|
242 | + $start = ($page - 1) * $this->config['dir_comments_per_page']; |
|
243 | 243 | |
244 | 244 | $this->s_hidden_fields = array_merge($this->s_hidden_fields, array('page' => $page)); |
245 | 245 | |
246 | 246 | $this->_populate_form($link_id, $mode); |
247 | 247 | |
248 | 248 | $sql = 'SELECT COUNT(comment_id) AS nb_comments |
249 | - FROM ' . $this->comments_table . ' |
|
249 | + FROM ' . $this->comments_table.' |
|
250 | 250 | WHERE comment_link_id = ' . (int) $link_id; |
251 | 251 | $result = $this->db->sql_query($sql); |
252 | 252 | $nb_comments = (int) $this->db->sql_fetchfield('nb_comments'); |
@@ -266,10 +266,10 @@ discard block |
||
266 | 266 | ), |
267 | 267 | array( |
268 | 268 | 'FROM' => array(ZEBRA_TABLE => 'z'), |
269 | - 'ON' => 'z.user_id = ' . $this->user->data['user_id'] . ' AND z.zebra_id = a.comment_user_id' |
|
269 | + 'ON' => 'z.user_id = '.$this->user->data['user_id'].' AND z.zebra_id = a.comment_user_id' |
|
270 | 270 | ) |
271 | 271 | ), |
272 | - 'WHERE' => 'a.comment_link_id = ' . (int) $link_id, |
|
272 | + 'WHERE' => 'a.comment_link_id = '.(int) $link_id, |
|
273 | 273 | 'ORDER_BY' => 'a.comment_date DESC'); |
274 | 274 | $sql = $this->db->sql_build_query('SELECT', $sql_array); |
275 | 275 | $result = $this->db->sql_query_limit($sql, $this->config['dir_comments_per_page'], $start); |
@@ -298,12 +298,12 @@ discard block |
||
298 | 298 | 'S_COMMENT' => generate_text_for_display($comments['comment_text'], $comments['comment_uid'], $comments['comment_bitfield'], $comments['comment_flags']), |
299 | 299 | 'S_ID' => $comments['comment_id'], |
300 | 300 | |
301 | - 'U_EDIT' => ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '', |
|
302 | - 'U_DELETE' => ($delete_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '', |
|
301 | + 'U_EDIT' => ($edit_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_edit_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'])) : '', |
|
302 | + 'U_DELETE' => ($delete_allowed) ? $this->helper->route('ernadoo_phpbbdirectory_comment_delete_controller', array('link_id' => (int) $link_id, 'comment_id' => (int) $comments['comment_id'], '_referer' => $this->helper->get_current_url())) : '', |
|
303 | 303 | |
304 | 304 | 'S_IGNORE_POST' => ($comments['foe'] && ($view != 'show' || $comment_id != $comments['comment_id'])) ? true : false, |
305 | 305 | 'L_IGNORE_POST' => ($comments['foe']) ? $this->language->lang('POST_BY_FOE', get_username_string('full', $comments['comment_user_id'], $comments['username'], $comments['user_colour']), '<a href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', |
306 | - 'L_POST_DISPLAY' => ($comments['foe']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $comments['comment_id'] . '" href="' . $this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'] . '&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', |
|
306 | + 'L_POST_DISPLAY' => ($comments['foe']) ? $this->language->lang('POST_DISPLAY', '<a class="display_post" data-post-id="'.$comments['comment_id'].'" href="'.$this->helper->url('directory/link/'.$link_id.'/comment'.(($page > 1) ? '/'.$page : '').'?c='.(int) $comments['comment_id'].'&view=show#c'.(int) $comments['comment_id']).'">', '</a>') : '', |
|
307 | 307 | |
308 | 308 | 'S_INFO' => $this->auth->acl_get('m_info'), |
309 | 309 | )); |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | |
344 | 344 | if (!function_exists('validate_data')) |
345 | 345 | { |
346 | - include($this->root_path . 'includes/functions_user.' . $this->php_ext); |
|
346 | + include($this->root_path.'includes/functions_user.'.$this->php_ext); |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | $error = validate_data( |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $meta_info = $this->helper->route('ernadoo_phpbbdirectory_comment_view_controller', array('link_id' => (int) $link_id)); |
406 | 406 | meta_refresh(3, $meta_info); |
407 | 407 | $message = $this->language->lang('DIR_'.strtoupper($mode).'_COMMENT_OK'); |
408 | - $message = $message . '<br /><br />' . $this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="' . $meta_info . '">', '</a>'); |
|
408 | + $message = $message.'<br /><br />'.$this->language->lang('DIR_CLICK_RETURN_COMMENT', '<a href="'.$meta_info.'">', '</a>'); |
|
409 | 409 | return $this->helper->message($message); |
410 | 410 | } |
411 | 411 | else |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | private function _check_comments_enable($link_id) |
429 | 429 | { |
430 | 430 | $sql = 'SELECT link_cat |
431 | - FROM ' . $this->links_table . ' |
|
431 | + FROM ' . $this->links_table.' |
|
432 | 432 | WHERE link_id = ' . (int) $link_id; |
433 | 433 | $result = $this->db->sql_query($sql); |
434 | 434 | $cat_id = (int) $this->db->sql_fetchfield('link_cat'); |
@@ -470,11 +470,11 @@ discard block |
||
470 | 470 | |
471 | 471 | if (!function_exists('generate_smilies')) |
472 | 472 | { |
473 | - include($this->root_path . 'includes/functions_posting.' . $this->php_ext); |
|
473 | + include($this->root_path.'includes/functions_posting.'.$this->php_ext); |
|
474 | 474 | } |
475 | 475 | if (!function_exists('display_custom_bbcodes')) |
476 | 476 | { |
477 | - include($this->root_path . 'includes/functions_display.' . $this->php_ext); |
|
477 | + include($this->root_path.'includes/functions_display.'.$this->php_ext); |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | generate_smilies('inline', 0); |
@@ -484,11 +484,11 @@ discard block |
||
484 | 484 | $this->template->assign_vars(array( |
485 | 485 | 'S_AUTH_COMM' => $this->auth->acl_get('u_comment_dir'), |
486 | 486 | |
487 | - 'BBCODE_STATUS' => ($this->config['dir_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>'), |
|
488 | - 'IMG_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), |
|
489 | - 'SMILIES_STATUS' => ($this->config['dir_allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'), |
|
490 | - 'URL_STATUS' => ($this->config['dir_allow_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'), |
|
491 | - 'FLASH_STATUS' => ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), |
|
487 | + 'BBCODE_STATUS' => ($this->config['dir_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>'), |
|
488 | + 'IMG_STATUS' => ($this->config['dir_allow_bbcode']) ? $this->language->lang('IMAGES_ARE_ON') : $this->language->lang('IMAGES_ARE_OFF'), |
|
489 | + 'SMILIES_STATUS' => ($this->config['dir_allow_smilies']) ? $this->language->lang('SMILIES_ARE_ON') : $this->language->lang('SMILIES_ARE_OFF'), |
|
490 | + 'URL_STATUS' => ($this->config['dir_allow_links']) ? $this->language->lang('URL_IS_ON') : $this->language->lang('URL_IS_OFF'), |
|
491 | + 'FLASH_STATUS' => ($this->config['dir_allow_bbcode'] && $this->config['dir_allow_flash']) ? $this->language->lang('FLASH_IS_ON') : $this->language->lang('FLASH_IS_OFF'), |
|
492 | 492 | |
493 | 493 | 'L_DIR_REPLY_EXP' => $this->language->lang('DIR_REPLY_EXP', $this->config['dir_length_comments']), |
494 | 494 |
@@ -50,21 +50,21 @@ discard block |
||
50 | 50 | protected $link; |
51 | 51 | |
52 | 52 | /** |
53 | - * Constructor |
|
54 | - * |
|
55 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
56 | - * @param \phpbb\config\config $config Config object |
|
57 | - * @param \phpbb\language\language $language Language object |
|
58 | - * @param \phpbb\template\template $template Template object |
|
59 | - * @param \phpbb\user $user User object |
|
60 | - * @param \phpbb\controller\helper $helper Controller helper object |
|
61 | - * @param \phpbb\request\request $request Request object |
|
62 | - * @param \phpbb\auth\auth $auth Auth object |
|
63 | - * @param \phpbb\pagination $pagination Pagination object |
|
64 | - * @param \ernadoo\phpbbdirectory\search\fulltext_directory $search PhpBB Directory extension search object |
|
65 | - * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
66 | - * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
67 | - */ |
|
53 | + * Constructor |
|
54 | + * |
|
55 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
56 | + * @param \phpbb\config\config $config Config object |
|
57 | + * @param \phpbb\language\language $language Language object |
|
58 | + * @param \phpbb\template\template $template Template object |
|
59 | + * @param \phpbb\user $user User object |
|
60 | + * @param \phpbb\controller\helper $helper Controller helper object |
|
61 | + * @param \phpbb\request\request $request Request object |
|
62 | + * @param \phpbb\auth\auth $auth Auth object |
|
63 | + * @param \phpbb\pagination $pagination Pagination object |
|
64 | + * @param \ernadoo\phpbbdirectory\search\fulltext_directory $search PhpBB Directory extension search object |
|
65 | + * @param \ernadoo\phpbbdirectory\core\categorie $categorie PhpBB Directory extension categorie object |
|
66 | + * @param \ernadoo\phpbbdirectory\core\link $link PhpBB Directory extension link object |
|
67 | + */ |
|
68 | 68 | 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\pagination $pagination, \ernadoo\phpbbdirectory\search\fulltext_directory $search, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
69 | 69 | { |
70 | 70 | $this->db = $db; |
@@ -90,12 +90,12 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
93 | - * Search controller |
|
94 | - * |
|
95 | - * @param int $page Page number taken from the URL |
|
96 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
97 | - * @throws \phpbb\exception\http_exception |
|
98 | - */ |
|
93 | + * Search controller |
|
94 | + * |
|
95 | + * @param int $page Page number taken from the URL |
|
96 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object |
|
97 | + * @throws \phpbb\exception\http_exception |
|
98 | + */ |
|
99 | 99 | public function main($page) |
100 | 100 | { |
101 | 101 | if (!$this->auth->acl_get('u_search_dir')) |
@@ -319,11 +319,11 @@ discard block |
||
319 | 319 | } |
320 | 320 | |
321 | 321 | /** |
322 | - * |
|
323 | - * @param array $search_category |
|
324 | - * @param bool $search_child |
|
325 | - * @return array Categories to exclude from search |
|
326 | - */ |
|
322 | + * |
|
323 | + * @param array $search_category |
|
324 | + * @param bool $search_child |
|
325 | + * @return array Categories to exclude from search |
|
326 | + */ |
|
327 | 327 | private function _get_exclude_categories(&$search_category, $search_child) |
328 | 328 | { |
329 | 329 | $sql = 'SELECT cat_id, parent_id, right_id |
@@ -69,18 +69,18 @@ discard block |
||
69 | 69 | */ |
70 | 70 | 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\pagination $pagination, \ernadoo\phpbbdirectory\search\fulltext_directory $search, \ernadoo\phpbbdirectory\core\categorie $categorie, \ernadoo\phpbbdirectory\core\link $link) |
71 | 71 | { |
72 | - $this->db = $db; |
|
73 | - $this->config = $config; |
|
72 | + $this->db = $db; |
|
73 | + $this->config = $config; |
|
74 | 74 | $this->language = $language; |
75 | 75 | $this->template = $template; |
76 | 76 | $this->user = $user; |
77 | - $this->helper = $helper; |
|
78 | - $this->request = $request; |
|
77 | + $this->helper = $helper; |
|
78 | + $this->request = $request; |
|
79 | 79 | $this->auth = $auth; |
80 | - $this->pagination = $pagination; |
|
81 | - $this->search = $search; |
|
82 | - $this->categorie = $categorie; |
|
83 | - $this->link = $link; |
|
80 | + $this->pagination = $pagination; |
|
81 | + $this->search = $search; |
|
82 | + $this->categorie = $categorie; |
|
83 | + $this->link = $link; |
|
84 | 84 | |
85 | 85 | $language->add_lang('directory', 'ernadoo/phpbbdirectory'); |
86 | 86 | $language->add_lang('search'); |
@@ -104,24 +104,24 @@ discard block |
||
104 | 104 | throw new \phpbb\exception\http_exception(403, 'DIR_ERROR_NOT_AUTH'); |
105 | 105 | } |
106 | 106 | |
107 | - $cat_id = $this->request->variable('cat_id', 0); |
|
108 | - $keywords = $this->request->variable('keywords', '', true); |
|
107 | + $cat_id = $this->request->variable('cat_id', 0); |
|
108 | + $keywords = $this->request->variable('keywords', '', true); |
|
109 | 109 | $search_terms = $this->request->variable('terms', 'all'); |
110 | - $search_category = $this->request->variable('cid', array(0)); |
|
111 | - $search_fields = $this->request->variable('sf', 'all'); |
|
110 | + $search_category = $this->request->variable('cid', array(0)); |
|
111 | + $search_fields = $this->request->variable('sf', 'all'); |
|
112 | 112 | $search_child = $this->request->variable('sc', true); |
113 | - $sort_days = $this->request->variable('st', 0); |
|
113 | + $sort_days = $this->request->variable('st', 0); |
|
114 | 114 | $sort_key = $this->request->variable('sk', 't'); |
115 | 115 | $sort_dir = $this->request->variable('sd', 'd'); |
116 | - $start = ($page - 1) * (int) $this->config['dir_show']; |
|
116 | + $start = ($page - 1) * (int) $this->config['dir_show']; |
|
117 | 117 | |
118 | - $default_sort_days = 0; |
|
118 | + $default_sort_days = 0; |
|
119 | 119 | $default_sort_key = (string) substr($this->config['dir_default_order'], 0, 1); |
120 | 120 | $default_sort_dir = (string) substr($this->config['dir_default_order'], 2); |
121 | 121 | |
122 | 122 | // Categorie ordering options |
123 | 123 | $limit_days = array(0 => $this->language->lang('ALL_RESULTS'), 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')); |
124 | - $sort_by_text = array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' => $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); |
|
124 | + $sort_by_text = array('a' => $this->language->lang('AUTHOR'), 't' => $this->language->lang('POST_TIME'), 'r' => $this->language->lang('DIR_COMMENTS_ORDER'), 's' => $this->language->lang('DIR_NAME_ORDER'), 'v' => $this->language->lang('DIR_NB_CLICKS_ORDER')); |
|
125 | 125 | $sort_by_sql = array('a' => 'u.username_clean', 't' => array('l.link_time', 'l.link_id'), 'r' => 'l.link_comment', 's' => 'LOWER(l.link_name)', 'v' => 'l.link_view'); |
126 | 126 | |
127 | 127 | if ($this->config['dir_activ_pagerank']) |
@@ -170,12 +170,12 @@ discard block |
||
170 | 170 | |
171 | 171 | $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); |
172 | 172 | |
173 | - ($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : ''; |
|
174 | - ($search_terms != 'all') ? $u_search['terms'] = $search_terms : ''; |
|
175 | - ($cat_id) ? $u_search['cat_id'] = $cat_id : ''; |
|
176 | - ($search_category) ? $u_search['cid'] = $search_category : ''; |
|
177 | - (!$search_child) ? $u_search['sc'] = 0 : ''; |
|
178 | - ($search_fields != 'all') ? $u_search['sf'] = $search_fields : ''; |
|
173 | + ($u_hilit) ? $u_search['keywords'] = urlencode(htmlspecialchars_decode($keywords)) : ''; |
|
174 | + ($search_terms != 'all') ? $u_search['terms'] = $search_terms : ''; |
|
175 | + ($cat_id) ? $u_search['cat_id'] = $cat_id : ''; |
|
176 | + ($search_category) ? $u_search['cid'] = $search_category : ''; |
|
177 | + (!$search_child) ? $u_search['sc'] = 0 : ''; |
|
178 | + ($search_fields != 'all') ? $u_search['sf'] = $search_fields : ''; |
|
179 | 179 | |
180 | 180 | $base_url = array( |
181 | 181 | 'routes' => 'ernadoo_phpbbdirectory_search_controller', |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | foreach ($rowset as $data) |
251 | 251 | { |
252 | - $s_banner = $this->link->display_bann($data); |
|
252 | + $s_banner = $this->link->display_bann($data); |
|
253 | 253 | $s_thumb = $this->link->display_thumb($data); |
254 | 254 | $s_flag = $this->link->display_flag($data); |
255 | 255 | |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | |
258 | 258 | if ($hilit) |
259 | 259 | { |
260 | - $data['link_name'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']); |
|
261 | - $data['link_description'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']); |
|
260 | + $data['link_name'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_name']); |
|
261 | + $data['link_description'] = preg_replace('#(?!<.*)(?<!\w)('.$hilit.')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#isu', '<span class="posthilit">$1</span>', $data['link_description']); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | $this->template->assign_block_vars('results', array( |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | private function _get_exclude_categories(&$search_category, $search_child) |
329 | 329 | { |
330 | 330 | $sql = 'SELECT cat_id, parent_id, right_id |
331 | - FROM ' . $this->categories_table . ' |
|
331 | + FROM ' . $this->categories_table.' |
|
332 | 332 | ORDER BY left_id'; |
333 | 333 | $result = $this->db->sql_query($sql); |
334 | 334 |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | protected $language; |
23 | 23 | |
24 | 24 | /** |
25 | - * Constructor |
|
26 | - * |
|
27 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
28 | - * @param \phpbb\language\language $language Language object |
|
29 | - */ |
|
25 | + * Constructor |
|
26 | + * |
|
27 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
28 | + * @param \phpbb\language\language $language Language object |
|
29 | + */ |
|
30 | 30 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language) |
31 | 31 | { |
32 | 32 | $this->db = $db; |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | - * Add a comment |
|
38 | - * |
|
39 | - * @param array $data Link's data from db |
|
40 | - * @return null |
|
41 | - */ |
|
37 | + * Add a comment |
|
38 | + * |
|
39 | + * @param array $data Link's data from db |
|
40 | + * @return null |
|
41 | + */ |
|
42 | 42 | public function add($data) |
43 | 43 | { |
44 | 44 | $this->db->sql_transaction('begin'); |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * Edit a comment |
|
59 | - * |
|
60 | - * @param array $data Data to edit |
|
61 | - * @param int $comment_id The comment ID |
|
62 | - * @return null |
|
63 | - */ |
|
58 | + * Edit a comment |
|
59 | + * |
|
60 | + * @param array $data Data to edit |
|
61 | + * @param int $comment_id The comment ID |
|
62 | + * @return null |
|
63 | + */ |
|
64 | 64 | public function edit($data, $comment_id) |
65 | 65 | { |
66 | 66 | $sql = 'UPDATE ' . DIR_COMMENT_TABLE . ' |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
73 | - * Delete a comment |
|
74 | - * |
|
75 | - * @param string $link_id The link ID |
|
76 | - * @param string $comment_id The comment ID |
|
77 | - * @return null |
|
78 | - */ |
|
73 | + * Delete a comment |
|
74 | + * |
|
75 | + * @param string $link_id The link ID |
|
76 | + * @param string $comment_id The comment ID |
|
77 | + * @return null |
|
78 | + */ |
|
79 | 79 | public function del($link_id, $comment_id) |
80 | 80 | { |
81 | 81 | global $request; |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language) |
30 | 30 | { |
31 | - $this->db = $db; |
|
32 | - $this->language = $language; |
|
31 | + $this->db = $db; |
|
32 | + $this->language = $language; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | { |
43 | 43 | $this->db->sql_transaction('begin'); |
44 | 44 | |
45 | - $sql = 'INSERT INTO ' . $this->comments_table . ' ' . $this->db->sql_build_array('INSERT', $data); |
|
45 | + $sql = 'INSERT INTO '.$this->comments_table.' '.$this->db->sql_build_array('INSERT', $data); |
|
46 | 46 | $this->db->sql_query($sql); |
47 | 47 | |
48 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
48 | + $sql = 'UPDATE '.$this->links_table.' |
|
49 | 49 | SET link_comment = link_comment + 1 |
50 | 50 | WHERE link_id = ' . (int) $data['comment_link_id']; |
51 | 51 | $this->db->sql_query($sql); |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function edit($data, $comment_id) |
64 | 64 | { |
65 | - $sql = 'UPDATE ' . $this->comments_table . ' |
|
66 | - SET ' . $this->db->sql_build_array('UPDATE', $data) . ' |
|
65 | + $sql = 'UPDATE '.$this->comments_table.' |
|
66 | + SET ' . $this->db->sql_build_array('UPDATE', $data).' |
|
67 | 67 | WHERE comment_id = ' . (int) $comment_id; |
68 | 68 | $this->db->sql_query($sql); |
69 | 69 | } |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | $this->db->sql_transaction('begin'); |
83 | 83 | |
84 | - $sql = 'DELETE FROM ' . $this->comments_table . ' WHERE comment_id = ' . (int) $comment_id; |
|
84 | + $sql = 'DELETE FROM '.$this->comments_table.' WHERE comment_id = '.(int) $comment_id; |
|
85 | 85 | $this->db->sql_query($sql); |
86 | 86 | |
87 | - $sql = 'UPDATE ' . $this->links_table . ' |
|
87 | + $sql = 'UPDATE '.$this->links_table.' |
|
88 | 88 | SET link_comment = link_comment - 1 |
89 | 89 | WHERE link_id = ' . (int) $link_id; |
90 | 90 | $this->db->sql_query($sql); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | if ($request->is_ajax()) |
95 | 95 | { |
96 | 96 | $sql = 'SELECT COUNT(comment_id) AS nb_comments |
97 | - FROM ' . $this->comments_table . ' |
|
97 | + FROM ' . $this->comments_table.' |
|
98 | 98 | WHERE comment_link_id = ' . (int) $link_id; |
99 | 99 | $result = $this->db->sql_query($sql); |
100 | 100 | $nb_comments = (int) $this->db->sql_fetchfield('nb_comments'); |
@@ -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 | } |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | private $cat_data; |
29 | 29 | |
30 | 30 | /** |
31 | - * Constructor. |
|
32 | - * |
|
33 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
34 | - * @param \phpbb\config\config $config Config object |
|
35 | - * @param \ernadoo\phpbbdirectory\core\cron $directory_cron PhpBB Directory extension link object |
|
36 | - * @param string $php_ext phpEx |
|
37 | - */ |
|
31 | + * Constructor. |
|
32 | + * |
|
33 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
34 | + * @param \phpbb\config\config $config Config object |
|
35 | + * @param \ernadoo\phpbbdirectory\core\cron $directory_cron PhpBB Directory extension link object |
|
36 | + * @param string $php_ext phpEx |
|
37 | + */ |
|
38 | 38 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \ernadoo\phpbbdirectory\core\cron $directory_cron, $php_ext) |
39 | 39 | { |
40 | 40 | $this->db = $db; |
@@ -44,66 +44,66 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * Manually set categorie data. |
|
48 | - * |
|
49 | - * @param array $cat_data Information about a category to be pruned. |
|
50 | - */ |
|
47 | + * Manually set categorie data. |
|
48 | + * |
|
49 | + * @param array $cat_data Information about a category to be pruned. |
|
50 | + */ |
|
51 | 51 | public function set_categorie_data($cat_data) |
52 | 52 | { |
53 | 53 | $this->cat_data = $cat_data; |
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | - * Runs this cron task. |
|
58 | - * |
|
59 | - * @return null |
|
60 | - */ |
|
57 | + * Runs this cron task. |
|
58 | + * |
|
59 | + * @return null |
|
60 | + */ |
|
61 | 61 | public function run() |
62 | 62 | { |
63 | 63 | $this->dir_cron->auto_check($this->cat_data); |
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | - * Returns whether this cron task can run, given current board configuration. |
|
68 | - * |
|
69 | - * @return bool |
|
70 | - */ |
|
67 | + * Returns whether this cron task can run, given current board configuration. |
|
68 | + * |
|
69 | + * @return bool |
|
70 | + */ |
|
71 | 71 | public function is_runnable() |
72 | 72 | { |
73 | 73 | return !$this->config['use_system_cron'] && !empty($this->cat_data); |
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
77 | - * Returns whether this cron task should run now, because enough time |
|
78 | - * has passed since it was last run. |
|
79 | - * |
|
80 | - * @return bool |
|
81 | - */ |
|
77 | + * Returns whether this cron task should run now, because enough time |
|
78 | + * has passed since it was last run. |
|
79 | + * |
|
80 | + * @return bool |
|
81 | + */ |
|
82 | 82 | public function should_run() |
83 | 83 | { |
84 | 84 | return $this->cat_data['cat_cron_enable'] && $this->cat_data['cat_cron_next'] < time(); |
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | - * Returns parameters of this cron task as an array. |
|
89 | - * The array has one key, c, whose value is id of the category to be pruned. |
|
90 | - * |
|
91 | - * @return array |
|
92 | - */ |
|
88 | + * Returns parameters of this cron task as an array. |
|
89 | + * The array has one key, c, whose value is id of the category to be pruned. |
|
90 | + * |
|
91 | + * @return array |
|
92 | + */ |
|
93 | 93 | public function get_parameters() |
94 | 94 | { |
95 | 95 | return array('c' => $this->cat_data['cat_id']); |
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | - * Parses parameters found in $request, which is an instance of |
|
100 | - * \phpbb\request\request_interface. |
|
101 | - * |
|
102 | - * It is expected to have a key f whose value is id of the forum to be pruned. |
|
103 | - * |
|
104 | - * @param \phpbb\request\request_interface $request Request object. |
|
105 | - * @return null |
|
106 | - */ |
|
99 | + * Parses parameters found in $request, which is an instance of |
|
100 | + * \phpbb\request\request_interface. |
|
101 | + * |
|
102 | + * It is expected to have a key f whose value is id of the forum to be pruned. |
|
103 | + * |
|
104 | + * @param \phpbb\request\request_interface $request Request object. |
|
105 | + * @return null |
|
106 | + */ |
|
107 | 107 | public function parse_parameters(\phpbb\request\request_interface $request) |
108 | 108 | { |
109 | 109 | $this->cat_data = array(); |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | class convert_module extends \phpbb\db\migration\migration |
17 | 17 | { |
18 | 18 | /** |
19 | - * Skip this migration if an ACP_DIRECTORY module does not exist |
|
20 | - * |
|
21 | - * @return bool True if table does not exist |
|
22 | - * @access public |
|
23 | - */ |
|
19 | + * Skip this migration if an ACP_DIRECTORY module does not exist |
|
20 | + * |
|
21 | + * @return bool True if table does not exist |
|
22 | + * @access public |
|
23 | + */ |
|
24 | 24 | public function effectively_installed() |
25 | 25 | { |
26 | 26 | $sql = 'SELECT module_id |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | - * Add or update data in the database |
|
41 | - * |
|
42 | - * @return array Array of table data |
|
43 | - * @access public |
|
44 | - */ |
|
40 | + * Add or update data in the database |
|
41 | + * |
|
42 | + * @return array Array of table data |
|
43 | + * @access public |
|
44 | + */ |
|
45 | 45 | public function update_data() |
46 | 46 | { |
47 | 47 | return array( |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public function effectively_installed() |
25 | 25 | { |
26 | 26 | $sql = 'SELECT module_id |
27 | - FROM ' . $this->table_prefix . "modules |
|
27 | + FROM ' . $this->table_prefix."modules |
|
28 | 28 | WHERE module_class = 'acp' |
29 | 29 | AND module_basename = 'acp_directory' |
30 | 30 | AND module_mode = 'main'"; |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | 'module_auth' => 'ext_ernadoo/phpbbdirectory' |
57 | 57 | ); |
58 | 58 | |
59 | - $sql = 'UPDATE ' . $this->table_prefix . 'modules |
|
60 | - SET ' . $this->db->sql_build_array('UPDATE', $module_data) . " |
|
59 | + $sql = 'UPDATE '.$this->table_prefix.'modules |
|
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')"; |
63 | 63 | $this->db->sql_query($sql); |