@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | |
276 | 276 | /** |
277 | 277 | * Add file list to Object after sftp connect |
278 | - * @return void|Object |
|
278 | + * @return Object|null |
|
279 | 279 | */ |
280 | 280 | function getSFTPList() |
281 | 281 | { |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | |
317 | 317 | /** |
318 | 318 | * Add file list to Object after ftp connect |
319 | - * @return void|Object |
|
319 | + * @return Object|null |
|
320 | 320 | */ |
321 | 321 | function getAdminFTPList() |
322 | 322 | { |
@@ -867,6 +867,7 @@ discard block |
||
867 | 867 | * Returns a list of all sites that contain modules |
868 | 868 | * For each site domain and site_srl are retrieved |
869 | 869 | * |
870 | + * @param string $domain |
|
870 | 871 | * @return array |
871 | 872 | */ |
872 | 873 | function getAllSitesThatHaveModules($domain = NULL) |
@@ -945,6 +946,11 @@ discard block |
||
945 | 946 | return $this->iconUrlCheck('mobicon.png', 'mobiconSample.png', $default); |
946 | 947 | } |
947 | 948 | |
949 | + /** |
|
950 | + * @param string $iconname |
|
951 | + * @param string $default_icon_name |
|
952 | + * @param boolean $default |
|
953 | + */ |
|
948 | 954 | function iconUrlCheck($iconname, $default_icon_name, $default) |
949 | 955 | { |
950 | 956 | $site_info = Context::get('site_module_info'); |
@@ -956,10 +956,10 @@ |
||
956 | 956 | |
957 | 957 | $file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname); |
958 | 958 | if(!$file_exsit && $default === true) |
959 | - { |
|
960 | - $icon_url = './modules/admin/tpl/img/' . $default_icon_name; |
|
961 | - } |
|
962 | - elseif($file_exsit) |
|
959 | + { |
|
960 | + $icon_url = './modules/admin/tpl/img/' . $default_icon_name; |
|
961 | + } |
|
962 | + elseif($file_exsit) |
|
963 | 963 | { |
964 | 964 | $default_url = Context::getDefaultUrl(); |
965 | 965 | $icon_url = $default_url . 'files/attach/xeicon/' . $virtual_site . $iconname; |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | { |
31 | 31 | $ftp_info = Context::getRequestVars(); |
32 | 32 | |
33 | - if(!$ftp_info->ftp_host) |
|
33 | + if (!$ftp_info->ftp_host) |
|
34 | 34 | { |
35 | 35 | $ftp_info->ftp_host = "127.0.0.1"; |
36 | 36 | } |
37 | 37 | |
38 | - if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
38 | + if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
39 | 39 | { |
40 | 40 | $ftp_info->ftp_port = '22'; |
41 | 41 | } |
42 | 42 | |
43 | 43 | $connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port); |
44 | - if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
44 | + if (!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
45 | 45 | { |
46 | 46 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
47 | 47 | } |
@@ -58,17 +58,17 @@ discard block |
||
58 | 58 | $path_candidate = array(); |
59 | 59 | |
60 | 60 | $temp = ''; |
61 | - foreach($path_info as $path) |
|
61 | + foreach ($path_info as $path) |
|
62 | 62 | { |
63 | 63 | $temp = '/' . $path . $temp; |
64 | 64 | $path_candidate[] = $temp; |
65 | 65 | } |
66 | 66 | |
67 | 67 | // try |
68 | - foreach($path_candidate as $path) |
|
68 | + foreach ($path_candidate as $path) |
|
69 | 69 | { |
70 | 70 | // upload check file |
71 | - if(!@ssh2_scp_send($connection, FileHandler::getRealPath('./files/cache/ftp_check'), $path . 'ftp_check.html')) |
|
71 | + if (!@ssh2_scp_send($connection, FileHandler::getRealPath('./files/cache/ftp_check'), $path . 'ftp_check.html')) |
|
72 | 72 | { |
73 | 73 | continue; |
74 | 74 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | @ssh2_sftp_unlink($sftp, $path . 'ftp_check.html'); |
81 | 81 | |
82 | 82 | // found |
83 | - if($result == $pin) |
|
83 | + if ($result == $pin) |
|
84 | 84 | { |
85 | 85 | $found_path = $path; |
86 | 86 | break; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | FileHandler::removeFile('./files/cache/ftp_check', $pin); |
91 | 91 | |
92 | - if($found_path) |
|
92 | + if ($found_path) |
|
93 | 93 | { |
94 | 94 | $this->add('found_path', $found_path); |
95 | 95 | } |
@@ -99,24 +99,24 @@ discard block |
||
99 | 99 | { |
100 | 100 | $ftp_info = Context::getRequestVars(); |
101 | 101 | |
102 | - if(!$ftp_info->ftp_host) |
|
102 | + if (!$ftp_info->ftp_host) |
|
103 | 103 | { |
104 | 104 | $ftp_info->ftp_host = "127.0.0.1"; |
105 | 105 | } |
106 | 106 | |
107 | - if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
107 | + if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
108 | 108 | { |
109 | 109 | $ftp_info->ftp_port = '22'; |
110 | 110 | } |
111 | 111 | |
112 | 112 | $connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port); |
113 | - if(!$connection) |
|
113 | + if (!$connection) |
|
114 | 114 | { |
115 | 115 | return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_host)); |
116 | 116 | } |
117 | 117 | |
118 | 118 | $login_result = @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password); |
119 | - if(!$login_result) |
|
119 | + if (!$login_result) |
|
120 | 120 | { |
121 | 121 | ftp_close($connection); |
122 | 122 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
@@ -133,17 +133,17 @@ discard block |
||
133 | 133 | $path_candidate = array(); |
134 | 134 | |
135 | 135 | $temp = ''; |
136 | - foreach($path_info as $path) |
|
136 | + foreach ($path_info as $path) |
|
137 | 137 | { |
138 | 138 | $temp = '/' . $path . $temp; |
139 | 139 | $path_candidate[] = $temp; |
140 | 140 | } |
141 | 141 | |
142 | 142 | // try |
143 | - foreach($path_candidate as $path) |
|
143 | + foreach ($path_candidate as $path) |
|
144 | 144 | { |
145 | 145 | // upload check file |
146 | - if(!ftp_put($connection, $path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'), FTP_BINARY)) |
|
146 | + if (!ftp_put($connection, $path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'), FTP_BINARY)) |
|
147 | 147 | { |
148 | 148 | continue; |
149 | 149 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | ftp_delete($connection, $path . 'ftp_check.html'); |
156 | 156 | |
157 | 157 | // found |
158 | - if($result == $pin) |
|
158 | + if ($result == $pin) |
|
159 | 159 | { |
160 | 160 | $found_path = $path; |
161 | 161 | break; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | FileHandler::removeFile('./files/cache/ftp_check', $pin); |
166 | 166 | |
167 | - if($found_path) |
|
167 | + if ($found_path) |
|
168 | 168 | { |
169 | 169 | $this->add('found_path', $found_path); |
170 | 170 | } |
@@ -181,33 +181,33 @@ discard block |
||
181 | 181 | |
182 | 182 | $ftp_info = Context::getRequestVars(); |
183 | 183 | |
184 | - if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) |
|
184 | + if (!$ftp_info->ftp_user || !$ftp_info->ftp_password) |
|
185 | 185 | { |
186 | 186 | return new Object(1, 'msg_ftp_invalid_auth_info'); |
187 | 187 | } |
188 | 188 | |
189 | - if(!$ftp_info->ftp_host) |
|
189 | + if (!$ftp_info->ftp_host) |
|
190 | 190 | { |
191 | 191 | $ftp_info->ftp_host = '127.0.0.1'; |
192 | 192 | } |
193 | 193 | |
194 | - if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
194 | + if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
195 | 195 | { |
196 | 196 | $ftp_info->ftp_port = '21'; |
197 | 197 | } |
198 | 198 | |
199 | - if($ftp_info->sftp == 'Y') |
|
199 | + if ($ftp_info->sftp == 'Y') |
|
200 | 200 | { |
201 | - if(!function_exists('ssh2_sftp')) |
|
201 | + if (!function_exists('ssh2_sftp')) |
|
202 | 202 | { |
203 | 203 | return new Object(-1, 'disable_sftp_support'); |
204 | 204 | } |
205 | 205 | return $this->getSFTPPath(); |
206 | 206 | } |
207 | 207 | |
208 | - if($ftp_info->ftp_pasv == 'N') |
|
208 | + if ($ftp_info->ftp_pasv == 'N') |
|
209 | 209 | { |
210 | - if(function_exists('ftp_connect')) |
|
210 | + if (function_exists('ftp_connect')) |
|
211 | 211 | { |
212 | 212 | return $this->getFTPPath(); |
213 | 213 | } |
@@ -215,12 +215,12 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | $oFTP = new ftp(); |
218 | - if(!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) |
|
218 | + if (!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) |
|
219 | 219 | { |
220 | 220 | return new Object(1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_info->ftp_host)); |
221 | 221 | } |
222 | 222 | |
223 | - if(!$oFTP->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
223 | + if (!$oFTP->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
224 | 224 | { |
225 | 225 | return new Object(1, 'msg_ftp_invalid_auth_info'); |
226 | 226 | } |
@@ -236,17 +236,17 @@ discard block |
||
236 | 236 | $path_candidate = array(); |
237 | 237 | |
238 | 238 | $temp = ''; |
239 | - foreach($path_info as $path) |
|
239 | + foreach ($path_info as $path) |
|
240 | 240 | { |
241 | 241 | $temp = '/' . $path . $temp; |
242 | 242 | $path_candidate[] = $temp; |
243 | 243 | } |
244 | 244 | |
245 | 245 | // try |
246 | - foreach($path_candidate as $path) |
|
246 | + foreach ($path_candidate as $path) |
|
247 | 247 | { |
248 | 248 | // upload check file |
249 | - if(!$oFTP->ftp_put($path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'))) |
|
249 | + if (!$oFTP->ftp_put($path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'))) |
|
250 | 250 | { |
251 | 251 | continue; |
252 | 252 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $oFTP->ftp_delete($path . 'ftp_check.html'); |
259 | 259 | |
260 | 260 | // found |
261 | - if($result == $pin) |
|
261 | + if ($result == $pin) |
|
262 | 262 | { |
263 | 263 | $found_path = $path; |
264 | 264 | break; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | FileHandler::removeFile('./files/cache/ftp_check', $pin); |
269 | 269 | |
270 | - if($found_path) |
|
270 | + if ($found_path) |
|
271 | 271 | { |
272 | 272 | $this->add('found_path', $found_path); |
273 | 273 | } |
@@ -280,12 +280,12 @@ discard block |
||
280 | 280 | function getSFTPList() |
281 | 281 | { |
282 | 282 | $ftp_info = Context::getRequestVars(); |
283 | - if(!$ftp_info->ftp_host) |
|
283 | + if (!$ftp_info->ftp_host) |
|
284 | 284 | { |
285 | 285 | $ftp_info->ftp_host = "127.0.0.1"; |
286 | 286 | } |
287 | 287 | $connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port); |
288 | - if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
288 | + if (!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
289 | 289 | { |
290 | 290 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
291 | 291 | } |
@@ -293,14 +293,14 @@ discard block |
||
293 | 293 | $sftp = ssh2_sftp($connection); |
294 | 294 | $curpwd = "ssh2.sftp://$sftp" . $this->pwd; |
295 | 295 | $dh = @opendir($curpwd); |
296 | - if(!$dh) |
|
296 | + if (!$dh) |
|
297 | 297 | { |
298 | 298 | return new Object(-1, 'msg_ftp_invalid_path'); |
299 | 299 | } |
300 | 300 | $list = array(); |
301 | - while(($file = readdir($dh)) !== FALSE) |
|
301 | + while (($file = readdir($dh)) !== FALSE) |
|
302 | 302 | { |
303 | - if(is_dir($curpwd . $file)) |
|
303 | + if (is_dir($curpwd . $file)) |
|
304 | 304 | { |
305 | 305 | $file .= "/"; |
306 | 306 | } |
@@ -326,26 +326,26 @@ discard block |
||
326 | 326 | require_once(_XE_PATH_ . 'libs/ftp.class.php'); |
327 | 327 | |
328 | 328 | $ftp_info = Context::getRequestVars(); |
329 | - if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) |
|
329 | + if (!$ftp_info->ftp_user || !$ftp_info->ftp_password) |
|
330 | 330 | { |
331 | 331 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
332 | 332 | } |
333 | 333 | |
334 | 334 | $this->pwd = $ftp_info->ftp_root_path; |
335 | 335 | |
336 | - if(!$ftp_info->ftp_host) |
|
336 | + if (!$ftp_info->ftp_host) |
|
337 | 337 | { |
338 | 338 | $ftp_info->ftp_host = "127.0.0.1"; |
339 | 339 | } |
340 | 340 | |
341 | - if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
341 | + if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
342 | 342 | { |
343 | 343 | $ftp_info->ftp_port = "21"; |
344 | 344 | } |
345 | 345 | |
346 | - if($ftp_info->sftp == 'Y') |
|
346 | + if ($ftp_info->sftp == 'Y') |
|
347 | 347 | { |
348 | - if(!function_exists('ssh2_sftp')) |
|
348 | + if (!function_exists('ssh2_sftp')) |
|
349 | 349 | { |
350 | 350 | return new Object(-1, 'disable_sftp_support'); |
351 | 351 | } |
@@ -353,9 +353,9 @@ discard block |
||
353 | 353 | } |
354 | 354 | |
355 | 355 | $oFtp = new ftp(); |
356 | - if($oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) |
|
356 | + if ($oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) |
|
357 | 357 | { |
358 | - if($oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
358 | + if ($oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
359 | 359 | { |
360 | 360 | $_list = $oFtp->ftp_rawlist($this->pwd); |
361 | 361 | $oFtp->ftp_quit(); |
@@ -367,15 +367,15 @@ discard block |
||
367 | 367 | } |
368 | 368 | $list = array(); |
369 | 369 | |
370 | - if($_list) |
|
370 | + if ($_list) |
|
371 | 371 | { |
372 | - foreach($_list as $k => $v) |
|
372 | + foreach ($_list as $k => $v) |
|
373 | 373 | { |
374 | 374 | $src = new stdClass(); |
375 | 375 | $src->data = $v; |
376 | 376 | $res = Context::convertEncoding($src); |
377 | 377 | $v = $res->data; |
378 | - if(strpos($v, 'd') === 0 || strpos($v, '<DIR>')) |
|
378 | + if (strpos($v, 'd') === 0 || strpos($v, '<DIR>')) |
|
379 | 379 | { |
380 | 380 | $list[] = substr(strrchr($v, ' '), 1) . '/'; |
381 | 381 | } |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | , 'module' => array('addon', 'admin', 'autoinstall', 'comment', 'communication', 'counter', 'document', 'editor', 'file', 'importer', 'install', 'integration_search', 'layout', 'member', 'menu', 'message', 'module', 'opage', 'page', 'point', 'poll', 'rss', 'session', 'spamfilter', 'tag', 'trackback', 'trash', 'widget') |
401 | 401 | , 'addon' => array('autolink', 'blogapi', 'captcha', 'counter', 'member_communication', 'member_extra_info', 'mobile', 'openid_delegation_id', 'point_level_icon', 'resize_image') |
402 | 402 | , 'layout' => array('default') |
403 | - , 'widget' => array('content', 'language_select', 'login_info','mcontent') |
|
403 | + , 'widget' => array('content', 'language_select', 'login_info', 'mcontent') |
|
404 | 404 | , 'widgetstyle' => array(), |
405 | 405 | ); |
406 | 406 | $info = array(); |
@@ -420,10 +420,10 @@ discard block |
||
420 | 420 | $info['use_ssl'] = $db_info->use_ssl; |
421 | 421 | |
422 | 422 | $info['phpext'] = ''; |
423 | - foreach(get_loaded_extensions() as $ext) |
|
423 | + foreach (get_loaded_extensions() as $ext) |
|
424 | 424 | { |
425 | 425 | $ext = strtolower($ext); |
426 | - if(in_array($ext, $skip['ext'])) |
|
426 | + if (in_array($ext, $skip['ext'])) |
|
427 | 427 | { |
428 | 428 | continue; |
429 | 429 | } |
@@ -434,9 +434,9 @@ discard block |
||
434 | 434 | $info['module'] = ''; |
435 | 435 | $oModuleModel = getModel('module'); |
436 | 436 | $module_list = $oModuleModel->getModuleList(); |
437 | - if($module_list) foreach($module_list as $module) |
|
437 | + if ($module_list) foreach ($module_list as $module) |
|
438 | 438 | { |
439 | - if(in_array($module->module, $skip['module'])) |
|
439 | + if (in_array($module->module, $skip['module'])) |
|
440 | 440 | { |
441 | 441 | continue; |
442 | 442 | } |
@@ -447,9 +447,9 @@ discard block |
||
447 | 447 | $info['addon'] = ''; |
448 | 448 | $oAddonAdminModel = getAdminModel('addon'); |
449 | 449 | $addon_list = $oAddonAdminModel->getAddonList(); |
450 | - if($addon_list) foreach($addon_list as $addon) |
|
450 | + if ($addon_list) foreach ($addon_list as $addon) |
|
451 | 451 | { |
452 | - if(in_array($addon->addon, $skip['addon'])) |
|
452 | + if (in_array($addon->addon, $skip['addon'])) |
|
453 | 453 | { |
454 | 454 | continue; |
455 | 455 | } |
@@ -460,9 +460,9 @@ discard block |
||
460 | 460 | $info['layout'] = ""; |
461 | 461 | $oLayoutModel = getModel('layout'); |
462 | 462 | $layout_list = $oLayoutModel->getDownloadedLayoutList(); |
463 | - if($layout_list) foreach($layout_list as $layout) |
|
463 | + if ($layout_list) foreach ($layout_list as $layout) |
|
464 | 464 | { |
465 | - if(in_array($layout->layout, $skip['layout'])) |
|
465 | + if (in_array($layout->layout, $skip['layout'])) |
|
466 | 466 | { |
467 | 467 | continue; |
468 | 468 | } |
@@ -473,9 +473,9 @@ discard block |
||
473 | 473 | $info['widget'] = ""; |
474 | 474 | $oWidgetModel = getModel('widget'); |
475 | 475 | $widget_list = $oWidgetModel->getDownloadedWidgetList(); |
476 | - if($widget_list) foreach($widget_list as $widget) |
|
476 | + if ($widget_list) foreach ($widget_list as $widget) |
|
477 | 477 | { |
478 | - if(in_array($widget->widget, $skip['widget'])) |
|
478 | + if (in_array($widget->widget, $skip['widget'])) |
|
479 | 479 | { |
480 | 480 | continue; |
481 | 481 | } |
@@ -486,9 +486,9 @@ discard block |
||
486 | 486 | $info['widgetstyle'] = ""; |
487 | 487 | $oWidgetModel = getModel('widget'); |
488 | 488 | $widgetstyle_list = $oWidgetModel->getDownloadedWidgetStyleList(); |
489 | - if($widgetstyle_list) foreach($widgetstyle_list as $widgetstyle) |
|
489 | + if ($widgetstyle_list) foreach ($widgetstyle_list as $widgetstyle) |
|
490 | 490 | { |
491 | - if(in_array($widgetstyle->widgetStyle, $skip['widgetstyle'])) |
|
491 | + if (in_array($widgetstyle->widgetStyle, $skip['widgetstyle'])) |
|
492 | 492 | { |
493 | 493 | continue; |
494 | 494 | } |
@@ -497,9 +497,9 @@ discard block |
||
497 | 497 | $info['widgetstyle'] = substr($info['widgetstyle'], 1); |
498 | 498 | |
499 | 499 | $param = ''; |
500 | - foreach($info as $k => $v) |
|
500 | + foreach ($info as $k => $v) |
|
501 | 501 | { |
502 | - if($v) |
|
502 | + if ($v) |
|
503 | 503 | { |
504 | 504 | $param .= sprintf('&%s=%s', $k, urlencode($v)); |
505 | 505 | } |
@@ -519,9 +519,9 @@ discard block |
||
519 | 519 | $list = FileHandler::readDir($path); |
520 | 520 | |
521 | 521 | $theme_info = array(); |
522 | - if(count($list) > 0) |
|
522 | + if (count($list) > 0) |
|
523 | 523 | { |
524 | - foreach($list as $val) |
|
524 | + foreach ($list as $val) |
|
525 | 525 | { |
526 | 526 | $theme_info[$val] = $this->getThemeInfo($val); |
527 | 527 | } |
@@ -538,20 +538,20 @@ discard block |
||
538 | 538 | */ |
539 | 539 | function getThemeInfo($theme_name, $layout_list = NULL) |
540 | 540 | { |
541 | - if($GLOBALS['__ThemeInfo__'][$theme_name]) |
|
541 | + if ($GLOBALS['__ThemeInfo__'][$theme_name]) |
|
542 | 542 | { |
543 | 543 | return $GLOBALS['__ThemeInfo__'][$theme_name]; |
544 | 544 | } |
545 | 545 | |
546 | 546 | $info_file = _XE_PATH_ . 'themes/' . $theme_name . '/conf/info.xml'; |
547 | - if(!file_exists($info_file)) |
|
547 | + if (!file_exists($info_file)) |
|
548 | 548 | { |
549 | 549 | return; |
550 | 550 | } |
551 | 551 | |
552 | 552 | $oXmlParser = new XmlParser(); |
553 | 553 | $_xml_obj = $oXmlParser->loadXmlFile($info_file); |
554 | - if(!$_xml_obj->theme) |
|
554 | + if (!$_xml_obj->theme) |
|
555 | 555 | { |
556 | 556 | return; |
557 | 557 | } |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | $theme_info->description = $xml_obj->description->body; |
572 | 572 | $theme_info->path = './themes/' . $theme_name . '/'; |
573 | 573 | |
574 | - if(!is_array($xml_obj->publisher)) |
|
574 | + if (!is_array($xml_obj->publisher)) |
|
575 | 575 | { |
576 | 576 | $publisher_list = array(); |
577 | 577 | $publisher_list[] = $xml_obj->publisher; |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | } |
583 | 583 | |
584 | 584 | $theme_info->publisher = array(); |
585 | - foreach($publisher_list as $publisher) |
|
585 | + foreach ($publisher_list as $publisher) |
|
586 | 586 | { |
587 | 587 | $publisher_obj = new stdClass(); |
588 | 588 | $publisher_obj->name = $publisher->name->body; |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | $layout_path = $layout->directory->attrs->path; |
596 | 596 | $layout_parse = explode('/', $layout_path); |
597 | 597 | $layout_info = new stdClass(); |
598 | - switch($layout_parse[1]) |
|
598 | + switch ($layout_parse[1]) |
|
599 | 599 | { |
600 | 600 | case 'themes' : |
601 | 601 | $layout_info->name = $theme_name . '|@|' . $layout_parse[count($layout_parse) - 1]; |
@@ -615,11 +615,11 @@ discard block |
||
615 | 615 | $oLayoutModel = getModel('layout'); |
616 | 616 | $layout_info_list = array(); |
617 | 617 | $layout_list = $oLayoutModel->getLayoutList($site_info->site_srl); |
618 | - if($layout_list) |
|
618 | + if ($layout_list) |
|
619 | 619 | { |
620 | - foreach($layout_list as $val) |
|
620 | + foreach ($layout_list as $val) |
|
621 | 621 | { |
622 | - if($val->layout == $layout_info->name) |
|
622 | + if ($val->layout == $layout_info->name) |
|
623 | 623 | { |
624 | 624 | $is_new_layout = FALSE; |
625 | 625 | $layout_info->layout_srl = $val->layout_srl; |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | } |
629 | 629 | } |
630 | 630 | |
631 | - if($is_new_layout) |
|
631 | + if ($is_new_layout) |
|
632 | 632 | { |
633 | 633 | $site_module_info = Context::get('site_module_info'); |
634 | 634 | $args = new stdClass(); |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | $theme_info->layout_info = $layout_info; |
647 | 647 | |
648 | 648 | $skin_infos = $xml_obj->skininfos; |
649 | - if(is_array($skin_infos->skininfo)) |
|
649 | + if (is_array($skin_infos->skininfo)) |
|
650 | 650 | { |
651 | 651 | $skin_list = $skin_infos->skininfo; |
652 | 652 | } |
@@ -657,12 +657,12 @@ discard block |
||
657 | 657 | |
658 | 658 | $oModuleModel = getModel('module'); |
659 | 659 | $skins = array(); |
660 | - foreach($skin_list as $val) |
|
660 | + foreach ($skin_list as $val) |
|
661 | 661 | { |
662 | 662 | $skin_info = new stdClass(); |
663 | 663 | unset($skin_parse); |
664 | 664 | $skin_parse = explode('/', $val->directory->attrs->path); |
665 | - switch($skin_parse[1]) |
|
665 | + switch ($skin_parse[1]) |
|
666 | 666 | { |
667 | 667 | case 'themes' : |
668 | 668 | $is_theme = TRUE; |
@@ -681,9 +681,9 @@ discard block |
||
681 | 681 | $skin_info->is_theme = $is_theme; |
682 | 682 | $skins[$module_name] = $skin_info; |
683 | 683 | |
684 | - if($is_theme) |
|
684 | + if ($is_theme) |
|
685 | 685 | { |
686 | - if(!$GLOBALS['__ThemeModuleSkin__'][$module_name]) |
|
686 | + if (!$GLOBALS['__ThemeModuleSkin__'][$module_name]) |
|
687 | 687 | { |
688 | 688 | $GLOBALS['__ThemeModuleSkin__'][$module_name] = array(); |
689 | 689 | $GLOBALS['__ThemeModuleSkin__'][$module_name]['skins'] = array(); |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | */ |
706 | 706 | function getModulesSkinList() |
707 | 707 | { |
708 | - if($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__']) |
|
708 | + if ($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__']) |
|
709 | 709 | { |
710 | 710 | return $GLOBALS['__ThemeModuleSkin__']; |
711 | 711 | } |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | sort($searched_list); |
714 | 714 | |
715 | 715 | $searched_count = count($searched_list); |
716 | - if(!$searched_count) |
|
716 | + if (!$searched_count) |
|
717 | 717 | { |
718 | 718 | return; |
719 | 719 | } |
@@ -721,13 +721,13 @@ discard block |
||
721 | 721 | $exceptionModule = array('editor', 'poll', 'homepage', 'textyle'); |
722 | 722 | |
723 | 723 | $oModuleModel = getModel('module'); |
724 | - foreach($searched_list as $val) |
|
724 | + foreach ($searched_list as $val) |
|
725 | 725 | { |
726 | 726 | $skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/' . $val); |
727 | 727 | |
728 | - if(is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule)) |
|
728 | + if (is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule)) |
|
729 | 729 | { |
730 | - if(!$GLOBALS['__ThemeModuleSkin__'][$val]) |
|
730 | + if (!$GLOBALS['__ThemeModuleSkin__'][$val]) |
|
731 | 731 | { |
732 | 732 | $GLOBALS['__ThemeModuleSkin__'][$val] = array(); |
733 | 733 | $moduleInfo = $oModuleModel->getModuleInfoXml($val); |
@@ -752,22 +752,22 @@ discard block |
||
752 | 752 | $cacheFile = sprintf('./files/cache/menu/admin_lang/adminMenu.%s.lang.php', $currentLang); |
753 | 753 | |
754 | 754 | // Update if no cache file exists or it is older than xml file |
755 | - if(!is_readable($cacheFile)) |
|
755 | + if (!is_readable($cacheFile)) |
|
756 | 756 | { |
757 | 757 | $lang = new stdClass(); |
758 | 758 | $oModuleModel = getModel('module'); |
759 | 759 | $installed_module_list = $oModuleModel->getModulesXmlInfo(); |
760 | 760 | |
761 | 761 | $this->gnbLangBuffer = '<?php $lang = new stdClass();'; |
762 | - foreach($installed_module_list AS $key => $value) |
|
762 | + foreach ($installed_module_list AS $key => $value) |
|
763 | 763 | { |
764 | 764 | $moduleActionInfo = $oModuleModel->getModuleActionXml($value->module); |
765 | - if(is_object($moduleActionInfo->menu)) |
|
765 | + if (is_object($moduleActionInfo->menu)) |
|
766 | 766 | { |
767 | - foreach($moduleActionInfo->menu AS $key2 => $value2) |
|
767 | + foreach ($moduleActionInfo->menu AS $key2 => $value2) |
|
768 | 768 | { |
769 | 769 | $lang->menu_gnb_sub[$key2] = $value2->title; |
770 | - $this->gnbLangBuffer .=sprintf('$lang->menu_gnb_sub[\'%s\'] = \'%s\';', $key2, $value2->title); |
|
770 | + $this->gnbLangBuffer .= sprintf('$lang->menu_gnb_sub[\'%s\'] = \'%s\';', $key2, $value2->title); |
|
771 | 771 | } |
772 | 772 | } |
773 | 773 | } |
@@ -793,19 +793,19 @@ discard block |
||
793 | 793 | $args = new stdClass(); |
794 | 794 | $args->site_srl = $siteSrl; |
795 | 795 | $output = executeQueryArray('admin.getFavoriteList', $args); |
796 | - if(!$output->toBool()) |
|
796 | + if (!$output->toBool()) |
|
797 | 797 | { |
798 | 798 | return $output; |
799 | 799 | } |
800 | - if(!$output->data) |
|
800 | + if (!$output->data) |
|
801 | 801 | { |
802 | 802 | return new Object(); |
803 | 803 | } |
804 | 804 | |
805 | - if($isGetModuleInfo && is_array($output->data)) |
|
805 | + if ($isGetModuleInfo && is_array($output->data)) |
|
806 | 806 | { |
807 | 807 | $oModuleModel = getModel('module'); |
808 | - foreach($output->data AS $key => $value) |
|
808 | + foreach ($output->data AS $key => $value) |
|
809 | 809 | { |
810 | 810 | $moduleInfo = $oModuleModel->getModuleInfoXml($value->module); |
811 | 811 | $output->data[$key]->admin_index_act = $moduleInfo->admin_index_act; |
@@ -830,13 +830,13 @@ discard block |
||
830 | 830 | $args->site_srl = $siteSrl; |
831 | 831 | $args->module = $module; |
832 | 832 | $output = executeQuery('admin.getFavorite', $args); |
833 | - if(!$output->toBool()) |
|
833 | + if (!$output->toBool()) |
|
834 | 834 | { |
835 | 835 | return $output; |
836 | 836 | } |
837 | 837 | |
838 | 838 | $returnObject = new Object(); |
839 | - if($output->data) |
|
839 | + if ($output->data) |
|
840 | 840 | { |
841 | 841 | $returnObject->add('result', TRUE); |
842 | 842 | $returnObject->add('favoriteSrl', $output->data->admin_favorite_srl); |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | */ |
856 | 856 | function getSiteAllList() |
857 | 857 | { |
858 | - if(Context::get('domain')) |
|
858 | + if (Context::get('domain')) |
|
859 | 859 | { |
860 | 860 | $domain = Context::get('domain'); |
861 | 861 | } |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | function getAllSitesThatHaveModules($domain = NULL) |
873 | 873 | { |
874 | 874 | $args = new stdClass(); |
875 | - if($domain) |
|
875 | + if ($domain) |
|
876 | 876 | { |
877 | 877 | $args->domain = $domain; |
878 | 878 | } |
@@ -880,31 +880,31 @@ discard block |
||
880 | 880 | |
881 | 881 | $siteList = array(); |
882 | 882 | $output = executeQueryArray('admin.getSiteAllList', $args, $columnList); |
883 | - if($output->toBool()) |
|
883 | + if ($output->toBool()) |
|
884 | 884 | { |
885 | 885 | $siteList = $output->data; |
886 | 886 | } |
887 | 887 | |
888 | 888 | $oModuleModel = getModel('module'); |
889 | - foreach($siteList as $key => $value) |
|
889 | + foreach ($siteList as $key => $value) |
|
890 | 890 | { |
891 | 891 | $args->site_srl = $value->site_srl; |
892 | 892 | $list = $oModuleModel->getModuleSrlList($args); |
893 | 893 | |
894 | - if(!is_array($list)) |
|
894 | + if (!is_array($list)) |
|
895 | 895 | { |
896 | 896 | $list = array($list); |
897 | 897 | } |
898 | 898 | |
899 | - foreach($list as $k => $v) |
|
899 | + foreach ($list as $k => $v) |
|
900 | 900 | { |
901 | - if(!is_dir(_XE_PATH_ . 'modules/' . $v->module)) |
|
901 | + if (!is_dir(_XE_PATH_ . 'modules/' . $v->module)) |
|
902 | 902 | { |
903 | 903 | unset($list[$k]); |
904 | 904 | } |
905 | 905 | } |
906 | 906 | |
907 | - if(!count($list)) |
|
907 | + if (!count($list)) |
|
908 | 908 | { |
909 | 909 | unset($siteList[$key]); |
910 | 910 | } |
@@ -921,13 +921,13 @@ discard block |
||
921 | 921 | { |
922 | 922 | $args = new stdClass(); |
923 | 923 | |
924 | - if($date) |
|
924 | + if ($date) |
|
925 | 925 | { |
926 | 926 | $args->regDate = date('Ymd', strtotime($date)); |
927 | 927 | } |
928 | 928 | |
929 | 929 | $output = executeQuery('admin.getSiteCountByDate', $args); |
930 | - if(!$output->toBool()) |
|
930 | + if (!$output->toBool()) |
|
931 | 931 | { |
932 | 932 | return 0; |
933 | 933 | } |
@@ -949,17 +949,17 @@ discard block |
||
949 | 949 | { |
950 | 950 | $site_info = Context::get('site_module_info'); |
951 | 951 | $virtual_site = ''; |
952 | - if($site_info->site_srl) |
|
952 | + if ($site_info->site_srl) |
|
953 | 953 | { |
954 | 954 | $virtual_site = $site_info->site_srl . '/'; |
955 | 955 | } |
956 | 956 | |
957 | 957 | $file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname); |
958 | - if(!$file_exsit && $default === true) |
|
958 | + if (!$file_exsit && $default === true) |
|
959 | 959 | { |
960 | 960 | $icon_url = './modules/admin/tpl/img/' . $default_icon_name; |
961 | 961 | } |
962 | - elseif($file_exsit) |
|
962 | + elseif ($file_exsit) |
|
963 | 963 | { |
964 | 964 | $default_url = Context::getDefaultUrl(); |
965 | 965 | $icon_url = $default_url . 'files/attach/xeicon/' . $virtual_site . $iconname; |
@@ -303,8 +303,7 @@ discard block |
||
303 | 303 | if(is_dir($curpwd . $file)) |
304 | 304 | { |
305 | 305 | $file .= "/"; |
306 | - } |
|
307 | - else |
|
306 | + } else |
|
308 | 307 | { |
309 | 308 | continue; |
310 | 309 | } |
@@ -359,8 +358,7 @@ discard block |
||
359 | 358 | { |
360 | 359 | $_list = $oFtp->ftp_rawlist($this->pwd); |
361 | 360 | $oFtp->ftp_quit(); |
362 | - } |
|
363 | - else |
|
361 | + } else |
|
364 | 362 | { |
365 | 363 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
366 | 364 | } |
@@ -380,8 +378,7 @@ discard block |
||
380 | 378 | $list[] = substr(strrchr($v, ' '), 1) . '/'; |
381 | 379 | } |
382 | 380 | } |
383 | - } |
|
384 | - else |
|
381 | + } else |
|
385 | 382 | { |
386 | 383 | return new Object(-1, 'msg_ftp_no_directory'); |
387 | 384 | } |
@@ -434,11 +431,13 @@ discard block |
||
434 | 431 | $info['module'] = ''; |
435 | 432 | $oModuleModel = getModel('module'); |
436 | 433 | $module_list = $oModuleModel->getModuleList(); |
437 | - if($module_list) foreach($module_list as $module) |
|
434 | + if($module_list) { |
|
435 | + foreach($module_list as $module) |
|
438 | 436 | { |
439 | 437 | if(in_array($module->module, $skip['module'])) |
440 | 438 | { |
441 | 439 | continue; |
440 | + } |
|
442 | 441 | } |
443 | 442 | $info['module'] .= '|' . $module->module; |
444 | 443 | } |
@@ -447,11 +446,13 @@ discard block |
||
447 | 446 | $info['addon'] = ''; |
448 | 447 | $oAddonAdminModel = getAdminModel('addon'); |
449 | 448 | $addon_list = $oAddonAdminModel->getAddonList(); |
450 | - if($addon_list) foreach($addon_list as $addon) |
|
449 | + if($addon_list) { |
|
450 | + foreach($addon_list as $addon) |
|
451 | 451 | { |
452 | 452 | if(in_array($addon->addon, $skip['addon'])) |
453 | 453 | { |
454 | 454 | continue; |
455 | + } |
|
455 | 456 | } |
456 | 457 | $info['addon'] .= '|' . $addon->addon; |
457 | 458 | } |
@@ -460,11 +461,13 @@ discard block |
||
460 | 461 | $info['layout'] = ""; |
461 | 462 | $oLayoutModel = getModel('layout'); |
462 | 463 | $layout_list = $oLayoutModel->getDownloadedLayoutList(); |
463 | - if($layout_list) foreach($layout_list as $layout) |
|
464 | + if($layout_list) { |
|
465 | + foreach($layout_list as $layout) |
|
464 | 466 | { |
465 | 467 | if(in_array($layout->layout, $skip['layout'])) |
466 | 468 | { |
467 | 469 | continue; |
470 | + } |
|
468 | 471 | } |
469 | 472 | $info['layout'] .= '|' . $layout->layout; |
470 | 473 | } |
@@ -473,11 +476,13 @@ discard block |
||
473 | 476 | $info['widget'] = ""; |
474 | 477 | $oWidgetModel = getModel('widget'); |
475 | 478 | $widget_list = $oWidgetModel->getDownloadedWidgetList(); |
476 | - if($widget_list) foreach($widget_list as $widget) |
|
479 | + if($widget_list) { |
|
480 | + foreach($widget_list as $widget) |
|
477 | 481 | { |
478 | 482 | if(in_array($widget->widget, $skip['widget'])) |
479 | 483 | { |
480 | 484 | continue; |
485 | + } |
|
481 | 486 | } |
482 | 487 | $info['widget'] .= '|' . $widget->widget; |
483 | 488 | } |
@@ -486,11 +491,13 @@ discard block |
||
486 | 491 | $info['widgetstyle'] = ""; |
487 | 492 | $oWidgetModel = getModel('widget'); |
488 | 493 | $widgetstyle_list = $oWidgetModel->getDownloadedWidgetStyleList(); |
489 | - if($widgetstyle_list) foreach($widgetstyle_list as $widgetstyle) |
|
494 | + if($widgetstyle_list) { |
|
495 | + foreach($widgetstyle_list as $widgetstyle) |
|
490 | 496 | { |
491 | 497 | if(in_array($widgetstyle->widgetStyle, $skip['widgetstyle'])) |
492 | 498 | { |
493 | 499 | continue; |
500 | + } |
|
494 | 501 | } |
495 | 502 | $info['widgetstyle'] .= '|' . $widgetstyle->widgetStyle; |
496 | 503 | } |
@@ -575,8 +582,7 @@ discard block |
||
575 | 582 | { |
576 | 583 | $publisher_list = array(); |
577 | 584 | $publisher_list[] = $xml_obj->publisher; |
578 | - } |
|
579 | - else |
|
585 | + } else |
|
580 | 586 | { |
581 | 587 | $publisher_list = $xml_obj->publisher; |
582 | 588 | } |
@@ -649,8 +655,7 @@ discard block |
||
649 | 655 | if(is_array($skin_infos->skininfo)) |
650 | 656 | { |
651 | 657 | $skin_list = $skin_infos->skininfo; |
652 | - } |
|
653 | - else |
|
658 | + } else |
|
654 | 659 | { |
655 | 660 | $skin_list = array($skin_infos->skininfo); |
656 | 661 | } |
@@ -773,8 +778,7 @@ discard block |
||
773 | 778 | } |
774 | 779 | $this->gnbLangBuffer .= ' ?>'; |
775 | 780 | FileHandler::writeFile($cacheFile, $this->gnbLangBuffer); |
776 | - } |
|
777 | - else |
|
781 | + } else |
|
778 | 782 | { |
779 | 783 | include $cacheFile; |
780 | 784 | } |
@@ -840,8 +844,7 @@ discard block |
||
840 | 844 | { |
841 | 845 | $returnObject->add('result', TRUE); |
842 | 846 | $returnObject->add('favoriteSrl', $output->data->admin_favorite_srl); |
843 | - } |
|
844 | - else |
|
847 | + } else |
|
845 | 848 | { |
846 | 849 | $returnObject->add('result', FALSE); |
847 | 850 | } |
@@ -958,8 +961,7 @@ discard block |
||
958 | 961 | if(!$file_exsit && $default === true) |
959 | 962 | { |
960 | 963 | $icon_url = './modules/admin/tpl/img/' . $default_icon_name; |
961 | - } |
|
962 | - elseif($file_exsit) |
|
964 | + } elseif($file_exsit) |
|
963 | 965 | { |
964 | 966 | $default_url = Context::getDefaultUrl(); |
965 | 967 | $icon_url = $default_url . 'files/attach/xeicon/' . $virtual_site . $iconname; |
@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Initilization |
44 | - * @return void |
|
44 | + * @return ModuleObject|null |
|
45 | 45 | */ |
46 | 46 | function init() |
47 | 47 | { |
@@ -566,7 +566,7 @@ |
||
566 | 566 | /** |
567 | 567 | * Retrun server environment to XML string |
568 | 568 | * @return object |
569 | - */ |
|
569 | + */ |
|
570 | 570 | function dispAdminViewServerEnv() |
571 | 571 | { |
572 | 572 | $info = array(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | $db_info = Context::getDBInfo(); |
30 | 30 | |
31 | - if(strpos($db_info->default_url, 'xn--') !== FALSE) |
|
31 | + if (strpos($db_info->default_url, 'xn--') !== FALSE) |
|
32 | 32 | { |
33 | 33 | $xe_default_url = Context::decodeIdna($db_info->default_url); |
34 | 34 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | // forbit access if the user is not an administrator |
49 | 49 | $oMemberModel = getModel('member'); |
50 | 50 | $logged_info = $oMemberModel->getLoggedInfo(); |
51 | - if($logged_info->is_admin != 'Y') |
|
51 | + if ($logged_info->is_admin != 'Y') |
|
52 | 52 | { |
53 | 53 | return $this->stop("msg_is_not_administrator"); |
54 | 54 | } |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | Context::set('use_db_session', $db_info->use_db_session == 'N' ? 'N' : 'Y'); |
75 | 75 | Context::set('use_mobile_view', $db_info->use_mobile_view == 'Y' ? 'Y' : 'N'); |
76 | 76 | Context::set('use_ssl', $db_info->use_ssl ? $db_info->use_ssl : "none"); |
77 | - if($db_info->http_port) |
|
77 | + if ($db_info->http_port) |
|
78 | 78 | { |
79 | 79 | Context::set('http_port', $db_info->http_port); |
80 | 80 | } |
81 | - if($db_info->https_port) |
|
81 | + if ($db_info->https_port) |
|
82 | 82 | { |
83 | 83 | Context::set('https_port', $db_info->https_port); |
84 | 84 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | function checkEasyinstall() |
95 | 95 | { |
96 | 96 | $lastTime = (int) FileHandler::readFile($this->easyinstallCheckFile); |
97 | - if($lastTime > $_SERVER['REQUEST_TIME'] - 60 * 60 * 24 * 30) |
|
97 | + if ($lastTime > $_SERVER['REQUEST_TIME'] - 60 * 60 * 24 * 30) |
|
98 | 98 | { |
99 | 99 | return; |
100 | 100 | } |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | $lUpdateDoc = $xml_lUpdate->parse($buff); |
109 | 109 | $updateDate = $lUpdateDoc->response->updatedate->body; |
110 | 110 | |
111 | - if(!$updateDate) |
|
111 | + if (!$updateDate) |
|
112 | 112 | { |
113 | 113 | $this->_markingCheckEasyinstall(); |
114 | 114 | return; |
115 | 115 | } |
116 | 116 | |
117 | 117 | $item = $oAutoinstallModel->getLatestPackage(); |
118 | - if(!$item || $item->updatedate < $updateDate) |
|
118 | + if (!$item || $item->updatedate < $updateDate) |
|
119 | 119 | { |
120 | 120 | $oController = getAdminController('autoinstall'); |
121 | 121 | $oController->_updateinfo(); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | // Check is_shortcut column |
146 | 146 | $oDB = DB::getInstance(); |
147 | - if(!$oDB->isColumnExists('menu_item', 'is_shortcut')) |
|
147 | + if (!$oDB->isColumnExists('menu_item', 'is_shortcut')) |
|
148 | 148 | { |
149 | 149 | return; |
150 | 150 | } |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | $currentAct = Context::get('act'); |
163 | 163 | $subMenuTitle = ''; |
164 | 164 | |
165 | - foreach((array) $moduleActionInfo->menu as $key => $value) |
|
165 | + foreach ((array) $moduleActionInfo->menu as $key => $value) |
|
166 | 166 | { |
167 | - if(isset($value->acts) && is_array($value->acts) && in_array($currentAct, $value->acts)) |
|
167 | + if (isset($value->acts) && is_array($value->acts) && in_array($currentAct, $value->acts)) |
|
168 | 168 | { |
169 | 169 | $subMenuTitle = $value->title; |
170 | 170 | break; |
@@ -173,21 +173,21 @@ discard block |
||
173 | 173 | // get current menu's srl(=parentSrl) |
174 | 174 | $parentSrl = 0; |
175 | 175 | $oMenuAdminConroller = getAdminController('menu'); |
176 | - foreach((array) $menu->list as $parentKey => $parentMenu) |
|
176 | + foreach ((array) $menu->list as $parentKey => $parentMenu) |
|
177 | 177 | { |
178 | - if(!is_array($parentMenu['list']) || !count($parentMenu['list'])) |
|
178 | + if (!is_array($parentMenu['list']) || !count($parentMenu['list'])) |
|
179 | 179 | { |
180 | 180 | continue; |
181 | 181 | } |
182 | - if($parentMenu['href'] == '#' && count($parentMenu['list'])) |
|
182 | + if ($parentMenu['href'] == '#' && count($parentMenu['list'])) |
|
183 | 183 | { |
184 | 184 | $firstChild = current($parentMenu['list']); |
185 | 185 | $menu->list[$parentKey]['href'] = $firstChild['href']; |
186 | 186 | } |
187 | 187 | |
188 | - foreach($parentMenu['list'] as $childKey => $childMenu) |
|
188 | + foreach ($parentMenu['list'] as $childKey => $childMenu) |
|
189 | 189 | { |
190 | - if($subMenuTitle == $childMenu['text'] && $parentSrl == 0) |
|
190 | + if ($subMenuTitle == $childMenu['text'] && $parentSrl == 0) |
|
191 | 191 | { |
192 | 192 | $parentSrl = $childMenu['parent_srl']; |
193 | 193 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | // move from index method, because use in admin footer |
212 | 212 | $newest_news_url = sprintf("http://news.xpressengine.com/%s/news.php?version=%s&package=%s", _XE_LOCATION_, __XE_VERSION__, _XE_PACKAGE_); |
213 | 213 | $cache_file = sprintf("%sfiles/cache/newest_news.%s.cache.php", _XE_PATH_, _XE_LOCATION_); |
214 | - if(!file_exists($cache_file) || filemtime($cache_file) + 60 * 60 < $_SERVER['REQUEST_TIME']) |
|
214 | + if (!file_exists($cache_file) || filemtime($cache_file) + 60 * 60 < $_SERVER['REQUEST_TIME']) |
|
215 | 215 | { |
216 | 216 | // Considering if data cannot be retrieved due to network problem, modify filemtime to prevent trying to reload again when refreshing administration page |
217 | 217 | // Ensure to access the administration page even though news cannot be displayed |
@@ -219,20 +219,20 @@ discard block |
||
219 | 219 | FileHandler::getRemoteFile($newest_news_url, $cache_file, null, 1, 'GET', 'text/html', array('REQUESTURL' => getFullUrl(''))); |
220 | 220 | } |
221 | 221 | |
222 | - if(file_exists($cache_file)) |
|
222 | + if (file_exists($cache_file)) |
|
223 | 223 | { |
224 | 224 | $oXml = new XmlParser(); |
225 | 225 | $buff = $oXml->parse(FileHandler::readFile($cache_file)); |
226 | 226 | |
227 | 227 | $item = $buff->zbxe_news->item; |
228 | - if($item) |
|
228 | + if ($item) |
|
229 | 229 | { |
230 | - if(!is_array($item)) |
|
230 | + if (!is_array($item)) |
|
231 | 231 | { |
232 | 232 | $item = array($item); |
233 | 233 | } |
234 | 234 | |
235 | - foreach($item as $key => $val) |
|
235 | + foreach ($item as $key => $val) |
|
236 | 236 | { |
237 | 237 | $obj = new stdClass(); |
238 | 238 | $obj->title = $val->body; |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $news[] = $obj; |
242 | 242 | } |
243 | 243 | Context::set('news', $news); |
244 | - if(isset($news) && is_array($news)) |
|
244 | + if (isset($news) && is_array($news)) |
|
245 | 245 | { |
246 | 246 | Context::set('latestVersion', array_shift($news)); |
247 | 247 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | function dispAdminIndex() |
265 | 265 | { |
266 | 266 | $db_info = Context::getDBInfo(); |
267 | - Context::set('db_info',$db_info); |
|
267 | + Context::set('db_info', $db_info); |
|
268 | 268 | |
269 | 269 | // Get statistics |
270 | 270 | $args = new stdClass(); |
@@ -301,9 +301,9 @@ discard block |
||
301 | 301 | $args = new stdClass(); |
302 | 302 | $args->list_count = 5; |
303 | 303 | $output = $oCommentModel->getNewestCommentList($args, $columnList); |
304 | - if(is_array($output)) |
|
304 | + if (is_array($output)) |
|
305 | 305 | { |
306 | - foreach($output AS $key => $value) |
|
306 | + foreach ($output AS $key => $value) |
|
307 | 307 | { |
308 | 308 | $value->content = strip_tags($value->content); |
309 | 309 | } |
@@ -314,17 +314,17 @@ discard block |
||
314 | 314 | // Get list of modules |
315 | 315 | $oModuleModel = getModel('module'); |
316 | 316 | $module_list = $oModuleModel->getModuleList(); |
317 | - if(is_array($module_list)) |
|
317 | + if (is_array($module_list)) |
|
318 | 318 | { |
319 | 319 | $needUpdate = FALSE; |
320 | 320 | $addTables = FALSE; |
321 | - foreach($module_list AS $key => $value) |
|
321 | + foreach ($module_list AS $key => $value) |
|
322 | 322 | { |
323 | - if($value->need_install) |
|
323 | + if ($value->need_install) |
|
324 | 324 | { |
325 | 325 | $addTables = TRUE; |
326 | 326 | } |
327 | - if($value->need_update) |
|
327 | + if ($value->need_update) |
|
328 | 328 | { |
329 | 329 | $needUpdate = TRUE; |
330 | 330 | } |
@@ -335,12 +335,12 @@ discard block |
||
335 | 335 | $oAutoinstallAdminModel = getAdminModel('autoinstall'); |
336 | 336 | $needUpdateList = $oAutoinstallAdminModel->getNeedUpdateList(); |
337 | 337 | |
338 | - if(is_array($needUpdateList)) |
|
338 | + if (is_array($needUpdateList)) |
|
339 | 339 | { |
340 | - foreach($needUpdateList AS $key => $value) |
|
340 | + foreach ($needUpdateList AS $key => $value) |
|
341 | 341 | { |
342 | 342 | $helpUrl = './admin/help/index.html#'; |
343 | - switch($value->type) |
|
343 | + switch ($value->type) |
|
344 | 344 | { |
345 | 345 | case 'addon': |
346 | 346 | $helpUrl .= 'UMAN_terminology_addon'; |
@@ -367,8 +367,8 @@ discard block |
||
367 | 367 | |
368 | 368 | $site_module_info = Context::get('site_module_info'); |
369 | 369 | $oAddonAdminModel = getAdminModel('addon'); |
370 | - $counterAddonActivated = $oAddonAdminModel->isActivatedAddon('counter', $site_module_info->site_srl ); |
|
371 | - if(!$counterAddonActivated) |
|
370 | + $counterAddonActivated = $oAddonAdminModel->isActivatedAddon('counter', $site_module_info->site_srl); |
|
371 | + if (!$counterAddonActivated) |
|
372 | 372 | { |
373 | 373 | $columnList = array('member_srl', 'nick_name', 'user_name', 'user_id', 'email_address'); |
374 | 374 | $args = new stdClass; |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | $mainVersion = join('.', array_slice(explode('.', __XE_VERSION__), 0, 2)); |
394 | 394 | $path = FileHandler::getRealPath('./files/env/' . $mainVersion); |
395 | 395 | $isEnviromentGatheringAgreement = FALSE; |
396 | - if(file_exists($path)) |
|
396 | + if (file_exists($path)) |
|
397 | 397 | { |
398 | 398 | $isEnviromentGatheringAgreement = TRUE; |
399 | 399 | } |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $isLicenseAgreement = FALSE; |
404 | 404 | $path = FileHandler::getRealPath('./files/env/license_agreement'); |
405 | 405 | $isLicenseAgreement = FALSE; |
406 | - if(file_exists($path)) |
|
406 | + if (file_exists($path)) |
|
407 | 407 | { |
408 | 408 | $isLicenseAgreement = TRUE; |
409 | 409 | } |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | |
426 | 426 | Context::set('selected_lang', $db_info->lang_type); |
427 | 427 | |
428 | - if(strpos($db_info->default_url, 'xn--') !== FALSE) |
|
428 | + if (strpos($db_info->default_url, 'xn--') !== FALSE) |
|
429 | 429 | { |
430 | 430 | $db_info->default_url = Context::decodeIdna($db_info->default_url); |
431 | 431 | } |
@@ -434,9 +434,9 @@ discard block |
||
434 | 434 | |
435 | 435 | // site lock |
436 | 436 | Context::set('IP', $_SERVER['REMOTE_ADDR']); |
437 | - if(!$db_info->sitelock_title) $db_info->sitelock_title = 'Maintenance in progress...'; |
|
438 | - if(!in_array('127.0.0.1', $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = '127.0.0.1'; |
|
439 | - if(!in_array($_SERVER['REMOTE_ADDR'], $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = $_SERVER['REMOTE_ADDR']; |
|
437 | + if (!$db_info->sitelock_title) $db_info->sitelock_title = 'Maintenance in progress...'; |
|
438 | + if (!in_array('127.0.0.1', $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = '127.0.0.1'; |
|
439 | + if (!in_array($_SERVER['REMOTE_ADDR'], $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = $_SERVER['REMOTE_ADDR']; |
|
440 | 440 | $db_info->sitelock_whitelist = array_unique($db_info->sitelock_whitelist); |
441 | 441 | Context::set('remote_addr', $_SERVER['REMOTE_ADDR']); |
442 | 442 | Context::set('use_sitelock', $db_info->use_sitelock); |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | Context::set('sitelock_whitelist', $whitelist); |
448 | 448 | |
449 | 449 | |
450 | - if($db_info->admin_ip_list) $admin_ip_list = implode("\r\n", $db_info->admin_ip_list); |
|
450 | + if ($db_info->admin_ip_list) $admin_ip_list = implode("\r\n", $db_info->admin_ip_list); |
|
451 | 451 | else $admin_ip_list = ''; |
452 | 452 | Context::set('admin_ip_list', $admin_ip_list); |
453 | 453 | |
@@ -456,8 +456,8 @@ discard block |
||
456 | 456 | $oAdminModel = getAdminModel('admin'); |
457 | 457 | $favicon_url = $oAdminModel->getFaviconUrl(); |
458 | 458 | $mobicon_url = $oAdminModel->getMobileIconUrl(); |
459 | - Context::set('favicon_url', $favicon_url.'?'.$_SERVER['REQUEST_TIME']); |
|
460 | - Context::set('mobicon_url', $mobicon_url.'?'.$_SERVER['REQUEST_TIME']); |
|
459 | + Context::set('favicon_url', $favicon_url . '?' . $_SERVER['REQUEST_TIME']); |
|
460 | + Context::set('mobicon_url', $mobicon_url . '?' . $_SERVER['REQUEST_TIME']); |
|
461 | 461 | |
462 | 462 | $oDocumentModel = getModel('document'); |
463 | 463 | $config = $oDocumentModel->getDocumentConfig(); |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | */ |
530 | 530 | function showSendEnv() |
531 | 531 | { |
532 | - if(Context::getResponseMethod() != 'HTML') |
|
532 | + if (Context::getResponseMethod() != 'HTML') |
|
533 | 533 | { |
534 | 534 | return; |
535 | 535 | } |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | $install_env = $path . 'install'; |
540 | 540 | $mainVersion = join('.', array_slice(explode('.', __XE_VERSION__), 0, 2)); |
541 | 541 | |
542 | - if(file_exists(FileHandler::getRealPath($install_env))) |
|
542 | + if (file_exists(FileHandler::getRealPath($install_env))) |
|
543 | 543 | { |
544 | 544 | $oAdminAdminModel = getAdminModel('admin'); |
545 | 545 | $params = $oAdminAdminModel->getEnv('INSTALL'); |
@@ -548,9 +548,9 @@ discard block |
||
548 | 548 | |
549 | 549 | FileHandler::writeFile($path . $mainVersion, '1'); |
550 | 550 | } |
551 | - else if(isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path . $mainVersion))) |
|
551 | + else if (isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path . $mainVersion))) |
|
552 | 552 | { |
553 | - if($_SESSION['enviroment_gather'] == 'Y') |
|
553 | + if ($_SESSION['enviroment_gather'] == 'Y') |
|
554 | 554 | { |
555 | 555 | $oAdminAdminModel = getAdminModel('admin'); |
556 | 556 | $params = $oAdminAdminModel->getEnv(); |
@@ -576,64 +576,64 @@ discard block |
||
576 | 576 | $tmp = explode("&", $envInfo); |
577 | 577 | $arrInfo = array(); |
578 | 578 | $xe_check_env = array(); |
579 | - foreach($tmp as $value) { |
|
579 | + foreach ($tmp as $value) { |
|
580 | 580 | $arr = explode("=", $value); |
581 | - if($arr[0]=="type") { |
|
581 | + if ($arr[0] == "type") { |
|
582 | 582 | continue; |
583 | - }elseif($arr[0]=="phpext" ) { |
|
583 | + }elseif ($arr[0] == "phpext") { |
|
584 | 584 | $str = urldecode($arr[1]); |
585 | - $xe_check_env[$arr[0]]= str_replace("|", ", ", $str); |
|
586 | - } elseif($arr[0]=="module" ) { |
|
585 | + $xe_check_env[$arr[0]] = str_replace("|", ", ", $str); |
|
586 | + } elseif ($arr[0] == "module") { |
|
587 | 587 | $str = urldecode($arr[1]); |
588 | 588 | $arrModuleName = explode("|", $str); |
589 | 589 | $oModuleModel = getModel("module"); |
590 | 590 | $mInfo = array(); |
591 | - foreach($arrModuleName as $moduleName) { |
|
591 | + foreach ($arrModuleName as $moduleName) { |
|
592 | 592 | $moduleInfo = $oModuleModel->getModuleInfoXml($moduleName); |
593 | 593 | $mInfo[] = "{$moduleName}({$moduleInfo->version})"; |
594 | 594 | } |
595 | - $xe_check_env[$arr[0]]= join(", ", $mInfo); |
|
596 | - } elseif($arr[0]=="addon") { |
|
595 | + $xe_check_env[$arr[0]] = join(", ", $mInfo); |
|
596 | + } elseif ($arr[0] == "addon") { |
|
597 | 597 | $str = urldecode($arr[1]); |
598 | 598 | $arrAddonName = explode("|", $str); |
599 | 599 | $oAddonModel = getAdminModel("addon"); |
600 | 600 | $mInfo = array(); |
601 | - foreach($arrAddonName as $addonName) { |
|
601 | + foreach ($arrAddonName as $addonName) { |
|
602 | 602 | $addonInfo = $oAddonModel->getAddonInfoXml($addonName); |
603 | 603 | $mInfo[] = "{$addonName}({$addonInfo->version})"; |
604 | 604 | } |
605 | - $xe_check_env[$arr[0]]= join(", ", $mInfo); |
|
606 | - } elseif($arr[0]=="widget") { |
|
605 | + $xe_check_env[$arr[0]] = join(", ", $mInfo); |
|
606 | + } elseif ($arr[0] == "widget") { |
|
607 | 607 | $str = urldecode($arr[1]); |
608 | 608 | $arrWidgetName = explode("|", $str); |
609 | 609 | $oWidgetModel = getModel("widget"); |
610 | 610 | $mInfo = array(); |
611 | - foreach($arrWidgetName as $widgetName) { |
|
611 | + foreach ($arrWidgetName as $widgetName) { |
|
612 | 612 | $widgetInfo = $oWidgetModel->getWidgetInfo($widgetName); |
613 | 613 | $mInfo[] = "{$widgetName}({$widgetInfo->version})"; |
614 | 614 | } |
615 | - $xe_check_env[$arr[0]]= join(", ", $mInfo); |
|
616 | - } elseif($arr[0]=="widgetstyle") { |
|
615 | + $xe_check_env[$arr[0]] = join(", ", $mInfo); |
|
616 | + } elseif ($arr[0] == "widgetstyle") { |
|
617 | 617 | $str = urldecode($arr[1]); |
618 | 618 | $arrWidgetstyleName = explode("|", $str); |
619 | 619 | $oWidgetModel = getModel("widget"); |
620 | 620 | $mInfo = array(); |
621 | - foreach($arrWidgetstyleName as $widgetstyleName) { |
|
621 | + foreach ($arrWidgetstyleName as $widgetstyleName) { |
|
622 | 622 | $widgetstyleInfo = $oWidgetModel->getWidgetStyleInfo($widgetstyleName); |
623 | 623 | $mInfo[] = "{$widgetstyleName}({$widgetstyleInfo->version})"; |
624 | 624 | } |
625 | - $xe_check_env[$arr[0]]= join(", ", $mInfo); |
|
625 | + $xe_check_env[$arr[0]] = join(", ", $mInfo); |
|
626 | 626 | |
627 | - } elseif($arr[0]=="layout") { |
|
627 | + } elseif ($arr[0] == "layout") { |
|
628 | 628 | $str = urldecode($arr[1]); |
629 | 629 | $arrLayoutName = explode("|", $str); |
630 | 630 | $oLayoutModel = getModel("layout"); |
631 | 631 | $mInfo = array(); |
632 | - foreach($arrLayoutName as $layoutName) { |
|
632 | + foreach ($arrLayoutName as $layoutName) { |
|
633 | 633 | $layoutInfo = $oLayoutModel->getLayoutInfo($layoutName); |
634 | 634 | $mInfo[] = "{$layoutName}({$layoutInfo->version})"; |
635 | 635 | } |
636 | - $xe_check_env[$arr[0]]= join(", ", $mInfo); |
|
636 | + $xe_check_env[$arr[0]] = join(", ", $mInfo); |
|
637 | 637 | } else { |
638 | 638 | $xe_check_env[$arr[0]] = urldecode($arr[1]); |
639 | 639 | } |
@@ -648,14 +648,14 @@ discard block |
||
648 | 648 | $info['PHP_Core'] = $php_core; |
649 | 649 | |
650 | 650 | $str_info = "[XE Server Environment " . date("Y-m-d") . "]\n\n"; |
651 | - $str_info .= "realpath : ".realpath('./')."\n"; |
|
652 | - foreach( $info as $key=>$value ) |
|
651 | + $str_info .= "realpath : " . realpath('./') . "\n"; |
|
652 | + foreach ($info as $key=>$value) |
|
653 | 653 | { |
654 | - if( is_array( $value ) == false ) { |
|
654 | + if (is_array($value) == false) { |
|
655 | 655 | $str_info .= "{$key} : {$value}\n"; |
656 | 656 | } else { |
657 | 657 | //$str_info .= "\n{$key} \n"; |
658 | - foreach( $value as $key2=>$value2 ) |
|
658 | + foreach ($value as $key2=>$value2) |
|
659 | 659 | $str_info .= "{$key2} : {$value2}\n"; |
660 | 660 | } |
661 | 661 | } |
@@ -31,8 +31,7 @@ discard block |
||
31 | 31 | if(strpos($db_info->default_url, 'xn--') !== FALSE) |
32 | 32 | { |
33 | 33 | $xe_default_url = Context::decodeIdna($db_info->default_url); |
34 | - } |
|
35 | - else |
|
34 | + } else |
|
36 | 35 | { |
37 | 36 | $xe_default_url = $db_info->default_url; |
38 | 37 | } |
@@ -434,9 +433,15 @@ discard block |
||
434 | 433 | |
435 | 434 | // site lock |
436 | 435 | Context::set('IP', $_SERVER['REMOTE_ADDR']); |
437 | - if(!$db_info->sitelock_title) $db_info->sitelock_title = 'Maintenance in progress...'; |
|
438 | - if(!in_array('127.0.0.1', $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = '127.0.0.1'; |
|
439 | - if(!in_array($_SERVER['REMOTE_ADDR'], $db_info->sitelock_whitelist)) $db_info->sitelock_whitelist[] = $_SERVER['REMOTE_ADDR']; |
|
436 | + if(!$db_info->sitelock_title) { |
|
437 | + $db_info->sitelock_title = 'Maintenance in progress...'; |
|
438 | + } |
|
439 | + if(!in_array('127.0.0.1', $db_info->sitelock_whitelist)) { |
|
440 | + $db_info->sitelock_whitelist[] = '127.0.0.1'; |
|
441 | + } |
|
442 | + if(!in_array($_SERVER['REMOTE_ADDR'], $db_info->sitelock_whitelist)) { |
|
443 | + $db_info->sitelock_whitelist[] = $_SERVER['REMOTE_ADDR']; |
|
444 | + } |
|
440 | 445 | $db_info->sitelock_whitelist = array_unique($db_info->sitelock_whitelist); |
441 | 446 | Context::set('remote_addr', $_SERVER['REMOTE_ADDR']); |
442 | 447 | Context::set('use_sitelock', $db_info->use_sitelock); |
@@ -447,8 +452,11 @@ discard block |
||
447 | 452 | Context::set('sitelock_whitelist', $whitelist); |
448 | 453 | |
449 | 454 | |
450 | - if($db_info->admin_ip_list) $admin_ip_list = implode("\r\n", $db_info->admin_ip_list); |
|
451 | - else $admin_ip_list = ''; |
|
455 | + if($db_info->admin_ip_list) { |
|
456 | + $admin_ip_list = implode("\r\n", $db_info->admin_ip_list); |
|
457 | + } else { |
|
458 | + $admin_ip_list = ''; |
|
459 | + } |
|
452 | 460 | Context::set('admin_ip_list', $admin_ip_list); |
453 | 461 | |
454 | 462 | Context::set('lang_selected', Context::loadLangSelected()); |
@@ -547,8 +555,7 @@ discard block |
||
547 | 555 | Context::addHtmlFooter($img); |
548 | 556 | |
549 | 557 | FileHandler::writeFile($path . $mainVersion, '1'); |
550 | - } |
|
551 | - else if(isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path . $mainVersion))) |
|
558 | + } else if(isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path . $mainVersion))) |
|
552 | 559 | { |
553 | 560 | if($_SESSION['enviroment_gather'] == 'Y') |
554 | 561 | { |
@@ -580,7 +587,7 @@ discard block |
||
580 | 587 | $arr = explode("=", $value); |
581 | 588 | if($arr[0]=="type") { |
582 | 589 | continue; |
583 | - }elseif($arr[0]=="phpext" ) { |
|
590 | + } elseif($arr[0]=="phpext" ) { |
|
584 | 591 | $str = urldecode($arr[1]); |
585 | 592 | $xe_check_env[$arr[0]]= str_replace("|", ", ", $str); |
586 | 593 | } elseif($arr[0]=="module" ) { |
@@ -655,8 +662,9 @@ discard block |
||
655 | 662 | $str_info .= "{$key} : {$value}\n"; |
656 | 663 | } else { |
657 | 664 | //$str_info .= "\n{$key} \n"; |
658 | - foreach( $value as $key2=>$value2 ) |
|
659 | - $str_info .= "{$key2} : {$value2}\n"; |
|
665 | + foreach( $value as $key2=>$value2 ) { |
|
666 | + $str_info .= "{$key2} : {$value2}\n"; |
|
667 | + } |
|
660 | 668 | } |
661 | 669 | } |
662 | 670 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Initialization |
17 | - * @return void |
|
17 | + * @return ModuleObject|null |
|
18 | 18 | */ |
19 | 19 | function init() |
20 | 20 | { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | // forbit access if the user is not an administrator |
22 | 22 | $oMemberModel = getModel('member'); |
23 | 23 | $logged_info = $oMemberModel->getLoggedInfo(); |
24 | - if($logged_info->is_admin != 'Y') |
|
24 | + if ($logged_info->is_admin != 'Y') |
|
25 | 25 | { |
26 | 26 | return $this->stop("msg_is_not_administrator"); |
27 | 27 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | function insertLog($module, $act) |
35 | 35 | { |
36 | - if(!$module || !$act) |
|
36 | + if (!$module || !$act) |
|
37 | 37 | { |
38 | 38 | return; |
39 | 39 | } |
@@ -332,6 +332,7 @@ |
||
332 | 332 | /** |
333 | 333 | * Uninstall package by package serial number |
334 | 334 | * |
335 | + * @param string $package_srl |
|
335 | 336 | * @return Object |
336 | 337 | */ |
337 | 338 | function uninstallPackageByPackageSrl($package_srl) |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $oModel = getModel('autoinstall'); |
66 | 66 | $item = $oModel->getLatestPackage(); |
67 | - if($item) |
|
67 | + if ($item) |
|
68 | 68 | { |
69 | 69 | $params["updatedate"] = $item->updatedate; |
70 | 70 | } |
@@ -92,23 +92,23 @@ discard block |
||
92 | 92 | executeQuery("autoinstall.deleteInstalledPackage"); |
93 | 93 | $oModel = getModel('autoinstall'); |
94 | 94 | $packages = $oModel->getPackages(); |
95 | - foreach($packages as $package) |
|
95 | + foreach ($packages as $package) |
|
96 | 96 | { |
97 | 97 | $real_path = FileHandler::getRealPath($package->path); |
98 | - if(!file_exists($real_path)) |
|
98 | + if (!file_exists($real_path)) |
|
99 | 99 | { |
100 | 100 | continue; |
101 | 101 | } |
102 | 102 | |
103 | 103 | $type = $oModel->getTypeFromPath($package->path); |
104 | - if($type == "core") |
|
104 | + if ($type == "core") |
|
105 | 105 | { |
106 | 106 | $version = __XE_VERSION__; |
107 | 107 | } |
108 | 108 | else |
109 | 109 | { |
110 | 110 | $config_file = NULL; |
111 | - switch($type) |
|
111 | + switch ($type) |
|
112 | 112 | { |
113 | 113 | case "m.layout": |
114 | 114 | $type = "layout"; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | break; |
139 | 139 | } |
140 | 140 | |
141 | - if(!$config_file) |
|
141 | + if (!$config_file) |
|
142 | 142 | { |
143 | 143 | continue; |
144 | 144 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $xml = new XmlParser(); |
147 | 147 | $xmlDoc = $xml->loadXmlFile($real_path . $config_file); |
148 | 148 | |
149 | - if(!$xmlDoc) |
|
149 | + if (!$xmlDoc) |
|
150 | 150 | { |
151 | 151 | continue; |
152 | 152 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $args->package_srl = $package->package_srl; |
159 | 159 | $args->version = $package->version; |
160 | 160 | $args->current_version = $version; |
161 | - if(version_compare($args->version, $args->current_version, ">")) |
|
161 | + if (version_compare($args->version, $args->current_version, ">")) |
|
162 | 162 | { |
163 | 163 | $args->need_update = "Y"; |
164 | 164 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $oAdminModel = getAdminModel('autoinstall'); |
185 | 185 | $packages = explode(',', $package_srls); |
186 | 186 | $ftp_info = Context::getFTPInfo(); |
187 | - if(!$_SESSION['ftp_password']) |
|
187 | + if (!$_SESSION['ftp_password']) |
|
188 | 188 | { |
189 | 189 | $ftp_password = Context::get('ftp_password'); |
190 | 190 | } |
@@ -194,18 +194,18 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | $isSftpSupported = function_exists(ssh2_sftp); |
197 | - foreach($packages as $package_srl) |
|
197 | + foreach ($packages as $package_srl) |
|
198 | 198 | { |
199 | 199 | $package = $oModel->getPackage($package_srl); |
200 | - if($oAdminModel->checkUseDirectModuleInstall($package)->toBool()) |
|
200 | + if ($oAdminModel->checkUseDirectModuleInstall($package)->toBool()) |
|
201 | 201 | { |
202 | 202 | $oModuleInstaller = new DirectModuleInstaller($package); |
203 | 203 | } |
204 | - else if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) |
|
204 | + else if ($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) |
|
205 | 205 | { |
206 | 206 | $oModuleInstaller = new SFTPModuleInstaller($package); |
207 | 207 | } |
208 | - else if(function_exists(ftp_connect)) |
|
208 | + else if (function_exists(ftp_connect)) |
|
209 | 209 | { |
210 | 210 | $oModuleInstaller = new PHPFTPModuleInstaller($package); |
211 | 211 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $oModuleInstaller->setServerUrl(_XE_DOWNLOAD_SERVER_); |
218 | 218 | $oModuleInstaller->setPassword($ftp_password); |
219 | 219 | $output = $oModuleInstaller->install(); |
220 | - if(!$output->toBool()) |
|
220 | + if (!$output->toBool()) |
|
221 | 221 | { |
222 | 222 | return $output; |
223 | 223 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | $this->setMessage('success_installed', 'update'); |
229 | 229 | |
230 | - if(Context::get('return_url')) |
|
230 | + if (Context::get('return_url')) |
|
231 | 231 | { |
232 | 232 | $this->setRedirectUrl(Context::get('return_url')); |
233 | 233 | } |
@@ -246,30 +246,30 @@ discard block |
||
246 | 246 | function updatePackages(&$xmlDoc) |
247 | 247 | { |
248 | 248 | $oModel = getModel('autoinstall'); |
249 | - if(!$xmlDoc->response->packages->item) |
|
249 | + if (!$xmlDoc->response->packages->item) |
|
250 | 250 | { |
251 | 251 | return; |
252 | 252 | } |
253 | - if(!is_array($xmlDoc->response->packages->item)) |
|
253 | + if (!is_array($xmlDoc->response->packages->item)) |
|
254 | 254 | { |
255 | 255 | $xmlDoc->response->packages->item = array($xmlDoc->response->packages->item); |
256 | 256 | } |
257 | 257 | $targets = array('package_srl', 'updatedate', 'latest_item_srl', 'path', 'version', 'category_srl', 'have_instance'); |
258 | - foreach($xmlDoc->response->packages->item as $item) |
|
258 | + foreach ($xmlDoc->response->packages->item as $item) |
|
259 | 259 | { |
260 | 260 | $args = new stdClass(); |
261 | - foreach($targets as $target) |
|
261 | + foreach ($targets as $target) |
|
262 | 262 | { |
263 | 263 | $args->{$target} = $item->{$target}->body; |
264 | 264 | } |
265 | - if($oModel->getPackage($args->package_srl)) |
|
265 | + if ($oModel->getPackage($args->package_srl)) |
|
266 | 266 | { |
267 | 267 | $output = executeQuery("autoinstall.updatePackage", $args); |
268 | 268 | } |
269 | 269 | else |
270 | 270 | { |
271 | 271 | $output = executeQuery("autoinstall.insertPackage", $args); |
272 | - if(!$output->toBool()) |
|
272 | + if (!$output->toBool()) |
|
273 | 273 | { |
274 | 274 | $output = executeQuery("autoinstall.deletePackage", $args); |
275 | 275 | $output = executeQuery("autoinstall.insertPackage", $args); |
@@ -288,12 +288,12 @@ discard block |
||
288 | 288 | { |
289 | 289 | executeQuery("autoinstall.deleteCategory"); |
290 | 290 | $oModel = getModel('autoinstall'); |
291 | - if(!is_array($xmlDoc->response->categorylist->item)) |
|
291 | + if (!is_array($xmlDoc->response->categorylist->item)) |
|
292 | 292 | { |
293 | 293 | $xmlDoc->response->categorylist->item = array($xmlDoc->response->categorylist->item); |
294 | 294 | } |
295 | 295 | $list_order = 0; |
296 | - foreach($xmlDoc->response->categorylist->item as $item) |
|
296 | + foreach ($xmlDoc->response->categorylist->item as $item) |
|
297 | 297 | { |
298 | 298 | $args = new stdClass(); |
299 | 299 | $args->category_srl = $item->category_srl->body; |
@@ -314,12 +314,12 @@ discard block |
||
314 | 314 | $package_srl = Context::get('package_srl'); |
315 | 315 | |
316 | 316 | $output = $this->uninstallPackageByPackageSrl($package_srl); |
317 | - if($output->toBool()==FALSE) |
|
317 | + if ($output->toBool() == FALSE) |
|
318 | 318 | { |
319 | 319 | return $output; |
320 | 320 | } |
321 | 321 | |
322 | - if(Context::get('return_url')) |
|
322 | + if (Context::get('return_url')) |
|
323 | 323 | { |
324 | 324 | $this->setRedirectUrl(Context::get('return_url')); |
325 | 325 | } |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | |
360 | 360 | $oAdminModel = getAdminModel('autoinstall'); |
361 | 361 | |
362 | - if(!$_SESSION['ftp_password']) |
|
362 | + if (!$_SESSION['ftp_password']) |
|
363 | 363 | { |
364 | 364 | $ftp_password = Context::get('ftp_password'); |
365 | 365 | } |
@@ -370,15 +370,15 @@ discard block |
||
370 | 370 | $ftp_info = Context::getFTPInfo(); |
371 | 371 | |
372 | 372 | $isSftpSupported = function_exists(ssh2_sftp); |
373 | - if($oAdminModel->checkUseDirectModuleInstall($package)->toBool()) |
|
373 | + if ($oAdminModel->checkUseDirectModuleInstall($package)->toBool()) |
|
374 | 374 | { |
375 | 375 | $oModuleInstaller = new DirectModuleInstaller($package); |
376 | 376 | } |
377 | - else if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) |
|
377 | + else if ($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) |
|
378 | 378 | { |
379 | 379 | $oModuleInstaller = new SFTPModuleInstaller($package); |
380 | 380 | } |
381 | - else if(function_exists('ftp_connect')) |
|
381 | + else if (function_exists('ftp_connect')) |
|
382 | 382 | { |
383 | 383 | $oModuleInstaller = new PHPFTPModuleInstaller($package); |
384 | 384 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | |
392 | 392 | $oModuleInstaller->setPassword($ftp_password); |
393 | 393 | $output = $oModuleInstaller->uninstall(); |
394 | - if(!$output->toBool()) |
|
394 | + if (!$output->toBool()) |
|
395 | 395 | { |
396 | 396 | return $output; |
397 | 397 | } |
@@ -104,8 +104,7 @@ discard block |
||
104 | 104 | if($type == "core") |
105 | 105 | { |
106 | 106 | $version = __XE_VERSION__; |
107 | - } |
|
108 | - else |
|
107 | + } else |
|
109 | 108 | { |
110 | 109 | $config_file = NULL; |
111 | 110 | switch($type) |
@@ -161,8 +160,7 @@ discard block |
||
161 | 160 | if(version_compare($args->version, $args->current_version, ">")) |
162 | 161 | { |
163 | 162 | $args->need_update = "Y"; |
164 | - } |
|
165 | - else |
|
163 | + } else |
|
166 | 164 | { |
167 | 165 | $args->need_update = "N"; |
168 | 166 | } |
@@ -187,8 +185,7 @@ discard block |
||
187 | 185 | if(!$_SESSION['ftp_password']) |
188 | 186 | { |
189 | 187 | $ftp_password = Context::get('ftp_password'); |
190 | - } |
|
191 | - else |
|
188 | + } else |
|
192 | 189 | { |
193 | 190 | $ftp_password = $_SESSION['ftp_password']; |
194 | 191 | } |
@@ -200,16 +197,13 @@ discard block |
||
200 | 197 | if($oAdminModel->checkUseDirectModuleInstall($package)->toBool()) |
201 | 198 | { |
202 | 199 | $oModuleInstaller = new DirectModuleInstaller($package); |
203 | - } |
|
204 | - else if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) |
|
200 | + } else if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) |
|
205 | 201 | { |
206 | 202 | $oModuleInstaller = new SFTPModuleInstaller($package); |
207 | - } |
|
208 | - else if(function_exists(ftp_connect)) |
|
203 | + } else if(function_exists(ftp_connect)) |
|
209 | 204 | { |
210 | 205 | $oModuleInstaller = new PHPFTPModuleInstaller($package); |
211 | - } |
|
212 | - else |
|
206 | + } else |
|
213 | 207 | { |
214 | 208 | $oModuleInstaller = new FTPModuleInstaller($package); |
215 | 209 | } |
@@ -230,8 +224,7 @@ discard block |
||
230 | 224 | if(Context::get('return_url')) |
231 | 225 | { |
232 | 226 | $this->setRedirectUrl(Context::get('return_url')); |
233 | - } |
|
234 | - else |
|
227 | + } else |
|
235 | 228 | { |
236 | 229 | $this->setRedirectUrl(preg_replace('/act=[^&]*/', 'act=dispAutoinstallAdminIndex', Context::get('error_return_url'))); |
237 | 230 | } |
@@ -265,8 +258,7 @@ discard block |
||
265 | 258 | if($oModel->getPackage($args->package_srl)) |
266 | 259 | { |
267 | 260 | $output = executeQuery("autoinstall.updatePackage", $args); |
268 | - } |
|
269 | - else |
|
261 | + } else |
|
270 | 262 | { |
271 | 263 | $output = executeQuery("autoinstall.insertPackage", $args); |
272 | 264 | if(!$output->toBool()) |
@@ -322,8 +314,7 @@ discard block |
||
322 | 314 | if(Context::get('return_url')) |
323 | 315 | { |
324 | 316 | $this->setRedirectUrl(Context::get('return_url')); |
325 | - } |
|
326 | - else |
|
317 | + } else |
|
327 | 318 | { |
328 | 319 | $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAutoinstallAdminInstalledPackages')); |
329 | 320 | } |
@@ -362,8 +353,7 @@ discard block |
||
362 | 353 | if(!$_SESSION['ftp_password']) |
363 | 354 | { |
364 | 355 | $ftp_password = Context::get('ftp_password'); |
365 | - } |
|
366 | - else |
|
356 | + } else |
|
367 | 357 | { |
368 | 358 | $ftp_password = $_SESSION['ftp_password']; |
369 | 359 | } |
@@ -373,16 +363,13 @@ discard block |
||
373 | 363 | if($oAdminModel->checkUseDirectModuleInstall($package)->toBool()) |
374 | 364 | { |
375 | 365 | $oModuleInstaller = new DirectModuleInstaller($package); |
376 | - } |
|
377 | - else if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) |
|
366 | + } else if($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) |
|
378 | 367 | { |
379 | 368 | $oModuleInstaller = new SFTPModuleInstaller($package); |
380 | - } |
|
381 | - else if(function_exists('ftp_connect')) |
|
369 | + } else if(function_exists('ftp_connect')) |
|
382 | 370 | { |
383 | 371 | $oModuleInstaller = new PHPFTPModuleInstaller($package); |
384 | - } |
|
385 | - else |
|
372 | + } else |
|
386 | 373 | { |
387 | 374 | $oModuleInstaller = new FTPModuleInstaller($package); |
388 | 375 | } |
@@ -15,6 +15,9 @@ discard block |
||
15 | 15 | |
16 | 16 | /** |
17 | 17 | * Pre process parameters |
18 | + * @param string $order_target |
|
19 | + * @param string $order_type |
|
20 | + * @param string $page |
|
18 | 21 | */ |
19 | 22 | function preProcParam(&$order_target, &$order_type, &$page) |
20 | 23 | { |
@@ -115,6 +118,10 @@ discard block |
||
115 | 118 | |
116 | 119 | /** |
117 | 120 | * Get Package List |
121 | + * @param string $type |
|
122 | + * @param string $search_keyword |
|
123 | + * @param integer $category_srl |
|
124 | + * @param string $parent_program |
|
118 | 125 | */ |
119 | 126 | function getPackageList($type, $order_target = 'newest', $order_type = 'desc', $page = '1', $search_keyword = NULL, $category_srl = NULL, $parent_program = NULL) |
120 | 127 | { |
@@ -19,19 +19,19 @@ discard block |
||
19 | 19 | function preProcParam(&$order_target, &$order_type, &$page) |
20 | 20 | { |
21 | 21 | $order_target_array = array('newest' => 1, 'download' => 1, 'popular' => 1); |
22 | - if(!isset($order_target_array[$order_target])) |
|
22 | + if (!isset($order_target_array[$order_target])) |
|
23 | 23 | { |
24 | 24 | $order_target = 'newest'; |
25 | 25 | } |
26 | 26 | |
27 | 27 | $order_type_array = array('asc' => 1, 'desc' => 1); |
28 | - if(!isset($order_type_array[$order_type])) |
|
28 | + if (!isset($order_type_array[$order_type])) |
|
29 | 29 | { |
30 | 30 | $order_type = 'desc'; |
31 | 31 | } |
32 | 32 | |
33 | 33 | $page = (int) $page; |
34 | - if($page < 1) |
|
34 | + if ($page < 1) |
|
35 | 35 | { |
36 | 36 | $page = 1; |
37 | 37 | } |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | |
64 | 64 | $type_array = array('M' => 1, 'P' => 1); |
65 | 65 | $type = Context::get('type'); |
66 | - if(!isset($type_array[$type])) |
|
66 | + if (!isset($type_array[$type])) |
|
67 | 67 | { |
68 | 68 | $type = 'P'; |
69 | 69 | } |
70 | 70 | |
71 | - if($type == 'P') |
|
71 | + if ($type == 'P') |
|
72 | 72 | { |
73 | 73 | $category_srl = $this->layout_category_srl; |
74 | 74 | } |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | |
96 | 96 | $type_array = array('M' => 1, 'P' => 1); |
97 | 97 | $type = Context::get('type'); |
98 | - if(!isset($type_array[$type])) |
|
98 | + if (!isset($type_array[$type])) |
|
99 | 99 | { |
100 | 100 | $type = 'P'; |
101 | 101 | } |
102 | 102 | |
103 | - if($type == 'P') |
|
103 | + if ($type == 'P') |
|
104 | 104 | { |
105 | 105 | $category_srl = $this->module_skin_category_srl; |
106 | 106 | } |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | */ |
119 | 119 | function getPackageList($type, $order_target = 'newest', $order_type = 'desc', $page = '1', $search_keyword = NULL, $category_srl = NULL, $parent_program = NULL) |
120 | 120 | { |
121 | - if($type == 'menu') |
|
121 | + if ($type == 'menu') |
|
122 | 122 | { |
123 | 123 | $params["act"] = "getResourceapiMenuPackageList"; |
124 | 124 | } |
125 | - elseif($type == 'skin') |
|
125 | + elseif ($type == 'skin') |
|
126 | 126 | { |
127 | 127 | $params["act"] = "getResourceapiSkinPackageList"; |
128 | 128 | $params['parent_program'] = $parent_program; |
@@ -137,18 +137,18 @@ discard block |
||
137 | 137 | $params["order_type"] = $order_type; |
138 | 138 | $params["page"] = $page; |
139 | 139 | |
140 | - if($category_srl) |
|
140 | + if ($category_srl) |
|
141 | 141 | { |
142 | 142 | $params["category_srl"] = $category_srl; |
143 | 143 | } |
144 | 144 | |
145 | - if($search_keyword) |
|
145 | + if ($search_keyword) |
|
146 | 146 | { |
147 | 147 | $params["search_keyword"] = $search_keyword; |
148 | 148 | } |
149 | 149 | |
150 | 150 | $xmlDoc = XmlGenerater::getXmlDoc($params); |
151 | - if($xmlDoc && $xmlDoc->response->packagelist->item) |
|
151 | + if ($xmlDoc && $xmlDoc->response->packagelist->item) |
|
152 | 152 | { |
153 | 153 | $item_list = $oAdminView->rearranges($xmlDoc->response->packagelist->item); |
154 | 154 | $this->add('item_list', $item_list); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $is_authed = 0; |
168 | 168 | |
169 | 169 | $ftp_info = Context::getFTPInfo(); |
170 | - if(!$ftp_info->ftp_root_path) |
|
170 | + if (!$ftp_info->ftp_root_path) |
|
171 | 171 | { |
172 | 172 | $is_authed = -1; |
173 | 173 | } |
@@ -186,14 +186,14 @@ discard block |
||
186 | 186 | { |
187 | 187 | $oModel = getModel('autoinstall'); |
188 | 188 | $output = executeQueryArray('autoinstall.getNeedUpdate'); |
189 | - if(!is_array($output->data)) |
|
189 | + if (!is_array($output->data)) |
|
190 | 190 | { |
191 | 191 | return NULL; |
192 | 192 | } |
193 | 193 | |
194 | 194 | $result = array(); |
195 | 195 | $xml = new XmlParser(); |
196 | - foreach($output->data as $package) |
|
196 | + foreach ($output->data as $package) |
|
197 | 197 | { |
198 | 198 | $packageSrl = $package->package_srl; |
199 | 199 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $packageInfo->type = $oModel->getTypeFromPath($package->path); |
204 | 204 | $packageInfo->url = $oModel->getUpdateUrlByPackageSrl($package->package_srl); |
205 | 205 | |
206 | - if($packageInfo->type == 'core') |
|
206 | + if ($packageInfo->type == 'core') |
|
207 | 207 | { |
208 | 208 | $title = 'XpressEngine'; |
209 | 209 | } |
@@ -212,18 +212,18 @@ discard block |
||
212 | 212 | $configFile = $oModel->getConfigFilePath($packageInfo->type); |
213 | 213 | $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($package->path) . $configFile); |
214 | 214 | |
215 | - if($xmlDoc) |
|
215 | + if ($xmlDoc) |
|
216 | 216 | { |
217 | 217 | $type = $packageInfo->type; |
218 | - if($type == "drcomponent") |
|
218 | + if ($type == "drcomponent") |
|
219 | 219 | { |
220 | 220 | $type = "component"; |
221 | 221 | } |
222 | - if($type == "style" || $type == "m.skin") |
|
222 | + if ($type == "style" || $type == "m.skin") |
|
223 | 223 | { |
224 | 224 | $type = "skin"; |
225 | 225 | } |
226 | - if($type == "m.layout") |
|
226 | + if ($type == "m.layout") |
|
227 | 227 | { |
228 | 228 | $type = "layout"; |
229 | 229 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $oModel = getModel('autoinstall'); |
258 | 258 | |
259 | 259 | $targetpackages = array(); |
260 | - if($xmlDoc) |
|
260 | + if ($xmlDoc) |
|
261 | 261 | { |
262 | 262 | $xmlPackage = $xmlDoc->response->package; |
263 | 263 | $package = new stdClass(); |
@@ -266,15 +266,15 @@ discard block |
||
266 | 266 | $package->package_description = $xmlPackage->package_description->body; |
267 | 267 | $package->version = $xmlPackage->version->body; |
268 | 268 | $package->path = $xmlPackage->path->body; |
269 | - if($xmlPackage->depends) |
|
269 | + if ($xmlPackage->depends) |
|
270 | 270 | { |
271 | - if(!is_array($xmlPackage->depends->item)) |
|
271 | + if (!is_array($xmlPackage->depends->item)) |
|
272 | 272 | { |
273 | 273 | $xmlPackage->depends->item = array($xmlPackage->depends->item); |
274 | 274 | } |
275 | 275 | |
276 | 276 | $package->depends = array(); |
277 | - foreach($xmlPackage->depends->item as $item) |
|
277 | + foreach ($xmlPackage->depends->item as $item) |
|
278 | 278 | { |
279 | 279 | $dep_item = new stdClass(); |
280 | 280 | $dep_item->package_srl = $item->package_srl->body; |
@@ -287,9 +287,9 @@ discard block |
||
287 | 287 | |
288 | 288 | $packages = $oModel->getInstalledPackages(array_keys($targetpackages)); |
289 | 289 | $package->deplist = ""; |
290 | - foreach($package->depends as $key => $dep) |
|
290 | + foreach ($package->depends as $key => $dep) |
|
291 | 291 | { |
292 | - if(!$packages[$dep->package_srl]) |
|
292 | + if (!$packages[$dep->package_srl]) |
|
293 | 293 | { |
294 | 294 | $package->depends[$key]->installed = FALSE; |
295 | 295 | $package->package_srl .= "," . $dep->package_srl; |
@@ -298,12 +298,12 @@ discard block |
||
298 | 298 | { |
299 | 299 | $package->depends[$key]->installed = TRUE; |
300 | 300 | $package->depends[$key]->cur_version = $packages[$dep->package_srl]->current_version; |
301 | - if(version_compare($dep->version, $packages[$dep->package_srl]->current_version, ">")) |
|
301 | + if (version_compare($dep->version, $packages[$dep->package_srl]->current_version, ">")) |
|
302 | 302 | { |
303 | 303 | $package->depends[$key]->need_update = TRUE; |
304 | 304 | $package->package_srl .= "," . $dep->package_srl; |
305 | 305 | |
306 | - if($dep->path === '.') |
|
306 | + if ($dep->path === '.') |
|
307 | 307 | { |
308 | 308 | $package->contain_core = TRUE; |
309 | 309 | $package->contain_core_version = $dep->version; |
@@ -318,14 +318,14 @@ discard block |
||
318 | 318 | } |
319 | 319 | |
320 | 320 | $installedPackage = $oModel->getInstalledPackage($packageSrl); |
321 | - if($installedPackage) |
|
321 | + if ($installedPackage) |
|
322 | 322 | { |
323 | 323 | $package->installed = TRUE; |
324 | 324 | $package->cur_version = $installedPackage->current_version; |
325 | 325 | $package->need_update = version_compare($package->version, $installedPackage->current_version, ">"); |
326 | 326 | } |
327 | 327 | |
328 | - if($package->path === '.') |
|
328 | + if ($package->path === '.') |
|
329 | 329 | { |
330 | 330 | $package->contain_core = TRUE; |
331 | 331 | $package->contain_core_version = $package->version; |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | public function getAutoInstallAdminInstallInfo() |
342 | 342 | { |
343 | 343 | $packageSrl = Context::get('package_srl'); |
344 | - if(!$packageSrl) |
|
344 | + if (!$packageSrl) |
|
345 | 345 | { |
346 | 346 | return new Object(-1, 'msg_invalid_request'); |
347 | 347 | } |
@@ -355,23 +355,23 @@ discard block |
||
355 | 355 | $directModuleInstall = TRUE; |
356 | 356 | $arrUnwritableDir = array(); |
357 | 357 | $output = $this->isWritableDir($package->path); |
358 | - if($output->toBool()==FALSE) |
|
358 | + if ($output->toBool() == FALSE) |
|
359 | 359 | { |
360 | 360 | $directModuleInstall = FALSE; |
361 | 361 | $arrUnwritableDir[] = $output->get('path'); |
362 | 362 | } |
363 | 363 | |
364 | - foreach($package->depends as $dep) |
|
364 | + foreach ($package->depends as $dep) |
|
365 | 365 | { |
366 | 366 | $output = $this->isWritableDir($dep->path); |
367 | - if($output->toBool()==FALSE) |
|
367 | + if ($output->toBool() == FALSE) |
|
368 | 368 | { |
369 | 369 | $directModuleInstall = FALSE; |
370 | 370 | $arrUnwritableDir[] = $output->get('path'); |
371 | 371 | } |
372 | 372 | } |
373 | 373 | |
374 | - if($directModuleInstall==FALSE) |
|
374 | + if ($directModuleInstall == FALSE) |
|
375 | 375 | { |
376 | 376 | $output = new Object(-1, 'msg_direct_inall_invalid'); |
377 | 377 | $output->add('path', $arrUnwritableDir); |
@@ -386,17 +386,17 @@ discard block |
||
386 | 386 | $path_list = explode('/', dirname($path)); |
387 | 387 | $real_path = './'; |
388 | 388 | |
389 | - while($path_list) |
|
389 | + while ($path_list) |
|
390 | 390 | { |
391 | 391 | $check_path = realpath($real_path . implode('/', $path_list)); |
392 | - if(FileHandler::isDir($check_path)) |
|
392 | + if (FileHandler::isDir($check_path)) |
|
393 | 393 | { |
394 | 394 | break; |
395 | 395 | } |
396 | 396 | array_pop($path_list); |
397 | 397 | } |
398 | 398 | |
399 | - if(FileHandler::isWritableDir($check_path)==FALSE) |
|
399 | + if (FileHandler::isWritableDir($check_path) == FALSE) |
|
400 | 400 | { |
401 | 401 | $output = new Object(-1, 'msg_unwritable_directory'); |
402 | 402 | $output->add('path', FileHandler::getRealPath($check_path)); |
@@ -71,8 +71,7 @@ discard block |
||
71 | 71 | if($type == 'P') |
72 | 72 | { |
73 | 73 | $category_srl = $this->layout_category_srl; |
74 | - } |
|
75 | - else |
|
74 | + } else |
|
76 | 75 | { |
77 | 76 | $category_srl = $this->mobile_layout_category_srl; |
78 | 77 | } |
@@ -103,8 +102,7 @@ discard block |
||
103 | 102 | if($type == 'P') |
104 | 103 | { |
105 | 104 | $category_srl = $this->module_skin_category_srl; |
106 | - } |
|
107 | - else |
|
105 | + } else |
|
108 | 106 | { |
109 | 107 | $category_srl = $this->module_mobile_skin_category_srl; |
110 | 108 | } |
@@ -121,13 +119,11 @@ discard block |
||
121 | 119 | if($type == 'menu') |
122 | 120 | { |
123 | 121 | $params["act"] = "getResourceapiMenuPackageList"; |
124 | - } |
|
125 | - elseif($type == 'skin') |
|
122 | + } elseif($type == 'skin') |
|
126 | 123 | { |
127 | 124 | $params["act"] = "getResourceapiSkinPackageList"; |
128 | 125 | $params['parent_program'] = $parent_program; |
129 | - } |
|
130 | - else |
|
126 | + } else |
|
131 | 127 | { |
132 | 128 | $params["act"] = "getResourceapiPackagelist"; |
133 | 129 | } |
@@ -170,8 +166,7 @@ discard block |
||
170 | 166 | if(!$ftp_info->ftp_root_path) |
171 | 167 | { |
172 | 168 | $is_authed = -1; |
173 | - } |
|
174 | - else |
|
169 | + } else |
|
175 | 170 | { |
176 | 171 | $is_authed = (int) isset($_SESSION['ftp_password']); |
177 | 172 | } |
@@ -206,8 +201,7 @@ discard block |
||
206 | 201 | if($packageInfo->type == 'core') |
207 | 202 | { |
208 | 203 | $title = 'XpressEngine'; |
209 | - } |
|
210 | - else |
|
204 | + } else |
|
211 | 205 | { |
212 | 206 | $configFile = $oModel->getConfigFilePath($packageInfo->type); |
213 | 207 | $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($package->path) . $configFile); |
@@ -228,8 +222,7 @@ discard block |
||
228 | 222 | $type = "layout"; |
229 | 223 | } |
230 | 224 | $title = $xmlDoc->{$type}->title->body; |
231 | - } |
|
232 | - else |
|
225 | + } else |
|
233 | 226 | { |
234 | 227 | $pathInfo = explode('/', $package->path); |
235 | 228 | $title = $pathInfo[count($pathInfo) - 1]; |
@@ -293,8 +286,7 @@ discard block |
||
293 | 286 | { |
294 | 287 | $package->depends[$key]->installed = FALSE; |
295 | 288 | $package->package_srl .= "," . $dep->package_srl; |
296 | - } |
|
297 | - else |
|
289 | + } else |
|
298 | 290 | { |
299 | 291 | $package->depends[$key]->installed = TRUE; |
300 | 292 | $package->depends[$key]->cur_version = $packages[$dep->package_srl]->current_version; |
@@ -308,8 +300,7 @@ discard block |
||
308 | 300 | $package->contain_core = TRUE; |
309 | 301 | $package->contain_core_version = $dep->version; |
310 | 302 | } |
311 | - } |
|
312 | - else |
|
303 | + } else |
|
313 | 304 | { |
314 | 305 | $package->need_update = FALSE; |
315 | 306 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @param object $item |
87 | 87 | * @param object $targets |
88 | - * @return object |
|
88 | + * @return stdClass |
|
89 | 89 | */ |
90 | 90 | function rearrange(&$item, &$targets) |
91 | 91 | { |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | /** |
348 | 348 | * Display install package |
349 | 349 | * |
350 | - * @return Object |
|
350 | + * @return ModuleObject|null |
|
351 | 351 | */ |
352 | 352 | function dispAutoinstallAdminInstall() |
353 | 353 | { |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | /** |
385 | 385 | * Display package list |
386 | 386 | * |
387 | - * @return Object |
|
387 | + * @return ModuleObject|null |
|
388 | 388 | */ |
389 | 389 | function dispAutoinstallAdminIndex() |
390 | 390 | { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->setTemplatePath($template_path); |
34 | 34 | |
35 | 35 | $ftp_info = Context::getFTPInfo(); |
36 | - if(!$ftp_info->ftp_root_path) |
|
36 | + if (!$ftp_info->ftp_root_path) |
|
37 | 37 | { |
38 | 38 | Context::set('show_ftp_note', TRUE); |
39 | 39 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | function rearrange(&$item, &$targets) |
91 | 91 | { |
92 | 92 | $ret = new stdClass(); |
93 | - foreach($targets as $target) |
|
93 | + foreach ($targets as $target) |
|
94 | 94 | { |
95 | 95 | $ret->{$target} = $item->{$target}->body; |
96 | 96 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | */ |
170 | 170 | function rearranges($items, $packages = null) |
171 | 171 | { |
172 | - if(!is_array($items)) |
|
172 | + if (!is_array($items)) |
|
173 | 173 | { |
174 | 174 | $items = array($items); |
175 | 175 | } |
@@ -178,47 +178,47 @@ discard block |
||
178 | 178 | $targets = array('category_srl', 'package_srl', 'item_screenshot_url', 'package_voted', 'package_voter', 'package_description', 'package_downloaded', 'item_regdate', 'title', 'item_version', 'package_star', 'depfrom'); |
179 | 179 | $targetpackages = array(); |
180 | 180 | |
181 | - foreach($items as $item) |
|
181 | + foreach ($items as $item) |
|
182 | 182 | { |
183 | 183 | $targetpackages[$item->package_srl->body] = 0; |
184 | 184 | } |
185 | 185 | |
186 | 186 | $oModel = getModel('autoinstall'); |
187 | 187 | |
188 | - if($package == null) |
|
188 | + if ($package == null) |
|
189 | 189 | { |
190 | 190 | $packages = $oModel->getInstalledPackages(array_keys($targetpackages)); |
191 | 191 | } |
192 | 192 | |
193 | 193 | $depto = array(); |
194 | 194 | |
195 | - foreach($items as $item) |
|
195 | + foreach ($items as $item) |
|
196 | 196 | { |
197 | 197 | $v = $this->rearrange($item, $targets); |
198 | 198 | $v->item_screenshot_url = str_replace('./', _XE_DOWNLOAD_SERVER_, $v->item_screenshot_url); |
199 | 199 | $v->category = $this->categories[$v->category_srl]->title; |
200 | 200 | $v->url = _XE_LOCATION_SITE_ . '?mid=download&package_srl=' . $v->package_srl; |
201 | 201 | |
202 | - if($packages[$v->package_srl]) |
|
202 | + if ($packages[$v->package_srl]) |
|
203 | 203 | { |
204 | 204 | $v->current_version = $packages[$v->package_srl]->current_version; |
205 | 205 | $v->need_update = $packages[$v->package_srl]->need_update; |
206 | 206 | $v->type = $oModel->getTypeFromPath($packages[$v->package_srl]->path); |
207 | 207 | |
208 | - if($this->ftp_set && $v->depfrom) |
|
208 | + if ($this->ftp_set && $v->depfrom) |
|
209 | 209 | { |
210 | 210 | $depfrom = explode(",", $v->depfrom); |
211 | - foreach($depfrom as $package_srl) |
|
211 | + foreach ($depfrom as $package_srl) |
|
212 | 212 | { |
213 | 213 | $depto[$package_srl][] = $v->package_srl; |
214 | 214 | } |
215 | 215 | } |
216 | 216 | |
217 | - if($v->type == "core") |
|
217 | + if ($v->type == "core") |
|
218 | 218 | { |
219 | 219 | $v->avail_remove = FALSE; |
220 | 220 | } |
221 | - else if($v->type == "module") |
|
221 | + else if ($v->type == "module") |
|
222 | 222 | { |
223 | 223 | $v->avail_remove = $oModel->checkRemovable($packages[$v->package_srl]->path); |
224 | 224 | } |
@@ -230,41 +230,41 @@ discard block |
||
230 | 230 | $item_list[$v->package_srl] = $v; |
231 | 231 | } |
232 | 232 | |
233 | - if(count($depto) > 0) |
|
233 | + if (count($depto) > 0) |
|
234 | 234 | { |
235 | 235 | $installed = $oModel->getInstalledPackages(implode(",", array_keys($depto))); |
236 | - foreach($installed as $key => $val) |
|
236 | + foreach ($installed as $key => $val) |
|
237 | 237 | { |
238 | 238 | $path = $val->path; |
239 | 239 | $type = $oModel->getTypeFromPath($path); |
240 | 240 | |
241 | - if(!$type || $type == "core") |
|
241 | + if (!$type || $type == "core") |
|
242 | 242 | { |
243 | 243 | continue; |
244 | 244 | } |
245 | 245 | |
246 | 246 | $config_file = $oModel->getConfigFilePath($type); |
247 | - if(!$config_file) |
|
247 | + if (!$config_file) |
|
248 | 248 | { |
249 | 249 | continue; |
250 | 250 | } |
251 | 251 | |
252 | 252 | $xml = new XmlParser(); |
253 | 253 | $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($path) . $config_file); |
254 | - if(!$xmlDoc) |
|
254 | + if (!$xmlDoc) |
|
255 | 255 | { |
256 | 256 | continue; |
257 | 257 | } |
258 | 258 | |
259 | - if($type == "drcomponent") |
|
259 | + if ($type == "drcomponent") |
|
260 | 260 | { |
261 | 261 | $type = "component"; |
262 | 262 | } |
263 | - if($type == "style" || $type == "m.skin") |
|
263 | + if ($type == "style" || $type == "m.skin") |
|
264 | 264 | { |
265 | 265 | $type = "skin"; |
266 | 266 | } |
267 | - if($type == "m.layout") |
|
267 | + if ($type == "m.layout") |
|
268 | 268 | { |
269 | 269 | $type = "layout"; |
270 | 270 | } |
@@ -276,9 +276,9 @@ discard block |
||
276 | 276 | $oSecurity = new Security(); |
277 | 277 | $oSecurity->encodeHTML('installed..'); |
278 | 278 | |
279 | - foreach($installed as $key => $val) |
|
279 | + foreach ($installed as $key => $val) |
|
280 | 280 | { |
281 | - foreach($depto[$key] as $package_srl) |
|
281 | + foreach ($depto[$key] as $package_srl) |
|
282 | 282 | { |
283 | 283 | $item_list[$package_srl]->avail_remove = false; |
284 | 284 | $item_list[$package_srl]->deps[] = $key; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | function dispAutoinstallAdminInstalledPackages() |
298 | 298 | { |
299 | 299 | $page = Context::get('page'); |
300 | - if(!$page) |
|
300 | + if (!$page) |
|
301 | 301 | { |
302 | 302 | $page = 1; |
303 | 303 | } |
@@ -313,13 +313,13 @@ discard block |
||
313 | 313 | $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml"); |
314 | 314 | $xml_lUpdate = new XmlParser(); |
315 | 315 | $xmlDoc = $xml_lUpdate->parse($buff); |
316 | - if($xmlDoc && $xmlDoc->response->packagelist->item) |
|
316 | + if ($xmlDoc && $xmlDoc->response->packagelist->item) |
|
317 | 317 | { |
318 | 318 | $item_list = $this->rearranges($xmlDoc->response->packagelist->item, $package_list); |
319 | 319 | $res = array(); |
320 | - foreach($package_list as $package_srl => $package) |
|
320 | + foreach ($package_list as $package_srl => $package) |
|
321 | 321 | { |
322 | - if($item_list[$package_srl]) |
|
322 | + if ($item_list[$package_srl]) |
|
323 | 323 | { |
324 | 324 | $res[] = $item_list[$package_srl]; |
325 | 325 | } |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | Context::set('item_list', $res); |
328 | 328 | } |
329 | 329 | |
330 | - if(count($package_list) != count($res)) |
|
330 | + if (count($package_list) != count($res)) |
|
331 | 331 | { |
332 | 332 | $localPackageSrls = array_keys($package_list); |
333 | 333 | $remotePackageSrls = array_keys($item_list); |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | function dispAutoinstallAdminInstall() |
353 | 353 | { |
354 | 354 | $package_srl = Context::get('package_srl'); |
355 | - if(!$package_srl) |
|
355 | + if (!$package_srl) |
|
356 | 356 | { |
357 | 357 | return $this->dispAutoinstallAdminIndex(); |
358 | 358 | } |
@@ -363,13 +363,13 @@ discard block |
||
363 | 363 | Context::set("package", $package); |
364 | 364 | Context::set('contain_core', $package->contain_core); |
365 | 365 | |
366 | - if(!$_SESSION['ftp_password']) |
|
366 | + if (!$_SESSION['ftp_password']) |
|
367 | 367 | { |
368 | 368 | Context::set('need_password', TRUE); |
369 | 369 | } |
370 | 370 | |
371 | 371 | $output = $oAdminModel->checkUseDirectModuleInstall($package); |
372 | - if($output->toBool()==TRUE) |
|
372 | + if ($output->toBool() == TRUE) |
|
373 | 373 | { |
374 | 374 | Context::set('show_ftp_note', FALSE); |
375 | 375 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $oModuleModel = getModel('module'); |
392 | 392 | $config = $oModuleModel->getModuleConfig('autoinstall'); |
393 | 393 | $ftp_info = Context::getFTPInfo(); |
394 | - if(!$ftp_info->ftp_root_path) |
|
394 | + if (!$ftp_info->ftp_root_path) |
|
395 | 395 | { |
396 | 396 | Context::set('show_ftp_note', TRUE); |
397 | 397 | } |
@@ -406,19 +406,19 @@ discard block |
||
406 | 406 | $lUpdateDoc = $xml_lUpdate->parse($buff); |
407 | 407 | $updateDate = $lUpdateDoc->response->updatedate->body; |
408 | 408 | |
409 | - if(!$updateDate) |
|
409 | + if (!$updateDate) |
|
410 | 410 | { |
411 | 411 | return $this->stop('msg_connection_fail'); |
412 | 412 | } |
413 | 413 | |
414 | 414 | $oModel = getModel('autoinstall'); |
415 | 415 | $item = $oModel->getLatestPackage(); |
416 | - if(!$item || $item->updatedate < $updateDate || count($this->categories) < 1) |
|
416 | + if (!$item || $item->updatedate < $updateDate || count($this->categories) < 1) |
|
417 | 417 | { |
418 | 418 | $oController = getAdminController('autoinstall'); |
419 | 419 | $oController->_updateinfo(); |
420 | 420 | |
421 | - if(!$_SESSION['__XE_EASYINSTALL_REDIRECT__']) |
|
421 | + if (!$_SESSION['__XE_EASYINSTALL_REDIRECT__']) |
|
422 | 422 | { |
423 | 423 | header('location: ' . getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAutoinstallAdminIndex')); |
424 | 424 | $_SESSION['__XE_EASYINSTALL_REDIRECT__'] = TRUE; |
@@ -428,21 +428,21 @@ discard block |
||
428 | 428 | unset($_SESSION['__XE_EASYINSTALL_REDIRECT__']); |
429 | 429 | |
430 | 430 | $page = Context::get('page'); |
431 | - if(!$page) |
|
431 | + if (!$page) |
|
432 | 432 | { |
433 | 433 | $page = 1; |
434 | 434 | } |
435 | 435 | Context::set('page', $page); |
436 | 436 | |
437 | 437 | $order_type = Context::get('order_type'); |
438 | - if(!in_array($order_type, array('asc', 'desc'))) |
|
438 | + if (!in_array($order_type, array('asc', 'desc'))) |
|
439 | 439 | { |
440 | 440 | $order_type = 'desc'; |
441 | 441 | } |
442 | 442 | Context::set('order_type', $order_type); |
443 | 443 | |
444 | 444 | $order_target = Context::get('order_target'); |
445 | - if(!in_array($order_target, array('newest', 'download', 'popular'))) |
|
445 | + if (!in_array($order_target, array('newest', 'download', 'popular'))) |
|
446 | 446 | { |
447 | 447 | $order_target = 'newest'; |
448 | 448 | } |
@@ -452,11 +452,11 @@ discard block |
||
452 | 452 | |
453 | 453 | $childrenList = Context::get('childrenList'); |
454 | 454 | $category_srl = Context::get('category_srl'); |
455 | - if($childrenList) |
|
455 | + if ($childrenList) |
|
456 | 456 | { |
457 | 457 | $params["category_srl"] = $childrenList; |
458 | 458 | } |
459 | - else if($category_srl) |
|
459 | + else if ($category_srl) |
|
460 | 460 | { |
461 | 461 | $params["category_srl"] = $category_srl; |
462 | 462 | } |
@@ -465,12 +465,12 @@ discard block |
||
465 | 465 | $params["order_target"] = $order_target; |
466 | 466 | $params["order_type"] = $order_type; |
467 | 467 | $params["page"] = $page; |
468 | - if($search_keyword) |
|
468 | + if ($search_keyword) |
|
469 | 469 | { |
470 | 470 | $params["search_keyword"] = $search_keyword; |
471 | 471 | } |
472 | 472 | $xmlDoc = XmlGenerater::getXmlDoc($params); |
473 | - if($xmlDoc && $xmlDoc->response->packagelist->item) |
|
473 | + if ($xmlDoc && $xmlDoc->response->packagelist->item) |
|
474 | 474 | { |
475 | 475 | $item_list = $this->rearranges($xmlDoc->response->packagelist->item); |
476 | 476 | Context::set('item_list', $item_list); |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | function dispAutoinstallAdminUninstall() |
505 | 505 | { |
506 | 506 | $package_srl = Context::get('package_srl'); |
507 | - if(!$package_srl) |
|
507 | + if (!$package_srl) |
|
508 | 508 | { |
509 | 509 | return $this->dispAutoinstallAdminIndex(); |
510 | 510 | } |
@@ -512,12 +512,12 @@ discard block |
||
512 | 512 | $oModel = getModel('autoinstall'); |
513 | 513 | $oAdminModel = getAdminModel('autoinstall'); |
514 | 514 | $installedPackage = $oModel->getInstalledPackage($package_srl); |
515 | - if(!$installedPackage) |
|
515 | + if (!$installedPackage) |
|
516 | 516 | { |
517 | 517 | return $this->dispAutoinstallAdminInstalledPackages(); |
518 | 518 | } |
519 | 519 | |
520 | - if(!$_SESSION['ftp_password']) |
|
520 | + if (!$_SESSION['ftp_password']) |
|
521 | 521 | { |
522 | 522 | Context::set('need_password', TRUE); |
523 | 523 | } |
@@ -526,19 +526,19 @@ discard block |
||
526 | 526 | $path = $installedPackage->path; |
527 | 527 | $type = $oModel->getTypeFromPath($path); |
528 | 528 | |
529 | - if(!$type || $type == "core") |
|
529 | + if (!$type || $type == "core") |
|
530 | 530 | { |
531 | 531 | return $this->stop("msg_invalid_request"); |
532 | 532 | } |
533 | 533 | |
534 | 534 | $config_file = $oModel->getConfigFilePath($type); |
535 | - if(!$config_file) |
|
535 | + if (!$config_file) |
|
536 | 536 | { |
537 | 537 | return $this->stop("msg_invalid_request"); |
538 | 538 | } |
539 | 539 | |
540 | 540 | $output = $oAdminModel->checkUseDirectModuleInstall($installedPackage); |
541 | - if($output->toBool()==TRUE) |
|
541 | + if ($output->toBool() == TRUE) |
|
542 | 542 | { |
543 | 543 | Context::set('show_ftp_note', FALSE); |
544 | 544 | } |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml"); |
551 | 551 | $xml_lUpdate = new XmlParser(); |
552 | 552 | $xmlDoc = $xml_lUpdate->parse($buff); |
553 | - if($xmlDoc && $xmlDoc->response->packagelist->item) |
|
553 | + if ($xmlDoc && $xmlDoc->response->packagelist->item) |
|
554 | 554 | { |
555 | 555 | $item_list = $this->rearranges($xmlDoc->response->packagelist->item); |
556 | 556 | $installedPackage->title = $item_list[$package_srl]->title; |
@@ -36,8 +36,7 @@ discard block |
||
36 | 36 | if(!$ftp_info->ftp_root_path) |
37 | 37 | { |
38 | 38 | Context::set('show_ftp_note', TRUE); |
39 | - } |
|
40 | - else |
|
39 | + } else |
|
41 | 40 | { |
42 | 41 | $this->ftp_set = TRUE; |
43 | 42 | } |
@@ -217,12 +216,10 @@ discard block |
||
217 | 216 | if($v->type == "core") |
218 | 217 | { |
219 | 218 | $v->avail_remove = FALSE; |
220 | - } |
|
221 | - else if($v->type == "module") |
|
219 | + } else if($v->type == "module") |
|
222 | 220 | { |
223 | 221 | $v->avail_remove = $oModel->checkRemovable($packages[$v->package_srl]->path); |
224 | - } |
|
225 | - else |
|
222 | + } else |
|
226 | 223 | { |
227 | 224 | $v->avail_remove = TRUE; |
228 | 225 | } |
@@ -455,8 +452,7 @@ discard block |
||
455 | 452 | if($childrenList) |
456 | 453 | { |
457 | 454 | $params["category_srl"] = $childrenList; |
458 | - } |
|
459 | - else if($category_srl) |
|
455 | + } else if($category_srl) |
|
460 | 456 | { |
461 | 457 | $params["category_srl"] = $category_srl; |
462 | 458 | } |
@@ -565,8 +561,7 @@ discard block |
||
565 | 561 | $security->encodeHTML('package.'); |
566 | 562 | |
567 | 563 | $this->setTemplateFile('uninstall'); |
568 | - } |
|
569 | - else |
|
564 | + } else |
|
570 | 565 | { |
571 | 566 | return $this->stop('msg_connection_fail'); |
572 | 567 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Get the board module admin simple setting page |
24 | - * @return void |
|
24 | + * @return null|string |
|
25 | 25 | */ |
26 | 26 | public function getBoardAdminSimpleSetup($moduleSrl, $setupUrl) |
27 | 27 | { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function getBoardAdminSimpleSetup($moduleSrl, $setupUrl) |
27 | 27 | { |
28 | - if(!$moduleSrl) |
|
28 | + if (!$moduleSrl) |
|
29 | 29 | { |
30 | 30 | return; |
31 | 31 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $oModuleModel = getModel('module'); |
36 | 36 | $moduleInfo = $oModuleModel->getModuleInfoByModuleSrl($moduleSrl); |
37 | 37 | $moduleInfo->use_status = explode('|@|', $moduleInfo->use_status); |
38 | - if($moduleInfo) |
|
38 | + if ($moduleInfo) |
|
39 | 39 | { |
40 | 40 | Context::set('module_info', $moduleInfo); |
41 | 41 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | Context::set('document_status_list', $documentStatusList); |
47 | 47 | |
48 | 48 | // set order target list |
49 | - foreach($this->order_target AS $key) |
|
49 | + foreach ($this->order_target AS $key) |
|
50 | 50 | { |
51 | 51 | $order_target[$key] = Context::getLang($key); |
52 | 52 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | Context::set('admin_member', $admin_member); |
64 | 64 | |
65 | 65 | $oTemplate = &TemplateHandler::getInstance(); |
66 | - $html = $oTemplate->compile($this->module_path.'tpl/', 'board_setup_basic'); |
|
66 | + $html = $oTemplate->compile($this->module_path . 'tpl/', 'board_setup_basic'); |
|
67 | 67 | |
68 | 68 | return $html; |
69 | 69 | } |
@@ -87,6 +87,9 @@ discard block |
||
87 | 87 | $oModule->add('comment_list',$this->arrangeComment(Context::get('comment_list'))); |
88 | 88 | } |
89 | 89 | |
90 | + /** |
|
91 | + * @param string $content_list |
|
92 | + */ |
|
90 | 93 | function arrangeContentList($content_list) { |
91 | 94 | $output = array(); |
92 | 95 | if(count($content_list)) { |
@@ -120,6 +123,9 @@ discard block |
||
120 | 123 | return $output; |
121 | 124 | } |
122 | 125 | |
126 | + /** |
|
127 | + * @param string $comment_list |
|
128 | + */ |
|
123 | 129 | function arrangeComment($comment_list) { |
124 | 130 | $output = array(); |
125 | 131 | if(count($comment_list) > 0 ) { |
@@ -133,6 +139,9 @@ discard block |
||
133 | 139 | } |
134 | 140 | |
135 | 141 | |
142 | + /** |
|
143 | + * @param string $file_list |
|
144 | + */ |
|
136 | 145 | function arrangeFile($file_list) { |
137 | 146 | $output = array(); |
138 | 147 | if(count($file_list) > 0) { |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @brief notice list |
19 | 19 | **/ |
20 | 20 | function dispBoardNoticeList(&$oModule) { |
21 | - $oModule->add('notice_list',$this->arrangeContentList(Context::get('notice_list'))); |
|
21 | + $oModule->add('notice_list', $this->arrangeContentList(Context::get('notice_list'))); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | $api_type = Context::get('api_type'); |
30 | 30 | $document_list = $this->arrangeContentList(Context::get('document_list')); |
31 | 31 | |
32 | - if($api_type =='summary') |
|
32 | + if ($api_type == 'summary') |
|
33 | 33 | { |
34 | 34 | $content_cut_size = Context::get('content_cut_size'); |
35 | - $content_cut_size = $content_cut_size?$content_cut_size:50; |
|
36 | - foreach($document_list as $k=>$v) |
|
35 | + $content_cut_size = $content_cut_size ? $content_cut_size : 50; |
|
36 | + foreach ($document_list as $k=>$v) |
|
37 | 37 | { |
38 | 38 | $oDocument = new documentItem(); |
39 | 39 | $oDocument->setAttribute($v, false); |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | - $oModule->add('document_list',$document_list); |
|
46 | - $oModule->add('page_navigation',Context::get('page_navigation')); |
|
45 | + $oModule->add('document_list', $document_list); |
|
46 | + $oModule->add('page_navigation', Context::get('page_navigation')); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @brief category list |
52 | 52 | **/ |
53 | 53 | function dispBoardCategoryList(&$oModule) { |
54 | - $oModule->add('category_list',Context::get('category_list')); |
|
54 | + $oModule->add('category_list', Context::get('category_list')); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | function dispBoardContentView(&$oModule) { |
61 | 61 | $oDocument = Context::get('oDocument'); |
62 | 62 | $extra_vars = $oDocument->getExtraVars(); |
63 | - $oDocument->add('extra_vars',$this->arrangeExtraVars($extra_vars)); |
|
64 | - $oModule->add('oDocument',$this->arrangeContent($oDocument)); |
|
63 | + $oDocument->add('extra_vars', $this->arrangeExtraVars($extra_vars)); |
|
64 | + $oModule->add('oDocument', $this->arrangeContent($oDocument)); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @brief contents file list |
70 | 70 | **/ |
71 | 71 | function dispBoardContentFileList(&$oModule) { |
72 | - $oModule->add('file_list',$this->arrangeFile(Context::get('file_list'))); |
|
72 | + $oModule->add('file_list', $this->arrangeFile(Context::get('file_list'))); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -77,20 +77,20 @@ discard block |
||
77 | 77 | * @brief tag list |
78 | 78 | **/ |
79 | 79 | function dispBoardTagList(&$oModule) { |
80 | - $oModule->add('tag_list',Context::get('tag_list')); |
|
80 | + $oModule->add('tag_list', Context::get('tag_list')); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | 84 | * @brief comments list |
85 | 85 | **/ |
86 | 86 | function dispBoardContentCommentList(&$oModule) { |
87 | - $oModule->add('comment_list',$this->arrangeComment(Context::get('comment_list'))); |
|
87 | + $oModule->add('comment_list', $this->arrangeComment(Context::get('comment_list'))); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | function arrangeContentList($content_list) { |
91 | 91 | $output = array(); |
92 | - if(count($content_list)) { |
|
93 | - foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val); |
|
92 | + if (count($content_list)) { |
|
93 | + foreach ($content_list as $key => $val) $output[] = $this->arrangeContent($val); |
|
94 | 94 | } |
95 | 95 | return $output; |
96 | 96 | } |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | function arrangeContent($content) { |
100 | 100 | $oBoardView = getView('board'); |
101 | 101 | $output = new stdClass; |
102 | - if($content){ |
|
103 | - $output = $content->gets('document_srl','category_srl','member_srl','nick_name','user_id','user_name','title','content','tags','readed_count','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars','status'); |
|
102 | + if ($content) { |
|
103 | + $output = $content->gets('document_srl', 'category_srl', 'member_srl', 'nick_name', 'user_id', 'user_name', 'title', 'content', 'tags', 'readed_count', 'voted_count', 'blamed_count', 'comment_count', 'regdate', 'last_update', 'extra_vars', 'status'); |
|
104 | 104 | |
105 | - if(!$oBoardView->grant->view) |
|
105 | + if (!$oBoardView->grant->view) |
|
106 | 106 | { |
107 | 107 | unset($output->content); |
108 | 108 | unset($output->tags); |
@@ -122,10 +122,10 @@ discard block |
||
122 | 122 | |
123 | 123 | function arrangeComment($comment_list) { |
124 | 124 | $output = array(); |
125 | - if(count($comment_list) > 0 ) { |
|
126 | - foreach($comment_list as $key => $val){ |
|
125 | + if (count($comment_list) > 0) { |
|
126 | + foreach ($comment_list as $key => $val) { |
|
127 | 127 | $item = null; |
128 | - $item = $val->gets('comment_srl','parent_srl','depth','is_secret','content','voted_count','blamed_count','user_id','user_name','nick_name','email_address','homepage','regdate','last_update'); |
|
128 | + $item = $val->gets('comment_srl', 'parent_srl', 'depth', 'is_secret', 'content', 'voted_count', 'blamed_count', 'user_id', 'user_name', 'nick_name', 'email_address', 'homepage', 'regdate', 'last_update'); |
|
129 | 129 | $output[] = $item; |
130 | 130 | } |
131 | 131 | } |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | |
136 | 136 | function arrangeFile($file_list) { |
137 | 137 | $output = array(); |
138 | - if(count($file_list) > 0) { |
|
139 | - foreach($file_list as $key => $val){ |
|
138 | + if (count($file_list) > 0) { |
|
139 | + foreach ($file_list as $key => $val) { |
|
140 | 140 | $item = new stdClass; |
141 | 141 | $item->sid = $val->sid; |
142 | 142 | $item->download_count = $val->download_count; |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | |
154 | 154 | function arrangeExtraVars($list) { |
155 | 155 | $output = array(); |
156 | - if(count($list)) { |
|
157 | - foreach($list as $key => $val){ |
|
156 | + if (count($list)) { |
|
157 | + foreach ($list as $key => $val) { |
|
158 | 158 | $item = new stdClass; |
159 | 159 | $item->name = $val->name; |
160 | 160 | $item->type = $val->type; |
@@ -90,7 +90,9 @@ |
||
90 | 90 | function arrangeContentList($content_list) { |
91 | 91 | $output = array(); |
92 | 92 | if(count($content_list)) { |
93 | - foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val); |
|
93 | + foreach($content_list as $key => $val) { |
|
94 | + $output[] = $this->arrangeContent($val); |
|
95 | + } |
|
94 | 96 | } |
95 | 97 | return $output; |
96 | 98 | } |
@@ -747,6 +747,9 @@ |
||
747 | 747 | $this->setTemplateFile('write_form'); |
748 | 748 | } |
749 | 749 | |
750 | + /** |
|
751 | + * @param ModuleObject $oDocumentModel |
|
752 | + */ |
|
750 | 753 | function _getStatusNameList(&$oDocumentModel) |
751 | 754 | { |
752 | 755 | $resultList = array(); |
@@ -23,15 +23,15 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * setup the module general information |
25 | 25 | **/ |
26 | - if($this->module_info->list_count) |
|
26 | + if ($this->module_info->list_count) |
|
27 | 27 | { |
28 | 28 | $this->list_count = $this->module_info->list_count; |
29 | 29 | } |
30 | - if($this->module_info->search_list_count) |
|
30 | + if ($this->module_info->search_list_count) |
|
31 | 31 | { |
32 | 32 | $this->search_list_count = $this->module_info->search_list_count; |
33 | 33 | } |
34 | - if($this->module_info->page_count) |
|
34 | + if ($this->module_info->page_count) |
|
35 | 35 | { |
36 | 36 | $this->page_count = $this->module_info->page_count; |
37 | 37 | } |
@@ -41,20 +41,20 @@ discard block |
||
41 | 41 | $oDocumentModel = getModel('document'); |
42 | 42 | |
43 | 43 | $statusList = $this->_getStatusNameList($oDocumentModel); |
44 | - if(isset($statusList['SECRET'])) |
|
44 | + if (isset($statusList['SECRET'])) |
|
45 | 45 | { |
46 | 46 | $this->module_info->secret = 'Y'; |
47 | 47 | } |
48 | 48 | |
49 | 49 | // use_category <=1.5.x, hide_category >=1.7.x |
50 | 50 | $count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl)); |
51 | - if($count_category) |
|
51 | + if ($count_category) |
|
52 | 52 | { |
53 | - if($this->module_info->hide_category) |
|
53 | + if ($this->module_info->hide_category) |
|
54 | 54 | { |
55 | 55 | $this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y'; |
56 | 56 | } |
57 | - else if($this->module_info->use_category) |
|
57 | + else if ($this->module_info->use_category) |
|
58 | 58 | { |
59 | 59 | $this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y'; |
60 | 60 | } |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | * check the consultation function, if the user is admin then swich off consultation function |
75 | 75 | * if the user is not logged, then disppear write document/write comment./ view document |
76 | 76 | **/ |
77 | - if($this->module_info->consultation == 'Y' && !$this->grant->manager) |
|
77 | + if ($this->module_info->consultation == 'Y' && !$this->grant->manager) |
|
78 | 78 | { |
79 | 79 | $this->consultation = TRUE; |
80 | - if(!Context::get('is_logged')) |
|
80 | + if (!Context::get('is_logged')) |
|
81 | 81 | { |
82 | 82 | $this->grant->list = FALSE; |
83 | 83 | $this->grant->write_document = FALSE; |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | * setup the template path based on the skin |
95 | 95 | * the default skin is default |
96 | 96 | **/ |
97 | - $template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin); |
|
98 | - if(!is_dir($template_path)||!$this->module_info->skin) |
|
97 | + $template_path = sprintf("%sskins/%s/", $this->module_path, $this->module_info->skin); |
|
98 | + if (!is_dir($template_path) || !$this->module_info->skin) |
|
99 | 99 | { |
100 | 100 | $this->module_info->skin = 'default'; |
101 | - $template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin); |
|
101 | + $template_path = sprintf("%sskins/%s/", $this->module_path, $this->module_info->skin); |
|
102 | 102 | } |
103 | 103 | $this->setTemplatePath($template_path); |
104 | 104 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | **/ |
115 | 115 | if (is_array($extra_keys)) |
116 | 116 | { |
117 | - foreach($extra_keys as $val) |
|
117 | + foreach ($extra_keys as $val) |
|
118 | 118 | { |
119 | 119 | $this->order_target[] = $val->eid; |
120 | 120 | } |
@@ -122,14 +122,14 @@ discard block |
||
122 | 122 | /** |
123 | 123 | * load javascript, JS filters |
124 | 124 | **/ |
125 | - Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml'); |
|
126 | - Context::addJsFile($this->module_path.'tpl/js/board.js'); |
|
125 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'input_password.xml'); |
|
126 | + Context::addJsFile($this->module_path . 'tpl/js/board.js'); |
|
127 | 127 | |
128 | 128 | // remove [document_srl]_cpage from get_vars |
129 | 129 | $args = Context::getRequestVars(); |
130 | - foreach($args as $name => $value) |
|
130 | + foreach ($args as $name => $value) |
|
131 | 131 | { |
132 | - if(preg_match('/[0-9]+_cpage/', $name)) |
|
132 | + if (preg_match('/[0-9]+_cpage/', $name)) |
|
133 | 133 | { |
134 | 134 | Context::set($name, '', TRUE); |
135 | 135 | Context::set($name, $value); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | /** |
146 | 146 | * check the access grant (all the grant has been set by the module object) |
147 | 147 | **/ |
148 | - if(!$this->grant->access || !$this->grant->list) |
|
148 | + if (!$this->grant->access || !$this->grant->list) |
|
149 | 149 | { |
150 | 150 | return $this->dispBoardMessage('msg_not_permitted'); |
151 | 151 | } |
@@ -160,22 +160,22 @@ discard block |
||
160 | 160 | * add extra vaiables to the search options |
161 | 161 | **/ |
162 | 162 | // use search options on the template (the search options key has been declared, based on the language selected) |
163 | - foreach($this->search_option as $opt) $search_option[$opt] = Context::getLang($opt); |
|
163 | + foreach ($this->search_option as $opt) $search_option[$opt] = Context::getLang($opt); |
|
164 | 164 | $extra_keys = Context::get('extra_keys'); |
165 | - if($extra_keys) |
|
165 | + if ($extra_keys) |
|
166 | 166 | { |
167 | - foreach($extra_keys as $key => $val) |
|
167 | + foreach ($extra_keys as $key => $val) |
|
168 | 168 | { |
169 | - if($val->search == 'Y') $search_option['extra_vars'.$val->idx] = $val->name; |
|
169 | + if ($val->search == 'Y') $search_option['extra_vars' . $val->idx] = $val->name; |
|
170 | 170 | } |
171 | 171 | } |
172 | 172 | // remove a search option that is not public in member config |
173 | 173 | $memberConfig = getModel('module')->getModuleConfig('member'); |
174 | - foreach($memberConfig->signupForm as $signupFormElement) |
|
174 | + foreach ($memberConfig->signupForm as $signupFormElement) |
|
175 | 175 | { |
176 | - if(in_array($signupFormElement->title, $search_option)) |
|
176 | + if (in_array($signupFormElement->title, $search_option)) |
|
177 | 177 | { |
178 | - if($signupFormElement->isPublic == 'N') |
|
178 | + if ($signupFormElement->isPublic == 'N') |
|
179 | 179 | unset($search_option[$signupFormElement->name]); |
180 | 180 | } |
181 | 181 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | $oDocumentModel = getModel('document'); |
185 | 185 | $statusNameList = $this->_getStatusNameList($oDocumentModel); |
186 | - if(count($statusNameList) > 0) |
|
186 | + if (count($statusNameList) > 0) |
|
187 | 187 | { |
188 | 188 | Context::set('status_list', $statusNameList); |
189 | 189 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | // list config, columnList setting |
195 | 195 | $oBoardModel = getModel('board'); |
196 | 196 | $this->listConfig = $oBoardModel->getListConfig($this->module_info->module_srl); |
197 | - if(!$this->listConfig) $this->listConfig = array(); |
|
197 | + if (!$this->listConfig) $this->listConfig = array(); |
|
198 | 198 | $this->_makeListColumnList(); |
199 | 199 | |
200 | 200 | // display the notice list |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | /** |
207 | 207 | * add javascript filters |
208 | 208 | **/ |
209 | - Context::addJsFilter($this->module_path.'tpl/filter', 'search.xml'); |
|
209 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'search.xml'); |
|
210 | 210 | |
211 | 211 | $oSecurity = new Security(); |
212 | 212 | $oSecurity->encodeHTML('search_option.'); |
@@ -218,12 +218,12 @@ discard block |
||
218 | 218 | /** |
219 | 219 | * @brief display the category list |
220 | 220 | **/ |
221 | - function dispBoardCategoryList(){ |
|
221 | + function dispBoardCategoryList() { |
|
222 | 222 | // check if the use_category option is enabled |
223 | - if($this->module_info->use_category=='Y') |
|
223 | + if ($this->module_info->use_category == 'Y') |
|
224 | 224 | { |
225 | 225 | // check the grant |
226 | - if(!$this->grant->list) |
|
226 | + if (!$this->grant->list) |
|
227 | 227 | { |
228 | 228 | Context::set('category_list', array()); |
229 | 229 | return; |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | /** |
241 | 241 | * @brief display the board conent view |
242 | 242 | **/ |
243 | - function dispBoardContentView(){ |
|
243 | + function dispBoardContentView() { |
|
244 | 244 | // get the variable value |
245 | 245 | $document_srl = Context::get('document_srl'); |
246 | 246 | $page = Context::get('page'); |
@@ -251,36 +251,36 @@ discard block |
||
251 | 251 | /** |
252 | 252 | * if the document exists, then get the document information |
253 | 253 | **/ |
254 | - if($document_srl) |
|
254 | + if ($document_srl) |
|
255 | 255 | { |
256 | 256 | $oDocument = $oDocumentModel->getDocument($document_srl, false, true); |
257 | 257 | |
258 | 258 | // if the document is existed |
259 | - if($oDocument->isExists()) |
|
259 | + if ($oDocument->isExists()) |
|
260 | 260 | { |
261 | 261 | // if the module srl is not consistent |
262 | - if($oDocument->get('module_srl')!=$this->module_info->module_srl ) |
|
262 | + if ($oDocument->get('module_srl') != $this->module_info->module_srl) |
|
263 | 263 | { |
264 | 264 | return $this->stop('msg_invalid_request'); |
265 | 265 | } |
266 | 266 | |
267 | 267 | // check the manage grant |
268 | - if($this->grant->manager) $oDocument->setGrant(); |
|
268 | + if ($this->grant->manager) $oDocument->setGrant(); |
|
269 | 269 | |
270 | 270 | // if the consultation function is enabled, and the document is not a notice |
271 | - if($this->consultation && !$oDocument->isNotice()) |
|
271 | + if ($this->consultation && !$oDocument->isNotice()) |
|
272 | 272 | { |
273 | 273 | $logged_info = Context::get('logged_info'); |
274 | - if($oDocument->get('member_srl')!=$logged_info->member_srl) |
|
274 | + if ($oDocument->get('member_srl') != $logged_info->member_srl) |
|
275 | 275 | { |
276 | 276 | $oDocument = $oDocumentModel->getDocument(0); |
277 | 277 | } |
278 | 278 | } |
279 | 279 | |
280 | 280 | // if the document is TEMP saved, check Grant |
281 | - if($oDocument->getStatus() == 'TEMP') |
|
281 | + if ($oDocument->getStatus() == 'TEMP') |
|
282 | 282 | { |
283 | - if(!$oDocument->isGranted()) |
|
283 | + if (!$oDocument->isGranted()) |
|
284 | 284 | { |
285 | 285 | $oDocument = $oDocumentModel->getDocument(0); |
286 | 286 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | else |
291 | 291 | { |
292 | 292 | // if the document is not existed, then alert a warning message |
293 | - Context::set('document_srl','',true); |
|
293 | + Context::set('document_srl', '', true); |
|
294 | 294 | $this->alertMessage('msg_not_founded'); |
295 | 295 | } |
296 | 296 | |
@@ -306,12 +306,12 @@ discard block |
||
306 | 306 | /** |
307 | 307 | *check the document view grant |
308 | 308 | **/ |
309 | - if($oDocument->isExists()) |
|
309 | + if ($oDocument->isExists()) |
|
310 | 310 | { |
311 | - if(!$this->grant->view && !$oDocument->isGranted()) |
|
311 | + if (!$this->grant->view && !$oDocument->isGranted()) |
|
312 | 312 | { |
313 | 313 | $oDocument = $oDocumentModel->getDocument(0); |
314 | - Context::set('document_srl','',true); |
|
314 | + Context::set('document_srl', '', true); |
|
315 | 315 | $this->alertMessage('msg_not_permitted'); |
316 | 316 | } |
317 | 317 | else |
@@ -320,15 +320,15 @@ discard block |
||
320 | 320 | Context::addBrowserTitle($oDocument->getTitleText()); |
321 | 321 | |
322 | 322 | // update the document view count (if the document is not secret) |
323 | - if(!$oDocument->isSecret() || $oDocument->isGranted()) |
|
323 | + if (!$oDocument->isSecret() || $oDocument->isGranted()) |
|
324 | 324 | { |
325 | 325 | $oDocument->updateReadedCount(); |
326 | 326 | } |
327 | 327 | |
328 | 328 | // disappear the document if it is secret |
329 | - if($oDocument->isSecret() && !$oDocument->isGranted()) |
|
329 | + if ($oDocument->isSecret() && !$oDocument->isGranted()) |
|
330 | 330 | { |
331 | - $oDocument->add('content',Context::getLang('thisissecret')); |
|
331 | + $oDocument->add('content', Context::getLang('thisissecret')); |
|
332 | 332 | } |
333 | 333 | } |
334 | 334 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | /** |
341 | 341 | * add javascript filters |
342 | 342 | **/ |
343 | - Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml'); |
|
343 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'insert_comment.xml'); |
|
344 | 344 | |
345 | 345 | // return new Object(); |
346 | 346 | } |
@@ -348,11 +348,11 @@ discard block |
||
348 | 348 | /** |
349 | 349 | * @brief display the document file list (can be used by API) |
350 | 350 | **/ |
351 | - function dispBoardContentFileList(){ |
|
351 | + function dispBoardContentFileList() { |
|
352 | 352 | /** |
353 | 353 | * check the access grant (all the grant has been set by the module object) |
354 | 354 | **/ |
355 | - if(!$this->grant->access) |
|
355 | + if (!$this->grant->access) |
|
356 | 356 | { |
357 | 357 | return $this->dispBoardMessage('msg_not_permitted'); |
358 | 358 | } |
@@ -363,41 +363,41 @@ discard block |
||
363 | 363 | // Check if a permission for file download is granted |
364 | 364 | // Get configurations (using module model object) |
365 | 365 | $oModuleModel = getModel('module'); |
366 | - $file_module_config = $oModuleModel->getModulePartConfig('file',$this->module_srl); |
|
366 | + $file_module_config = $oModuleModel->getModulePartConfig('file', $this->module_srl); |
|
367 | 367 | |
368 | 368 | $downloadGrantCount = 0; |
369 | - if(is_array($file_module_config->download_grant)) |
|
369 | + if (is_array($file_module_config->download_grant)) |
|
370 | 370 | { |
371 | - foreach($file_module_config->download_grant AS $value) |
|
372 | - if($value) $downloadGrantCount++; |
|
371 | + foreach ($file_module_config->download_grant AS $value) |
|
372 | + if ($value) $downloadGrantCount++; |
|
373 | 373 | } |
374 | 374 | |
375 | - if(is_array($file_module_config->download_grant) && $downloadGrantCount>0) |
|
375 | + if (is_array($file_module_config->download_grant) && $downloadGrantCount > 0) |
|
376 | 376 | { |
377 | - if(!Context::get('is_logged')) return $this->stop('msg_not_permitted_download'); |
|
377 | + if (!Context::get('is_logged')) return $this->stop('msg_not_permitted_download'); |
|
378 | 378 | $logged_info = Context::get('logged_info'); |
379 | - if($logged_info->is_admin != 'Y') |
|
379 | + if ($logged_info->is_admin != 'Y') |
|
380 | 380 | { |
381 | - $oModuleModel =& getModel('module'); |
|
381 | + $oModuleModel = & getModel('module'); |
|
382 | 382 | $columnList = array('module_srl', 'site_srl'); |
383 | 383 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($this->module_srl, $columnList); |
384 | 384 | |
385 | - if(!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl)) |
|
385 | + if (!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl)) |
|
386 | 386 | { |
387 | - $oMemberModel =& getModel('member'); |
|
387 | + $oMemberModel = & getModel('member'); |
|
388 | 388 | $member_groups = $oMemberModel->getMemberGroups($logged_info->member_srl, $module_info->site_srl); |
389 | 389 | |
390 | 390 | $is_permitted = false; |
391 | - for($i=0;$i<count($file_module_config->download_grant);$i++) |
|
391 | + for ($i = 0; $i < count($file_module_config->download_grant); $i++) |
|
392 | 392 | { |
393 | 393 | $group_srl = $file_module_config->download_grant[$i]; |
394 | - if($member_groups[$group_srl]) |
|
394 | + if ($member_groups[$group_srl]) |
|
395 | 395 | { |
396 | 396 | $is_permitted = true; |
397 | 397 | break; |
398 | 398 | } |
399 | 399 | } |
400 | - if(!$is_permitted) return $this->stop('msg_not_permitted_download'); |
|
400 | + if (!$is_permitted) return $this->stop('msg_not_permitted_download'); |
|
401 | 401 | } |
402 | 402 | } |
403 | 403 | } |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $oDocumentModel = getModel('document'); |
406 | 406 | $document_srl = Context::get('document_srl'); |
407 | 407 | $oDocument = $oDocumentModel->getDocument($document_srl); |
408 | - Context::set('file_list',$oDocument->getUploadedFiles()); |
|
408 | + Context::set('file_list', $oDocument->getUploadedFiles()); |
|
409 | 409 | |
410 | 410 | $oSecurity = new Security(); |
411 | 411 | $oSecurity->encodeHTML('file_list..source_filename'); |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | /** |
415 | 415 | * @brief display the document comment list (can be used by API) |
416 | 416 | **/ |
417 | - function dispBoardContentCommentList(){ |
|
417 | + function dispBoardContentCommentList() { |
|
418 | 418 | // check document view grant |
419 | 419 | $this->dispBoardContentView(); |
420 | 420 | |
@@ -424,26 +424,26 @@ discard block |
||
424 | 424 | $comment_list = $oDocument->getComments(); |
425 | 425 | |
426 | 426 | // setup the comment list |
427 | - if(is_array($comment_list)) |
|
427 | + if (is_array($comment_list)) |
|
428 | 428 | { |
429 | - foreach($comment_list as $key => $val) |
|
429 | + foreach ($comment_list as $key => $val) |
|
430 | 430 | { |
431 | - if(!$val->isAccessible()) |
|
431 | + if (!$val->isAccessible()) |
|
432 | 432 | { |
433 | - $val->add('content',Context::getLang('thisissecret')); |
|
433 | + $val->add('content', Context::getLang('thisissecret')); |
|
434 | 434 | } |
435 | 435 | } |
436 | 436 | } |
437 | - Context::set('comment_list',$comment_list); |
|
437 | + Context::set('comment_list', $comment_list); |
|
438 | 438 | |
439 | 439 | } |
440 | 440 | |
441 | 441 | /** |
442 | 442 | * @brief display notice list (can be used by API) |
443 | 443 | **/ |
444 | - function dispBoardNoticeList(){ |
|
444 | + function dispBoardNoticeList() { |
|
445 | 445 | // check the grant |
446 | - if(!$this->grant->list) |
|
446 | + if (!$this->grant->list) |
|
447 | 447 | { |
448 | 448 | Context::set('notice_list', array()); |
449 | 449 | return; |
@@ -459,15 +459,15 @@ discard block |
||
459 | 459 | /** |
460 | 460 | * @brief display board content list |
461 | 461 | **/ |
462 | - function dispBoardContentList(){ |
|
462 | + function dispBoardContentList() { |
|
463 | 463 | // check the grant |
464 | - if(!$this->grant->list) |
|
464 | + if (!$this->grant->list) |
|
465 | 465 | { |
466 | 466 | Context::set('document_list', array()); |
467 | 467 | Context::set('total_count', 0); |
468 | 468 | Context::set('total_page', 1); |
469 | 469 | Context::set('page', 1); |
470 | - Context::set('page_navigation', new PageHandler(0,0,1,10)); |
|
470 | + Context::set('page_navigation', new PageHandler(0, 0, 1, 10)); |
|
471 | 471 | return; |
472 | 472 | } |
473 | 473 | |
@@ -485,17 +485,17 @@ discard block |
||
485 | 485 | $args->search_keyword = Context::get('search_keyword'); |
486 | 486 | |
487 | 487 | $search_option = Context::get('search_option'); |
488 | - if($search_option==FALSE) |
|
488 | + if ($search_option == FALSE) |
|
489 | 489 | { |
490 | 490 | $search_option = $this->search_option; |
491 | 491 | } |
492 | - if(isset($search_option[$args->search_target])==FALSE) |
|
492 | + if (isset($search_option[$args->search_target]) == FALSE) |
|
493 | 493 | { |
494 | 494 | $args->search_target = ''; |
495 | 495 | } |
496 | 496 | |
497 | 497 | // if the category is enabled, then get the category |
498 | - if($this->module_info->use_category=='Y') |
|
498 | + if ($this->module_info->use_category == 'Y') |
|
499 | 499 | { |
500 | 500 | $args->category_srl = Context::get('category'); |
501 | 501 | } |
@@ -503,21 +503,21 @@ discard block |
||
503 | 503 | // setup the sort index and order index |
504 | 504 | $args->sort_index = Context::get('sort_index'); |
505 | 505 | $args->order_type = Context::get('order_type'); |
506 | - if(!in_array($args->sort_index, $this->order_target)) |
|
506 | + if (!in_array($args->sort_index, $this->order_target)) |
|
507 | 507 | { |
508 | - $args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order'; |
|
508 | + $args->sort_index = $this->module_info->order_target ? $this->module_info->order_target : 'list_order'; |
|
509 | 509 | } |
510 | - if(!in_array($args->order_type, array('asc','desc'))) |
|
510 | + if (!in_array($args->order_type, array('asc', 'desc'))) |
|
511 | 511 | { |
512 | - $args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc'; |
|
512 | + $args->order_type = $this->module_info->order_type ? $this->module_info->order_type : 'asc'; |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | // set the current page of documents |
516 | 516 | $document_srl = Context::get('document_srl'); |
517 | - if(!$args->page && $document_srl) |
|
517 | + if (!$args->page && $document_srl) |
|
518 | 518 | { |
519 | 519 | $oDocument = $oDocumentModel->getDocument($document_srl); |
520 | - if($oDocument->isExists() && !$oDocument->isNotice()) |
|
520 | + if ($oDocument->isExists() && !$oDocument->isNotice()) |
|
521 | 521 | { |
522 | 522 | $page = $oDocumentModel->getDocumentPage($oDocument, $args); |
523 | 523 | Context::set('page', $page); |
@@ -526,13 +526,13 @@ discard block |
||
526 | 526 | } |
527 | 527 | |
528 | 528 | // setup the list count to be serach list count, if the category or search keyword has been set |
529 | - if($args->category_srl || $args->search_keyword) |
|
529 | + if ($args->category_srl || $args->search_keyword) |
|
530 | 530 | { |
531 | 531 | $args->list_count = $this->search_list_count; |
532 | 532 | } |
533 | 533 | |
534 | 534 | // if the consultation function is enabled, the get the logged user information |
535 | - if($this->consultation) |
|
535 | + if ($this->consultation) |
|
536 | 536 | { |
537 | 537 | $logged_info = Context::get('logged_info'); |
538 | 538 | $args->member_srl = $logged_info->member_srl; |
@@ -560,18 +560,18 @@ discard block |
||
560 | 560 | 'allow_trackback', 'notify_message', 'status', 'comment_status'); |
561 | 561 | $this->columnList = array_intersect($configColumList, $tableColumnList); |
562 | 562 | |
563 | - if(in_array('summary', $configColumList)) array_push($this->columnList, 'content'); |
|
563 | + if (in_array('summary', $configColumList)) array_push($this->columnList, 'content'); |
|
564 | 564 | |
565 | 565 | // default column list add |
566 | 566 | $defaultColumn = array('document_srl', 'module_srl', 'category_srl', 'lang_code', 'member_srl', 'last_update', 'comment_count', 'trackback_count', 'uploaded_count', 'status', 'regdate', 'title_bold', 'title_color'); |
567 | 567 | |
568 | 568 | //TODO guestbook, blog style supports legacy codes. |
569 | - if($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog') |
|
569 | + if ($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog') |
|
570 | 570 | { |
571 | 571 | $defaultColumn = $tableColumnList; |
572 | 572 | } |
573 | 573 | |
574 | - if (in_array('last_post', $configColumList)){ |
|
574 | + if (in_array('last_post', $configColumList)) { |
|
575 | 575 | array_push($this->columnList, 'last_updater'); |
576 | 576 | } |
577 | 577 | |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | $this->columnList = array_unique(array_merge($this->columnList, $defaultColumn)); |
584 | 584 | |
585 | 585 | // add table name |
586 | - foreach($this->columnList as $no => $value) |
|
586 | + foreach ($this->columnList as $no => $value) |
|
587 | 587 | { |
588 | 588 | $this->columnList[$no] = 'documents.' . $value; |
589 | 589 | } |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | function dispBoardTagList() |
596 | 596 | { |
597 | 597 | // check if there is not grant fot view list, then alert an warning message |
598 | - if(!$this->grant->list) |
|
598 | + if (!$this->grant->list) |
|
599 | 599 | { |
600 | 600 | return $this->dispBoardMessage('msg_not_permitted'); |
601 | 601 | } |
@@ -609,14 +609,14 @@ discard block |
||
609 | 609 | $output = $oTagModel->getTagList($obj); |
610 | 610 | |
611 | 611 | // automatically order |
612 | - if(count($output->data)) |
|
612 | + if (count($output->data)) |
|
613 | 613 | { |
614 | 614 | $numbers = array_keys($output->data); |
615 | 615 | shuffle($numbers); |
616 | 616 | |
617 | - if(count($output->data)) |
|
617 | + if (count($output->data)) |
|
618 | 618 | { |
619 | - foreach($numbers as $k => $v) |
|
619 | + foreach ($numbers as $k => $v) |
|
620 | 620 | { |
621 | 621 | $tag_list[] = $output->data[$v]; |
622 | 622 | } |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | function dispBoardWrite() |
638 | 638 | { |
639 | 639 | // check grant |
640 | - if(!$this->grant->write_document) |
|
640 | + if (!$this->grant->write_document) |
|
641 | 641 | { |
642 | 642 | return $this->dispBoardMessage('msg_not_permitted'); |
643 | 643 | } |
@@ -647,10 +647,10 @@ discard block |
||
647 | 647 | /** |
648 | 648 | * check if the category option is enabled not not |
649 | 649 | **/ |
650 | - if($this->module_info->use_category=='Y') |
|
650 | + if ($this->module_info->use_category == 'Y') |
|
651 | 651 | { |
652 | 652 | // get the user group information |
653 | - if(Context::get('is_logged')) |
|
653 | + if (Context::get('is_logged')) |
|
654 | 654 | { |
655 | 655 | $logged_info = Context::get('logged_info'); |
656 | 656 | $group_srls = array_keys($logged_info->group_list); |
@@ -663,19 +663,19 @@ discard block |
||
663 | 663 | |
664 | 664 | // check the grant after obtained the category list |
665 | 665 | $normal_category_list = $oDocumentModel->getCategoryList($this->module_srl); |
666 | - if(count($normal_category_list)) |
|
666 | + if (count($normal_category_list)) |
|
667 | 667 | { |
668 | - foreach($normal_category_list as $category_srl => $category) |
|
668 | + foreach ($normal_category_list as $category_srl => $category) |
|
669 | 669 | { |
670 | 670 | $is_granted = TRUE; |
671 | - if($category->group_srls) |
|
671 | + if ($category->group_srls) |
|
672 | 672 | { |
673 | - $category_group_srls = explode(',',$category->group_srls); |
|
673 | + $category_group_srls = explode(',', $category->group_srls); |
|
674 | 674 | $is_granted = FALSE; |
675 | - if(count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE; |
|
675 | + if (count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE; |
|
676 | 676 | |
677 | 677 | } |
678 | - if($is_granted) $category_list[$category_srl] = $category; |
|
678 | + if ($is_granted) $category_list[$category_srl] = $category; |
|
679 | 679 | } |
680 | 680 | } |
681 | 681 | Context::set('category_list', $category_list); |
@@ -686,46 +686,46 @@ discard block |
||
686 | 686 | $oDocument = $oDocumentModel->getDocument(0, $this->grant->manager); |
687 | 687 | $oDocument->setDocument($document_srl); |
688 | 688 | |
689 | - if($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE; |
|
689 | + if ($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE; |
|
690 | 690 | $oDocument->add('module_srl', $this->module_srl); |
691 | 691 | |
692 | - if($oDocument->isExists() && $this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
692 | + if ($oDocument->isExists() && $this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
693 | 693 | { |
694 | 694 | return new Object(-1, 'msg_protect_content'); |
695 | 695 | } |
696 | 696 | |
697 | 697 | // if the document is not granted, then back to the password input form |
698 | 698 | $oModuleModel = getModel('module'); |
699 | - if($oDocument->isExists()&&!$oDocument->isGranted()) |
|
699 | + if ($oDocument->isExists() && !$oDocument->isGranted()) |
|
700 | 700 | { |
701 | 701 | return $this->setTemplateFile('input_password_form'); |
702 | 702 | } |
703 | 703 | |
704 | - if(!$oDocument->isExists()) |
|
704 | + if (!$oDocument->isExists()) |
|
705 | 705 | { |
706 | - $point_config = $oModuleModel->getModulePartConfig('point',$this->module_srl); |
|
706 | + $point_config = $oModuleModel->getModulePartConfig('point', $this->module_srl); |
|
707 | 707 | $logged_info = Context::get('logged_info'); |
708 | 708 | $oPointModel = getModel('point'); |
709 | 709 | $pointForInsert = $point_config["insert_document"]; |
710 | - if($pointForInsert < 0) |
|
710 | + if ($pointForInsert < 0) |
|
711 | 711 | { |
712 | - if( !$logged_info ) |
|
712 | + if (!$logged_info) |
|
713 | 713 | { |
714 | 714 | return $this->dispBoardMessage('msg_not_permitted'); |
715 | 715 | } |
716 | - else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert )< 0 ) |
|
716 | + else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert) < 0) |
|
717 | 717 | { |
718 | 718 | return $this->dispBoardMessage('msg_not_enough_point'); |
719 | 719 | } |
720 | 720 | } |
721 | 721 | } |
722 | - if(!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus()); |
|
722 | + if (!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus()); |
|
723 | 723 | |
724 | 724 | $statusList = $this->_getStatusNameList($oDocumentModel); |
725 | - if(count($statusList) > 0) Context::set('status_list', $statusList); |
|
725 | + if (count($statusList) > 0) Context::set('status_list', $statusList); |
|
726 | 726 | |
727 | 727 | // get Document status config value |
728 | - Context::set('document_srl',$document_srl); |
|
728 | + Context::set('document_srl', $document_srl); |
|
729 | 729 | Context::set('oDocument', $oDocument); |
730 | 730 | |
731 | 731 | // apply xml_js_filter on header |
@@ -733,13 +733,13 @@ discard block |
||
733 | 733 | $oDocumentController->addXmlJsFilter($this->module_info->module_srl); |
734 | 734 | |
735 | 735 | // if the document exists, then setup extra variabels on context |
736 | - if($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars()); |
|
736 | + if ($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars()); |
|
737 | 737 | |
738 | 738 | /** |
739 | 739 | * add JS filters |
740 | 740 | **/ |
741 | - if(Context::get('logged_info')->is_admin=='Y') Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml'); |
|
742 | - else Context::addJsFilter($this->module_path.'tpl/filter', 'insert.xml'); |
|
741 | + if (Context::get('logged_info')->is_admin == 'Y') Context::addJsFilter($this->module_path . 'tpl/filter', 'insert_admin.xml'); |
|
742 | + else Context::addJsFilter($this->module_path . 'tpl/filter', 'insert.xml'); |
|
743 | 743 | |
744 | 744 | $oSecurity = new Security(); |
745 | 745 | $oSecurity->encodeHTML('category_list.text', 'category_list.title'); |
@@ -750,14 +750,14 @@ discard block |
||
750 | 750 | function _getStatusNameList(&$oDocumentModel) |
751 | 751 | { |
752 | 752 | $resultList = array(); |
753 | - if(!empty($this->module_info->use_status)) |
|
753 | + if (!empty($this->module_info->use_status)) |
|
754 | 754 | { |
755 | 755 | $statusNameList = $oDocumentModel->getStatusNameList(); |
756 | 756 | $statusList = explode('|@|', $this->module_info->use_status); |
757 | 757 | |
758 | - if(is_array($statusList)) |
|
758 | + if (is_array($statusList)) |
|
759 | 759 | { |
760 | - foreach($statusList as $key => $value) |
|
760 | + foreach ($statusList as $key => $value) |
|
761 | 761 | { |
762 | 762 | $resultList[$value] = $statusNameList[$value]; |
763 | 763 | } |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | function dispBoardDelete() |
773 | 773 | { |
774 | 774 | // check grant |
775 | - if(!$this->grant->write_document) |
|
775 | + if (!$this->grant->write_document) |
|
776 | 776 | { |
777 | 777 | return $this->dispBoardMessage('msg_not_permitted'); |
778 | 778 | } |
@@ -781,35 +781,35 @@ discard block |
||
781 | 781 | $document_srl = Context::get('document_srl'); |
782 | 782 | |
783 | 783 | // if document exists, get the document information |
784 | - if($document_srl) |
|
784 | + if ($document_srl) |
|
785 | 785 | { |
786 | 786 | $oDocumentModel = getModel('document'); |
787 | 787 | $oDocument = $oDocumentModel->getDocument($document_srl); |
788 | 788 | } |
789 | 789 | |
790 | 790 | // if the document is not existed, then back to the board content page |
791 | - if(!$oDocument->isExists()) |
|
791 | + if (!$oDocument->isExists()) |
|
792 | 792 | { |
793 | 793 | return $this->dispBoardContent(); |
794 | 794 | } |
795 | 795 | |
796 | 796 | // if the document is not granted, then back to the password input form |
797 | - if(!$oDocument->isGranted()) |
|
797 | + if (!$oDocument->isGranted()) |
|
798 | 798 | { |
799 | 799 | return $this->setTemplateFile('input_password_form'); |
800 | 800 | } |
801 | 801 | |
802 | - if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
802 | + if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
803 | 803 | { |
804 | 804 | return $this->dispBoardMessage('msg_protect_content'); |
805 | 805 | } |
806 | 806 | |
807 | - Context::set('oDocument',$oDocument); |
|
807 | + Context::set('oDocument', $oDocument); |
|
808 | 808 | |
809 | 809 | /** |
810 | 810 | * add JS filters |
811 | 811 | **/ |
812 | - Context::addJsFilter($this->module_path.'tpl/filter', 'delete_document.xml'); |
|
812 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'delete_document.xml'); |
|
813 | 813 | |
814 | 814 | $this->setTemplateFile('delete_form'); |
815 | 815 | } |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | $document_srl = Context::get('document_srl'); |
823 | 823 | |
824 | 824 | // check grant |
825 | - if(!$this->grant->write_comment) |
|
825 | + if (!$this->grant->write_comment) |
|
826 | 826 | { |
827 | 827 | return $this->dispBoardMessage('msg_not_permitted'); |
828 | 828 | } |
@@ -830,13 +830,13 @@ discard block |
||
830 | 830 | // get the document information |
831 | 831 | $oDocumentModel = getModel('document'); |
832 | 832 | $oDocument = $oDocumentModel->getDocument($document_srl); |
833 | - if(!$oDocument->isExists()) |
|
833 | + if (!$oDocument->isExists()) |
|
834 | 834 | { |
835 | 835 | return $this->dispBoardMessage('msg_invalid_request'); |
836 | 836 | } |
837 | 837 | |
838 | 838 | // Check allow comment |
839 | - if(!$oDocument->allowComment()) |
|
839 | + if (!$oDocument->allowComment()) |
|
840 | 840 | { |
841 | 841 | return $this->dispBoardMessage('msg_not_allow_comment'); |
842 | 842 | } |
@@ -848,14 +848,14 @@ discard block |
||
848 | 848 | $oComment->add('module_srl', $this->module_srl); |
849 | 849 | |
850 | 850 | // setup document variables on context |
851 | - Context::set('oDocument',$oDocument); |
|
852 | - Context::set('oSourceComment',$oSourceComment); |
|
853 | - Context::set('oComment',$oComment); |
|
851 | + Context::set('oDocument', $oDocument); |
|
852 | + Context::set('oSourceComment', $oSourceComment); |
|
853 | + Context::set('oComment', $oComment); |
|
854 | 854 | |
855 | 855 | /** |
856 | 856 | * add JS filter |
857 | 857 | **/ |
858 | - Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml'); |
|
858 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'insert_comment.xml'); |
|
859 | 859 | |
860 | 860 | $this->setTemplateFile('comment_form'); |
861 | 861 | } |
@@ -866,7 +866,7 @@ discard block |
||
866 | 866 | function dispBoardReplyComment() |
867 | 867 | { |
868 | 868 | // check grant |
869 | - if(!$this->grant->write_comment) |
|
869 | + if (!$this->grant->write_comment) |
|
870 | 870 | { |
871 | 871 | return $this->dispBoardMessage('msg_not_permitted'); |
872 | 872 | } |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | $parent_srl = Context::get('comment_srl'); |
876 | 876 | |
877 | 877 | // if the parent comment is not existed |
878 | - if(!$parent_srl) |
|
878 | + if (!$parent_srl) |
|
879 | 879 | { |
880 | 880 | return new Object(-1, 'msg_invalid_request'); |
881 | 881 | } |
@@ -885,11 +885,11 @@ discard block |
||
885 | 885 | $oSourceComment = $oCommentModel->getComment($parent_srl, $this->grant->manager); |
886 | 886 | |
887 | 887 | // if the comment is not existed, opoup an error message |
888 | - if(!$oSourceComment->isExists()) |
|
888 | + if (!$oSourceComment->isExists()) |
|
889 | 889 | { |
890 | 890 | return $this->dispBoardMessage('msg_invalid_request'); |
891 | 891 | } |
892 | - if(Context::get('document_srl') && $oSourceComment->get('document_srl') != Context::get('document_srl')) |
|
892 | + if (Context::get('document_srl') && $oSourceComment->get('document_srl') != Context::get('document_srl')) |
|
893 | 893 | { |
894 | 894 | return $this->dispBoardMessage('msg_invalid_request'); |
895 | 895 | } |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | // Check allow comment |
898 | 898 | $oDocumentModel = getModel('document'); |
899 | 899 | $oDocument = $oDocumentModel->getDocument($oSourceComment->get('document_srl')); |
900 | - if(!$oDocument->allowComment()) |
|
900 | + if (!$oDocument->allowComment()) |
|
901 | 901 | { |
902 | 902 | return $this->dispBoardMessage('msg_not_allow_comment'); |
903 | 903 | } |
@@ -908,14 +908,14 @@ discard block |
||
908 | 908 | $oComment->add('document_srl', $oSourceComment->get('document_srl')); |
909 | 909 | |
910 | 910 | // setup comment variables |
911 | - Context::set('oSourceComment',$oSourceComment); |
|
912 | - Context::set('oComment',$oComment); |
|
913 | - Context::set('module_srl',$this->module_info->module_srl); |
|
911 | + Context::set('oSourceComment', $oSourceComment); |
|
912 | + Context::set('oComment', $oComment); |
|
913 | + Context::set('module_srl', $this->module_info->module_srl); |
|
914 | 914 | |
915 | 915 | /** |
916 | 916 | * add JS filters |
917 | 917 | **/ |
918 | - Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml'); |
|
918 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'insert_comment.xml'); |
|
919 | 919 | |
920 | 920 | $this->setTemplateFile('comment_form'); |
921 | 921 | } |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | function dispBoardModifyComment() |
927 | 927 | { |
928 | 928 | // check grant |
929 | - if(!$this->grant->write_comment) |
|
929 | + if (!$this->grant->write_comment) |
|
930 | 930 | { |
931 | 931 | return $this->dispBoardMessage('msg_not_permitted'); |
932 | 932 | } |
@@ -936,7 +936,7 @@ discard block |
||
936 | 936 | $comment_srl = Context::get('comment_srl'); |
937 | 937 | |
938 | 938 | // if the comment is not existed |
939 | - if(!$comment_srl) |
|
939 | + if (!$comment_srl) |
|
940 | 940 | { |
941 | 941 | return new Object(-1, 'msg_invalid_request'); |
942 | 942 | } |
@@ -946,13 +946,13 @@ discard block |
||
946 | 946 | $oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager); |
947 | 947 | |
948 | 948 | // if the comment is not exited, alert an error message |
949 | - if(!$oComment->isExists()) |
|
949 | + if (!$oComment->isExists()) |
|
950 | 950 | { |
951 | 951 | return $this->dispBoardMessage('msg_invalid_request'); |
952 | 952 | } |
953 | 953 | |
954 | 954 | // if the comment is not granted, then back to the password input form |
955 | - if(!$oComment->isGranted()) |
|
955 | + if (!$oComment->isGranted()) |
|
956 | 956 | { |
957 | 957 | return $this->setTemplateFile('input_password_form'); |
958 | 958 | } |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | /** |
965 | 965 | * add JS fitlers |
966 | 966 | **/ |
967 | - Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml'); |
|
967 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'insert_comment.xml'); |
|
968 | 968 | |
969 | 969 | $this->setTemplateFile('comment_form'); |
970 | 970 | } |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | function dispBoardDeleteComment() |
976 | 976 | { |
977 | 977 | // check grant |
978 | - if(!$this->grant->write_comment) |
|
978 | + if (!$this->grant->write_comment) |
|
979 | 979 | { |
980 | 980 | return $this->dispBoardMessage('msg_not_permitted'); |
981 | 981 | } |
@@ -984,30 +984,30 @@ discard block |
||
984 | 984 | $comment_srl = Context::get('comment_srl'); |
985 | 985 | |
986 | 986 | // if the comment exists, then get the comment information |
987 | - if($comment_srl) |
|
987 | + if ($comment_srl) |
|
988 | 988 | { |
989 | 989 | $oCommentModel = getModel('comment'); |
990 | 990 | $oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager); |
991 | 991 | } |
992 | 992 | |
993 | 993 | // if the comment is not existed, then back to the board content page |
994 | - if(!$oComment->isExists() ) |
|
994 | + if (!$oComment->isExists()) |
|
995 | 995 | { |
996 | 996 | return $this->dispBoardContent(); |
997 | 997 | } |
998 | 998 | |
999 | 999 | // if the comment is not granted, then back to the password input form |
1000 | - if(!$oComment->isGranted()) |
|
1000 | + if (!$oComment->isGranted()) |
|
1001 | 1001 | { |
1002 | 1002 | return $this->setTemplateFile('input_password_form'); |
1003 | 1003 | } |
1004 | 1004 | |
1005 | - Context::set('oComment',$oComment); |
|
1005 | + Context::set('oComment', $oComment); |
|
1006 | 1006 | |
1007 | 1007 | /** |
1008 | 1008 | * add JS filters |
1009 | 1009 | **/ |
1010 | - Context::addJsFilter($this->module_path.'tpl/filter', 'delete_comment.xml'); |
|
1010 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'delete_comment.xml'); |
|
1011 | 1011 | |
1012 | 1012 | $this->setTemplateFile('delete_comment_form'); |
1013 | 1013 | } |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | { |
1020 | 1020 | $oTrackbackModel = getModel('trackback'); |
1021 | 1021 | |
1022 | - if(!$oTrackbackModel) |
|
1022 | + if (!$oTrackbackModel) |
|
1023 | 1023 | { |
1024 | 1024 | return; |
1025 | 1025 | } |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | $trackback = $output->data; |
1034 | 1034 | |
1035 | 1035 | // if no trackback, then display the board content |
1036 | - if(!$trackback) |
|
1036 | + if (!$trackback) |
|
1037 | 1037 | { |
1038 | 1038 | return $this->dispBoardContent(); |
1039 | 1039 | } |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | /** |
1044 | 1044 | * add JS filters |
1045 | 1045 | **/ |
1046 | - Context::addJsFilter($this->module_path.'tpl/filter', 'delete_trackback.xml'); |
|
1046 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'delete_trackback.xml'); |
|
1047 | 1047 | |
1048 | 1048 | $this->setTemplateFile('delete_trackback_form'); |
1049 | 1049 | } |
@@ -1054,7 +1054,7 @@ discard block |
||
1054 | 1054 | function dispBoardMessage($msg_code) |
1055 | 1055 | { |
1056 | 1056 | $msg = Context::getLang($msg_code); |
1057 | - if(!$msg) $msg = $msg_code; |
|
1057 | + if (!$msg) $msg = $msg_code; |
|
1058 | 1058 | Context::set('message', $msg); |
1059 | 1059 | $this->setTemplateFile('message'); |
1060 | 1060 | } |
@@ -1065,8 +1065,8 @@ discard block |
||
1065 | 1065 | **/ |
1066 | 1066 | function alertMessage($message) |
1067 | 1067 | { |
1068 | - $script = sprintf('<script> jQuery(function(){ alert("%s"); } );</script>', Context::getLang($message)); |
|
1069 | - Context::addHtmlFooter( $script ); |
|
1068 | + $script = sprintf('<script> jQuery(function(){ alert("%s"); } );</script>', Context::getLang($message)); |
|
1069 | + Context::addHtmlFooter($script); |
|
1070 | 1070 | } |
1071 | 1071 | |
1072 | 1072 | } |
@@ -53,18 +53,15 @@ discard block |
||
53 | 53 | if($this->module_info->hide_category) |
54 | 54 | { |
55 | 55 | $this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y'; |
56 | - } |
|
57 | - else if($this->module_info->use_category) |
|
56 | + } else if($this->module_info->use_category) |
|
58 | 57 | { |
59 | 58 | $this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y'; |
60 | - } |
|
61 | - else |
|
59 | + } else |
|
62 | 60 | { |
63 | 61 | $this->module_info->hide_category = 'N'; |
64 | 62 | $this->module_info->use_category = 'Y'; |
65 | 63 | } |
66 | - } |
|
67 | - else |
|
64 | + } else |
|
68 | 65 | { |
69 | 66 | $this->module_info->hide_category = 'Y'; |
70 | 67 | $this->module_info->use_category = 'N'; |
@@ -84,8 +81,7 @@ discard block |
||
84 | 81 | $this->grant->write_comment = FALSE; |
85 | 82 | $this->grant->view = FALSE; |
86 | 83 | } |
87 | - } |
|
88 | - else |
|
84 | + } else |
|
89 | 85 | { |
90 | 86 | $this->consultation = FALSE; |
91 | 87 | } |
@@ -160,13 +156,17 @@ discard block |
||
160 | 156 | * add extra vaiables to the search options |
161 | 157 | **/ |
162 | 158 | // use search options on the template (the search options key has been declared, based on the language selected) |
163 | - foreach($this->search_option as $opt) $search_option[$opt] = Context::getLang($opt); |
|
159 | + foreach($this->search_option as $opt) { |
|
160 | + $search_option[$opt] = Context::getLang($opt); |
|
161 | + } |
|
164 | 162 | $extra_keys = Context::get('extra_keys'); |
165 | 163 | if($extra_keys) |
166 | 164 | { |
167 | 165 | foreach($extra_keys as $key => $val) |
168 | 166 | { |
169 | - if($val->search == 'Y') $search_option['extra_vars'.$val->idx] = $val->name; |
|
167 | + if($val->search == 'Y') { |
|
168 | + $search_option['extra_vars'.$val->idx] = $val->name; |
|
169 | + } |
|
170 | 170 | } |
171 | 171 | } |
172 | 172 | // remove a search option that is not public in member config |
@@ -175,8 +175,9 @@ discard block |
||
175 | 175 | { |
176 | 176 | if(in_array($signupFormElement->title, $search_option)) |
177 | 177 | { |
178 | - if($signupFormElement->isPublic == 'N') |
|
179 | - unset($search_option[$signupFormElement->name]); |
|
178 | + if($signupFormElement->isPublic == 'N') { |
|
179 | + unset($search_option[$signupFormElement->name]); |
|
180 | + } |
|
180 | 181 | } |
181 | 182 | } |
182 | 183 | Context::set('search_option', $search_option); |
@@ -194,7 +195,9 @@ discard block |
||
194 | 195 | // list config, columnList setting |
195 | 196 | $oBoardModel = getModel('board'); |
196 | 197 | $this->listConfig = $oBoardModel->getListConfig($this->module_info->module_srl); |
197 | - if(!$this->listConfig) $this->listConfig = array(); |
|
198 | + if(!$this->listConfig) { |
|
199 | + $this->listConfig = array(); |
|
200 | + } |
|
198 | 201 | $this->_makeListColumnList(); |
199 | 202 | |
200 | 203 | // display the notice list |
@@ -265,7 +268,9 @@ discard block |
||
265 | 268 | } |
266 | 269 | |
267 | 270 | // check the manage grant |
268 | - if($this->grant->manager) $oDocument->setGrant(); |
|
271 | + if($this->grant->manager) { |
|
272 | + $oDocument->setGrant(); |
|
273 | + } |
|
269 | 274 | |
270 | 275 | // if the consultation function is enabled, and the document is not a notice |
271 | 276 | if($this->consultation && !$oDocument->isNotice()) |
@@ -286,8 +291,7 @@ discard block |
||
286 | 291 | } |
287 | 292 | } |
288 | 293 | |
289 | - } |
|
290 | - else |
|
294 | + } else |
|
291 | 295 | { |
292 | 296 | // if the document is not existed, then alert a warning message |
293 | 297 | Context::set('document_srl','',true); |
@@ -297,8 +301,7 @@ discard block |
||
297 | 301 | /** |
298 | 302 | * if the document is not existed, get an empty document |
299 | 303 | **/ |
300 | - } |
|
301 | - else |
|
304 | + } else |
|
302 | 305 | { |
303 | 306 | $oDocument = $oDocumentModel->getDocument(0); |
304 | 307 | } |
@@ -313,8 +316,7 @@ discard block |
||
313 | 316 | $oDocument = $oDocumentModel->getDocument(0); |
314 | 317 | Context::set('document_srl','',true); |
315 | 318 | $this->alertMessage('msg_not_permitted'); |
316 | - } |
|
317 | - else |
|
319 | + } else |
|
318 | 320 | { |
319 | 321 | // add the document title to the browser |
320 | 322 | Context::addBrowserTitle($oDocument->getTitleText()); |
@@ -368,13 +370,16 @@ discard block |
||
368 | 370 | $downloadGrantCount = 0; |
369 | 371 | if(is_array($file_module_config->download_grant)) |
370 | 372 | { |
371 | - foreach($file_module_config->download_grant AS $value) |
|
372 | - if($value) $downloadGrantCount++; |
|
373 | + foreach($file_module_config->download_grant AS $value) { |
|
374 | + if($value) $downloadGrantCount++; |
|
375 | + } |
|
373 | 376 | } |
374 | 377 | |
375 | 378 | if(is_array($file_module_config->download_grant) && $downloadGrantCount>0) |
376 | 379 | { |
377 | - if(!Context::get('is_logged')) return $this->stop('msg_not_permitted_download'); |
|
380 | + if(!Context::get('is_logged')) { |
|
381 | + return $this->stop('msg_not_permitted_download'); |
|
382 | + } |
|
378 | 383 | $logged_info = Context::get('logged_info'); |
379 | 384 | if($logged_info->is_admin != 'Y') |
380 | 385 | { |
@@ -397,7 +402,9 @@ discard block |
||
397 | 402 | break; |
398 | 403 | } |
399 | 404 | } |
400 | - if(!$is_permitted) return $this->stop('msg_not_permitted_download'); |
|
405 | + if(!$is_permitted) { |
|
406 | + return $this->stop('msg_not_permitted_download'); |
|
407 | + } |
|
401 | 408 | } |
402 | 409 | } |
403 | 410 | } |
@@ -560,7 +567,9 @@ discard block |
||
560 | 567 | 'allow_trackback', 'notify_message', 'status', 'comment_status'); |
561 | 568 | $this->columnList = array_intersect($configColumList, $tableColumnList); |
562 | 569 | |
563 | - if(in_array('summary', $configColumList)) array_push($this->columnList, 'content'); |
|
570 | + if(in_array('summary', $configColumList)) { |
|
571 | + array_push($this->columnList, 'content'); |
|
572 | + } |
|
564 | 573 | |
565 | 574 | // default column list add |
566 | 575 | $defaultColumn = array('document_srl', 'module_srl', 'category_srl', 'lang_code', 'member_srl', 'last_update', 'comment_count', 'trackback_count', 'uploaded_count', 'status', 'regdate', 'title_bold', 'title_color'); |
@@ -654,8 +663,7 @@ discard block |
||
654 | 663 | { |
655 | 664 | $logged_info = Context::get('logged_info'); |
656 | 665 | $group_srls = array_keys($logged_info->group_list); |
657 | - } |
|
658 | - else |
|
666 | + } else |
|
659 | 667 | { |
660 | 668 | $group_srls = array(); |
661 | 669 | } |
@@ -672,10 +680,14 @@ discard block |
||
672 | 680 | { |
673 | 681 | $category_group_srls = explode(',',$category->group_srls); |
674 | 682 | $is_granted = FALSE; |
675 | - if(count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE; |
|
683 | + if(count(array_intersect($group_srls, $category_group_srls))) { |
|
684 | + $is_granted = TRUE; |
|
685 | + } |
|
676 | 686 | |
677 | 687 | } |
678 | - if($is_granted) $category_list[$category_srl] = $category; |
|
688 | + if($is_granted) { |
|
689 | + $category_list[$category_srl] = $category; |
|
690 | + } |
|
679 | 691 | } |
680 | 692 | } |
681 | 693 | Context::set('category_list', $category_list); |
@@ -686,7 +698,9 @@ discard block |
||
686 | 698 | $oDocument = $oDocumentModel->getDocument(0, $this->grant->manager); |
687 | 699 | $oDocument->setDocument($document_srl); |
688 | 700 | |
689 | - if($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE; |
|
701 | + if($oDocument->get('module_srl') == $oDocument->get('member_srl')) { |
|
702 | + $savedDoc = TRUE; |
|
703 | + } |
|
690 | 704 | $oDocument->add('module_srl', $this->module_srl); |
691 | 705 | |
692 | 706 | if($oDocument->isExists() && $this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
@@ -712,17 +726,20 @@ discard block |
||
712 | 726 | if( !$logged_info ) |
713 | 727 | { |
714 | 728 | return $this->dispBoardMessage('msg_not_permitted'); |
715 | - } |
|
716 | - else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert )< 0 ) |
|
729 | + } else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert )< 0 ) |
|
717 | 730 | { |
718 | 731 | return $this->dispBoardMessage('msg_not_enough_point'); |
719 | 732 | } |
720 | 733 | } |
721 | 734 | } |
722 | - if(!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus()); |
|
735 | + if(!$oDocument->get('status')) { |
|
736 | + $oDocument->add('status', $oDocumentModel->getDefaultStatus()); |
|
737 | + } |
|
723 | 738 | |
724 | 739 | $statusList = $this->_getStatusNameList($oDocumentModel); |
725 | - if(count($statusList) > 0) Context::set('status_list', $statusList); |
|
740 | + if(count($statusList) > 0) { |
|
741 | + Context::set('status_list', $statusList); |
|
742 | + } |
|
726 | 743 | |
727 | 744 | // get Document status config value |
728 | 745 | Context::set('document_srl',$document_srl); |
@@ -733,13 +750,18 @@ discard block |
||
733 | 750 | $oDocumentController->addXmlJsFilter($this->module_info->module_srl); |
734 | 751 | |
735 | 752 | // if the document exists, then setup extra variabels on context |
736 | - if($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars()); |
|
753 | + if($oDocument->isExists() && !$savedDoc) { |
|
754 | + Context::set('extra_keys', $oDocument->getExtraVars()); |
|
755 | + } |
|
737 | 756 | |
738 | 757 | /** |
739 | 758 | * add JS filters |
740 | 759 | **/ |
741 | - if(Context::get('logged_info')->is_admin=='Y') Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml'); |
|
742 | - else Context::addJsFilter($this->module_path.'tpl/filter', 'insert.xml'); |
|
760 | + if(Context::get('logged_info')->is_admin=='Y') { |
|
761 | + Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml'); |
|
762 | + } else { |
|
763 | + Context::addJsFilter($this->module_path.'tpl/filter', 'insert.xml'); |
|
764 | + } |
|
743 | 765 | |
744 | 766 | $oSecurity = new Security(); |
745 | 767 | $oSecurity->encodeHTML('category_list.text', 'category_list.title'); |
@@ -1054,7 +1076,9 @@ discard block |
||
1054 | 1076 | function dispBoardMessage($msg_code) |
1055 | 1077 | { |
1056 | 1078 | $msg = Context::getLang($msg_code); |
1057 | - if(!$msg) $msg = $msg_code; |
|
1079 | + if(!$msg) { |
|
1080 | + $msg = $msg_code; |
|
1081 | + } |
|
1058 | 1082 | Context::set('message', $msg); |
1059 | 1083 | $this->setTemplateFile('message'); |
1060 | 1084 | } |