@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $security = new Security($addon_list); |
35 | 35 | $addon_list = $security->encodeHTML('..', '..author..'); |
36 | 36 | |
37 | - foreach($addon_list as $no => $addon_info) |
|
37 | + foreach ($addon_list as $no => $addon_info) |
|
38 | 38 | { |
39 | 39 | $addon_list[$no]->description = nl2br(trim($addon_info->description)); |
40 | 40 | } |
@@ -64,21 +64,21 @@ discard block |
||
64 | 64 | $oModuleAdminModel = getAdminModel('module'); |
65 | 65 | |
66 | 66 | $args = new stdClass(); |
67 | - if($site_module_info->site_srl) |
|
67 | + if ($site_module_info->site_srl) |
|
68 | 68 | { |
69 | 69 | $args->site_srl = $site_module_info->site_srl; |
70 | 70 | } |
71 | 71 | $columnList = array('module_srl', 'module_category_srl', 'mid', 'browser_title'); |
72 | 72 | $mid_list = $oModuleModel->getMidList($args, $columnList); |
73 | 73 | // module_category and module combination |
74 | - if(!$site_module_info->site_srl) |
|
74 | + if (!$site_module_info->site_srl) |
|
75 | 75 | { |
76 | 76 | // Get a list of module categories |
77 | 77 | $module_categories = $oModuleModel->getModuleCategories(); |
78 | 78 | |
79 | - if(is_array($mid_list)) |
|
79 | + if (is_array($mid_list)) |
|
80 | 80 | { |
81 | - foreach($mid_list as $module_srl => $module) |
|
81 | + foreach ($mid_list as $module_srl => $module) |
|
82 | 82 | { |
83 | 83 | $module_categories[$module->module_category_srl]->list[$module_srl] = $module; |
84 | 84 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | // Template specifies the path and file |
97 | 97 | $this->setTemplateFile('setup_addon'); |
98 | 98 | |
99 | - if(Context::get('module') != 'admin') |
|
99 | + if (Context::get('module') != 'admin') |
|
100 | 100 | { |
101 | 101 | $this->setLayoutPath('./common/tpl'); |
102 | 102 | $this->setLayoutFile('popup_layout'); |
@@ -21,8 +21,7 @@ |
||
21 | 21 | if($absolute_url) |
22 | 22 | { |
23 | 23 | return getFullUrl('','vid',$vid, 'mid',$mid, 'act',$format); |
24 | - } |
|
25 | - else |
|
24 | + } else |
|
26 | 25 | { |
27 | 26 | return getUrl('','vid',$vid, 'mid',$mid, 'act',$format); |
28 | 27 | } |
@@ -38,17 +38,17 @@ discard block |
||
38 | 38 | function checkUpdate() |
39 | 39 | { |
40 | 40 | $oDB = DB::getInstance(); |
41 | - if(!$oDB->isColumnExists("addons", "is_used_m")) |
|
41 | + if (!$oDB->isColumnExists("addons", "is_used_m")) |
|
42 | 42 | { |
43 | 43 | return TRUE; |
44 | 44 | } |
45 | - if(!$oDB->isColumnExists("addons_site", "is_used_m")) |
|
45 | + if (!$oDB->isColumnExists("addons_site", "is_used_m")) |
|
46 | 46 | { |
47 | 47 | return TRUE; |
48 | 48 | } |
49 | 49 | |
50 | 50 | // 2011. 7. 29. add is_fixed column |
51 | - if(!$oDB->isColumnExists('addons', 'is_fixed')) |
|
51 | + if (!$oDB->isColumnExists('addons', 'is_fixed')) |
|
52 | 52 | { |
53 | 53 | return TRUE; |
54 | 54 | } |
@@ -64,25 +64,25 @@ discard block |
||
64 | 64 | function moduleUpdate() |
65 | 65 | { |
66 | 66 | $oDB = DB::getInstance(); |
67 | - if(!$oDB->isColumnExists("addons", "is_used_m")) |
|
67 | + if (!$oDB->isColumnExists("addons", "is_used_m")) |
|
68 | 68 | { |
69 | 69 | $oDB->addColumn("addons", "is_used_m", "char", 1, "N", TRUE); |
70 | 70 | } |
71 | - if(!$oDB->isColumnExists("addons_site", "is_used_m")) |
|
71 | + if (!$oDB->isColumnExists("addons_site", "is_used_m")) |
|
72 | 72 | { |
73 | 73 | $oDB->addColumn("addons_site", "is_used_m", "char", 1, "N", TRUE); |
74 | 74 | } |
75 | 75 | |
76 | 76 | // 2011. 7. 29. add is_fixed column |
77 | - if(!$oDB->isColumnExists('addons', 'is_fixed')) |
|
77 | + if (!$oDB->isColumnExists('addons', 'is_fixed')) |
|
78 | 78 | { |
79 | 79 | $oDB->addColumn('addons', 'is_fixed', 'char', 1, 'N', TRUE); |
80 | 80 | |
81 | 81 | // move addon info to addon_site table |
82 | 82 | $output = executeQueryArray('addon.getAddons'); |
83 | - if($output->data) |
|
83 | + if ($output->data) |
|
84 | 84 | { |
85 | - foreach($output->data as $row) |
|
85 | + foreach ($output->data as $row) |
|
86 | 86 | { |
87 | 87 | $args = new stdClass(); |
88 | 88 | $args->site_srl = 0; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | function getCacheFilePath($type = "pc") |
27 | 27 | { |
28 | 28 | static $addon_file; |
29 | - if(isset($addon_file)) |
|
29 | + if (isset($addon_file)) |
|
30 | 30 | { |
31 | 31 | return $addon_file; |
32 | 32 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $addon_path = _XE_PATH_ . 'files/cache/addons/'; |
38 | 38 | $addon_file = $addon_path . $site_srl . $type . '.acivated_addons.cache.php'; |
39 | 39 | |
40 | - if($this->addon_file_called) |
|
40 | + if ($this->addon_file_called) |
|
41 | 41 | { |
42 | 42 | return $addon_file; |
43 | 43 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | FileHandler::makeDir($addon_path); |
48 | 48 | |
49 | - if(!file_exists($addon_file)) |
|
49 | + if (!file_exists($addon_file)) |
|
50 | 50 | { |
51 | 51 | $this->makeCacheFile($site_srl, $type); |
52 | 52 | } |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | $buff = array('<?php if(!defined("__XE__")) exit();', '$_m = Context::get(\'mid\');'); |
83 | 83 | $oAddonModel = getAdminModel('addon'); |
84 | 84 | $addon_list = $oAddonModel->getInsertedAddons($site_srl, $gtype); |
85 | - foreach($addon_list as $addon => $val) |
|
85 | + foreach ($addon_list as $addon => $val) |
|
86 | 86 | { |
87 | - if($val->addon == "smartphone" |
|
87 | + if ($val->addon == "smartphone" |
|
88 | 88 | || ($type == "pc" && $val->is_used != 'Y') |
89 | 89 | || ($type == "mobile" && $val->is_used_m != 'Y') |
90 | 90 | || ($gtype == 'global' && $val->is_fixed != 'Y') |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $extra_vars = unserialize($val->extra_vars); |
97 | 97 | $mid_list = $extra_vars->mid_list; |
98 | - if(!is_array($mid_list) || count($mid_list) < 1) |
|
98 | + if (!is_array($mid_list) || count($mid_list) < 1) |
|
99 | 99 | { |
100 | 100 | $mid_list = NULL; |
101 | 101 | } |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | $buff[] = '$before_time = microtime(true);'; |
104 | 104 | $buff[] = '$rm = \'' . $extra_vars->xe_run_method . "';"; |
105 | 105 | $buff[] = '$ml = array('; |
106 | - if($mid_list) |
|
106 | + if ($mid_list) |
|
107 | 107 | { |
108 | - foreach($mid_list as $mid) |
|
108 | + foreach ($mid_list as $mid) |
|
109 | 109 | { |
110 | 110 | $buff[] = "'$mid' => 1,"; |
111 | 111 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $buff[] = ');'; |
114 | 114 | $buff[] = sprintf('$addon_file = \'./addons/%s/%s.addon.php\';', $addon, $addon); |
115 | 115 | |
116 | - if($val->extra_vars) |
|
116 | + if ($val->extra_vars) |
|
117 | 117 | { |
118 | 118 | unset($extra_vars); |
119 | 119 | $extra_vars = base64_encode($val->extra_vars); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | function doSetup($addon, $extra_vars, $site_srl = 0, $gtype = 'site') |
154 | 154 | { |
155 | - if(!is_array($extra_vars->mid_list)) |
|
155 | + if (!is_array($extra_vars->mid_list)) |
|
156 | 156 | { |
157 | 157 | unset($extra_vars->mid_list); |
158 | 158 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $args = new stdClass(); |
161 | 161 | $args->addon = $addon; |
162 | 162 | $args->extra_vars = serialize($extra_vars); |
163 | - if($gtype == 'global') |
|
163 | + if ($gtype == 'global') |
|
164 | 164 | { |
165 | 165 | return executeQuery('addon.updateAddon', $args); |
166 | 166 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | { |
179 | 179 | $addon_path = _XE_PATH_ . 'files/cache/addons/'; |
180 | 180 | $addon_file = $addon_path . $site_srl . '.acivated_addons.cache.php'; |
181 | - if(file_exists($addon_file)) |
|
181 | + if (file_exists($addon_file)) |
|
182 | 182 | { |
183 | 183 | FileHandler::removeFile($addon_file); |
184 | 184 | } |
@@ -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 | { |
@@ -1284,7 +1284,7 @@ |
||
1284 | 1284 | /** |
1285 | 1285 | * Delete cached group data |
1286 | 1286 | * @return void |
1287 | - */ |
|
1287 | + */ |
|
1288 | 1288 | function _deleteMemberGroupCache($site_srl = 0) |
1289 | 1289 | { |
1290 | 1290 | //remove from cache |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | function checkUpdate() |
35 | 35 | { |
36 | 36 | $oDB = DB::getInstance(); |
37 | - if(!$oDB->isColumnExists("admin_favorite", "type")) |
|
37 | + if (!$oDB->isColumnExists("admin_favorite", "type")) |
|
38 | 38 | { |
39 | 39 | return TRUE; |
40 | 40 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | function moduleUpdate() |
50 | 50 | { |
51 | 51 | $oDB = DB::getInstance(); |
52 | - if(!$oDB->isColumnExists("admin_favorite", "type")) |
|
52 | + if (!$oDB->isColumnExists("admin_favorite", "type")) |
|
53 | 53 | { |
54 | 54 | $oAdminAdminModel = getAdminModel('admin'); |
55 | 55 | $output = $oAdminAdminModel->getFavoriteList(); |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | $oDB->dropColumn('admin_favorite', 'admin_favorite_srl'); |
59 | 59 | $oDB->addColumn('admin_favorite', "admin_favorite_srl", "number", 11, 0); |
60 | 60 | $oDB->addColumn('admin_favorite', "type", "varchar", 30, 'module'); |
61 | - if(is_array($favoriteList)) |
|
61 | + if (is_array($favoriteList)) |
|
62 | 62 | { |
63 | 63 | $oAdminAdminController = getAdminController('admin'); |
64 | 64 | $oAdminAdminController->_deleteAllFavorite(); |
65 | - foreach($favoriteList AS $key => $value) |
|
65 | + foreach ($favoriteList AS $key => $value) |
|
66 | 66 | { |
67 | 67 | $oAdminAdminController->_insertFavorite($value->site_srl, $value->module); |
68 | 68 | } |
@@ -83,19 +83,19 @@ discard block |
||
83 | 83 | public function checkAdminMenu() |
84 | 84 | { |
85 | 85 | // for admin menu |
86 | - if(Context::isInstalled()) |
|
86 | + if (Context::isInstalled()) |
|
87 | 87 | { |
88 | 88 | $oMenuAdminModel = getAdminModel('menu'); |
89 | 89 | $output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName); |
90 | 90 | |
91 | - if(!$output->menu_srl) |
|
91 | + if (!$output->menu_srl) |
|
92 | 92 | { |
93 | 93 | $this->createXeAdminMenu(); |
94 | 94 | $output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName); |
95 | 95 | } |
96 | 96 | else |
97 | 97 | { |
98 | - if(!is_readable(FileHandler::getRealPath($output->php_file))) |
|
98 | + if (!is_readable(FileHandler::getRealPath($output->php_file))) |
|
99 | 99 | { |
100 | 100 | $oMenuAdminController = getAdminController('menu'); |
101 | 101 | $oMenuAdminController->makeXmlFile($output->menu_srl); |
@@ -130,14 +130,14 @@ discard block |
||
130 | 130 | |
131 | 131 | // gnb item create |
132 | 132 | $gnbList = array('dashboard', 'menu', 'user', 'content', 'configuration', 'advanced'); |
133 | - foreach($gnbList AS $key => $value) |
|
133 | + foreach ($gnbList AS $key => $value) |
|
134 | 134 | { |
135 | 135 | //insert menu item |
136 | 136 | $args = new stdClass(); |
137 | 137 | $args->menu_srl = $menuSrl; |
138 | 138 | $args->menu_item_srl = getNextSequence(); |
139 | 139 | $args->name = '{$lang->menu_gnb[\'' . $value . '\']}'; |
140 | - if($value == 'dashboard') |
|
140 | + if ($value == 'dashboard') |
|
141 | 141 | { |
142 | 142 | $args->url = 'index.php?module=admin'; |
143 | 143 | } |
@@ -152,9 +152,9 @@ discard block |
||
152 | 152 | $oMenuAdminModel = getAdminModel('menu'); |
153 | 153 | $columnList = array('menu_item_srl', 'name'); |
154 | 154 | $output = $oMenuAdminModel->getMenuItems($menuSrl, 0, $columnList); |
155 | - if(is_array($output->data)) |
|
155 | + if (is_array($output->data)) |
|
156 | 156 | { |
157 | - foreach($output->data AS $key => $value) |
|
157 | + foreach ($output->data AS $key => $value) |
|
158 | 158 | { |
159 | 159 | preg_match('/\{\$lang->menu_gnb\[(.*?)\]\}/i', $value->name, $m); |
160 | 160 | $gnbDBList[$m[1]] = $value->menu_item_srl; |
@@ -265,12 +265,12 @@ discard block |
||
265 | 265 | $args->group_srls = $adminGroupSrl; |
266 | 266 | $oModuleModel = getModel('module'); |
267 | 267 | |
268 | - foreach($gnbModuleList AS $key => $value) |
|
268 | + foreach ($gnbModuleList AS $key => $value) |
|
269 | 269 | { |
270 | - if(is_array($value['subMenu'])) |
|
270 | + if (is_array($value['subMenu'])) |
|
271 | 271 | { |
272 | 272 | $moduleActionInfo = $oModuleModel->getModuleActionXml($value['module']); |
273 | - foreach($value['subMenu'] AS $key2 => $value2) |
|
273 | + foreach ($value['subMenu'] AS $key2 => $value2) |
|
274 | 274 | { |
275 | 275 | $gnbKey = "'" . $this->_getGnbKey($value2) . "'"; |
276 | 276 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | */ |
300 | 300 | function _getGnbKey($menuName) |
301 | 301 | { |
302 | - switch($menuName) |
|
302 | + switch ($menuName) |
|
303 | 303 | { |
304 | 304 | case 'siteMap': |
305 | 305 | case 'siteDesign': |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | */ |
349 | 349 | function _getOldGnbKey($menuName) |
350 | 350 | { |
351 | - switch($menuName) |
|
351 | + switch ($menuName) |
|
352 | 352 | { |
353 | 353 | case 'siteMap': |
354 | 354 | return 'menu'; |
@@ -398,9 +398,9 @@ discard block |
||
398 | 398 | $newAdminmenuSrl = $output->menu_srl; |
399 | 399 | $output = $oMenuAdminModel->getMenuItems($newAdminmenuSrl, 0); |
400 | 400 | $newAdminParentMenuList = array(); |
401 | - if(is_array($output->data)) |
|
401 | + if (is_array($output->data)) |
|
402 | 402 | { |
403 | - foreach($output->data AS $key => $value) |
|
403 | + foreach ($output->data AS $key => $value) |
|
404 | 404 | { |
405 | 405 | $tmp = explode('\'', $value->name); |
406 | 406 | $newAdminParentMenuList[$tmp[1]] = $value; |
@@ -413,15 +413,15 @@ discard block |
||
413 | 413 | $menuSrl = $output->menu_srl; |
414 | 414 | |
415 | 415 | $oMenuAdminController = getAdminController('menu'); |
416 | - if($menuSrl) |
|
416 | + if ($menuSrl) |
|
417 | 417 | { |
418 | 418 | $output = $oMenuAdminModel->getMenuItems($menuSrl); |
419 | - if(is_array($output->data)) |
|
419 | + if (is_array($output->data)) |
|
420 | 420 | { |
421 | 421 | $parentMenu = array(); |
422 | - foreach($output->data AS $key => $menuItem) |
|
422 | + foreach ($output->data AS $key => $menuItem) |
|
423 | 423 | { |
424 | - if($menuItem->parent_srl == 0) |
|
424 | + if ($menuItem->parent_srl == 0) |
|
425 | 425 | { |
426 | 426 | $tmp = explode('\'', $menuItem->name); |
427 | 427 | $parentMenuKey = $tmp[1]; |
@@ -430,15 +430,15 @@ discard block |
||
430 | 430 | } |
431 | 431 | |
432 | 432 | $isUserAddedMenuMoved = FALSE; |
433 | - foreach($output->data AS $key => $menuItem) |
|
433 | + foreach ($output->data AS $key => $menuItem) |
|
434 | 434 | { |
435 | - if($menuItem->parent_srl != 0) |
|
435 | + if ($menuItem->parent_srl != 0) |
|
436 | 436 | { |
437 | 437 | $tmp = explode('\'', $menuItem->name); |
438 | 438 | $menuKey = $tmp[1]; |
439 | 439 | |
440 | 440 | $result = $this->_getOldGnbKey($menuKey); |
441 | - if($result == 'user_added_menu') |
|
441 | + if ($result == 'user_added_menu') |
|
442 | 442 | { |
443 | 443 | // theme menu use not anymore |
444 | 444 | /* if($parentMenu[$menuItem->parent_srl] == 'theme') |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | $newParentItem = $newAdminParentMenuList['menu']; |
447 | 447 | } |
448 | 448 | else */ |
449 | - if($parentMenu[$menuItem->parent_srl] == 'extensions') |
|
449 | + if ($parentMenu[$menuItem->parent_srl] == 'extensions') |
|
450 | 450 | { |
451 | 451 | $newParentItem = $newAdminParentMenuList['advanced']; |
452 | 452 | } |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | } |
464 | 464 | } |
465 | 465 | |
466 | - if($isUserAddedMenuMoved) |
|
466 | + if ($isUserAddedMenuMoved) |
|
467 | 467 | { |
468 | 468 | $oMenuAdminController->makeXmlFile($newAdminmenuSrl); |
469 | 469 | } |
@@ -472,9 +472,9 @@ discard block |
||
472 | 472 | |
473 | 473 | // all old admin menu delete |
474 | 474 | $output = $oMenuAdminModel->getMenuListByTitle('__XE_ADMIN__'); |
475 | - if(is_array($output)) |
|
475 | + if (is_array($output)) |
|
476 | 476 | { |
477 | - foreach($output AS $key=>$value) |
|
477 | + foreach ($output AS $key=>$value) |
|
478 | 478 | { |
479 | 479 | $oMenuAdminController->deleteMenu($value->menu_srl); |
480 | 480 | } |
@@ -92,8 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | $this->createXeAdminMenu(); |
94 | 94 | $output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName); |
95 | - } |
|
96 | - else |
|
95 | + } else |
|
97 | 96 | { |
98 | 97 | if(!is_readable(FileHandler::getRealPath($output->php_file))) |
99 | 98 | { |
@@ -140,8 +139,7 @@ discard block |
||
140 | 139 | if($value == 'dashboard') |
141 | 140 | { |
142 | 141 | $args->url = 'index.php?module=admin'; |
143 | - } |
|
144 | - else |
|
142 | + } else |
|
145 | 143 | { |
146 | 144 | $args->url = '#'; |
147 | 145 | } |
@@ -449,8 +447,7 @@ discard block |
||
449 | 447 | if($parentMenu[$menuItem->parent_srl] == 'extensions') |
450 | 448 | { |
451 | 449 | $newParentItem = $newAdminParentMenuList['advanced']; |
452 | - } |
|
453 | - else |
|
450 | + } else |
|
454 | 451 | { |
455 | 452 | $newParentItem = $newAdminParentMenuList[$parentMenu[$menuItem->parent_srl]]; |
456 | 453 | } |
@@ -17,13 +17,13 @@ discard block |
||
17 | 17 | function generate(&$params) |
18 | 18 | { |
19 | 19 | $xmlDoc = '<?xml version="1.0" encoding="utf-8" ?><methodCall><params>'; |
20 | - if(!is_array($params)) |
|
20 | + if (!is_array($params)) |
|
21 | 21 | { |
22 | 22 | return NULL; |
23 | 23 | } |
24 | 24 | |
25 | 25 | $params["module"] = "resourceapi"; |
26 | - foreach($params as $key => $val) |
|
26 | + foreach ($params as $key => $val) |
|
27 | 27 | { |
28 | 28 | $xmlDoc .= sprintf("<%s><![CDATA[%s]]></%s>", $key, $val, $key); |
29 | 29 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | $body = XmlGenerater::generate($params); |
43 | 43 | $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml"); |
44 | - if(!$buff) |
|
44 | + if (!$buff) |
|
45 | 45 | { |
46 | 46 | return; |
47 | 47 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $oModuleModel = getModel('module'); |
76 | 76 | $config = $oModuleModel->getModuleConfig('autoinstall'); |
77 | - if($config->downloadServer != _XE_DOWNLOAD_SERVER_) |
|
77 | + if ($config->downloadServer != _XE_DOWNLOAD_SERVER_) |
|
78 | 78 | { |
79 | 79 | $this->stop('msg_not_match_server'); |
80 | 80 | } |
@@ -104,31 +104,31 @@ discard block |
||
104 | 104 | $oDB = DB::getInstance(); |
105 | 105 | $oModuleModel = getModel('module'); |
106 | 106 | |
107 | - if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml') && $oDB->isTableExists("autoinstall_installed_packages")) |
|
107 | + if (!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml') && $oDB->isTableExists("autoinstall_installed_packages")) |
|
108 | 108 | { |
109 | 109 | return TRUE; |
110 | 110 | } |
111 | - if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml') |
|
111 | + if (!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml') |
|
112 | 112 | && $oDB->isTableExists("autoinstall_remote_categories")) |
113 | 113 | { |
114 | 114 | return TRUE; |
115 | 115 | } |
116 | 116 | |
117 | 117 | // 2011.08.08 add column 'list_order' in ai_remote_categories |
118 | - if(!$oDB->isColumnExists('ai_remote_categories', 'list_order')) |
|
118 | + if (!$oDB->isColumnExists('ai_remote_categories', 'list_order')) |
|
119 | 119 | { |
120 | 120 | return TRUE; |
121 | 121 | } |
122 | 122 | |
123 | 123 | // 2011.08.08 set _XE_DOWNLOAD_SERVER_ at module config |
124 | 124 | $config = $oModuleModel->getModuleConfig('autoinstall'); |
125 | - if(!isset($config->downloadServer)) |
|
125 | + if (!isset($config->downloadServer)) |
|
126 | 126 | { |
127 | 127 | return TRUE; |
128 | 128 | } |
129 | 129 | |
130 | 130 | // 2012.11.12 add column 'have_instance' in autoinstall_packages |
131 | - if(!$oDB->isColumnExists('autoinstall_packages', 'have_instance')) |
|
131 | + if (!$oDB->isColumnExists('autoinstall_packages', 'have_instance')) |
|
132 | 132 | { |
133 | 133 | return TRUE; |
134 | 134 | } |
@@ -147,19 +147,19 @@ discard block |
||
147 | 147 | $oModuleModel = getModel('module'); |
148 | 148 | $oModuleController = getController('module'); |
149 | 149 | |
150 | - if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml') |
|
150 | + if (!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml') |
|
151 | 151 | && $oDB->isTableExists("autoinstall_installed_packages")) |
152 | 152 | { |
153 | 153 | $oDB->dropTable("autoinstall_installed_packages"); |
154 | 154 | } |
155 | - if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml') |
|
155 | + if (!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml') |
|
156 | 156 | && $oDB->isTableExists("autoinstall_remote_categories")) |
157 | 157 | { |
158 | 158 | $oDB->dropTable("autoinstall_remote_categories"); |
159 | 159 | } |
160 | 160 | |
161 | 161 | // 2011.08.08 add column 'list_order' in 'ai_remote_categories |
162 | - if(!$oDB->isColumnExists('ai_remote_categories', 'list_order')) |
|
162 | + if (!$oDB->isColumnExists('ai_remote_categories', 'list_order')) |
|
163 | 163 | { |
164 | 164 | $oDB->addColumn('ai_remote_categories', 'list_order', 'number', 11, NULL, TRUE); |
165 | 165 | $oDB->addIndex('ai_remote_categories', 'idx_list_order', array('list_order')); |
@@ -167,14 +167,14 @@ discard block |
||
167 | 167 | |
168 | 168 | // 2011. 08. 08 set _XE_DOWNLOAD_SERVER_ at module config |
169 | 169 | $config = $oModuleModel->getModuleConfig('autoinstall'); |
170 | - if(!isset($config->downloadServer)) |
|
170 | + if (!isset($config->downloadServer)) |
|
171 | 171 | { |
172 | 172 | $config->downloadServer = _XE_DOWNLOAD_SERVER_; |
173 | 173 | $oModuleController->insertModuleConfig('autoinstall', $config); |
174 | 174 | } |
175 | 175 | |
176 | 176 | // 2012.11.12 add column 'have_instance' in autoinstall_packages |
177 | - if(!$oDB->isColumnExists('autoinstall_packages', 'have_instance')) |
|
177 | + if (!$oDB->isColumnExists('autoinstall_packages', 'have_instance')) |
|
178 | 178 | { |
179 | 179 | $oDB->addColumn('autoinstall_packages', 'have_instance', 'char', '1', 'N', TRUE); |
180 | 180 | } |
@@ -78,17 +78,17 @@ discard block |
||
78 | 78 | { |
79 | 79 | $oModel = getModel('autoinstall'); |
80 | 80 | $type = $oModel->getTypeFromPath($this->package->path); |
81 | - if($type == "module") |
|
81 | + if ($type == "module") |
|
82 | 82 | { |
83 | 83 | $output = $this->uninstallModule(); |
84 | - if(!$output->toBool()) |
|
84 | + if (!$output->toBool()) |
|
85 | 85 | { |
86 | 86 | return $output; |
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | 90 | $output = $this->_connect(); |
91 | - if(!$output->toBool()) |
|
91 | + if (!$output->toBool()) |
|
92 | 92 | { |
93 | 93 | return $output; |
94 | 94 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | function _download() |
118 | 118 | { |
119 | - if($this->package->path == ".") |
|
119 | + if ($this->package->path == ".") |
|
120 | 120 | { |
121 | 121 | $this->download_file = $this->temp_dir . "xe.tar"; |
122 | 122 | $this->target_path = ""; |
@@ -152,17 +152,17 @@ discard block |
||
152 | 152 | $path_array = explode("/", $this->package->path); |
153 | 153 | $target_name = array_pop($path_array); |
154 | 154 | $oModule = getModule($target_name, "class"); |
155 | - if(!$oModule) |
|
155 | + if (!$oModule) |
|
156 | 156 | { |
157 | 157 | return new Object(-1, 'msg_invalid_request'); |
158 | 158 | } |
159 | - if(!method_exists($oModule, "moduleUninstall")) |
|
159 | + if (!method_exists($oModule, "moduleUninstall")) |
|
160 | 160 | { |
161 | 161 | return new Object(-1, 'msg_invalid_request'); |
162 | 162 | } |
163 | 163 | |
164 | 164 | $output = $oModule->moduleUninstall(); |
165 | - if(is_subclass_of($output, 'Object') && !$output->toBool()) |
|
165 | + if (is_subclass_of($output, 'Object') && !$output->toBool()) |
|
166 | 166 | { |
167 | 167 | return $output; |
168 | 168 | } |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | $schema_dir = sprintf('%s/schemas/', $this->package->path); |
171 | 171 | $schema_files = FileHandler::readDir($schema_dir); |
172 | 172 | $oDB = DB::getInstance(); |
173 | - if(is_array($schema_files)) |
|
173 | + if (is_array($schema_files)) |
|
174 | 174 | { |
175 | - foreach($schema_files as $file) |
|
175 | + foreach ($schema_files as $file) |
|
176 | 176 | { |
177 | 177 | $filename_arr = explode(".", $file); |
178 | 178 | $filename = array_shift($filename_arr); |
@@ -192,26 +192,26 @@ discard block |
||
192 | 192 | function installModule() |
193 | 193 | { |
194 | 194 | $path = $this->package->path; |
195 | - if($path != ".") |
|
195 | + if ($path != ".") |
|
196 | 196 | { |
197 | 197 | $path_array = explode("/", $path); |
198 | 198 | $target_name = array_pop($path_array); |
199 | 199 | $type = substr(array_pop($path_array), 0, -1); |
200 | 200 | } |
201 | 201 | |
202 | - if($type == "module") |
|
202 | + if ($type == "module") |
|
203 | 203 | { |
204 | 204 | $oModuleModel = getModel('module'); |
205 | 205 | $oInstallController = getController('install'); |
206 | 206 | $module_path = ModuleHandler::getModulePath($target_name); |
207 | - if($oModuleModel->checkNeedInstall($target_name)) |
|
207 | + if ($oModuleModel->checkNeedInstall($target_name)) |
|
208 | 208 | { |
209 | 209 | $oInstallController->installModule($target_name, $module_path); |
210 | 210 | } |
211 | - if($oModuleModel->checkNeedUpdate($target_name)) |
|
211 | + if ($oModuleModel->checkNeedUpdate($target_name)) |
|
212 | 212 | { |
213 | 213 | $oModule = getModule($target_name, 'class'); |
214 | - if(method_exists($oModule, 'moduleUpdate')) |
|
214 | + if (method_exists($oModule, 'moduleUpdate')) |
|
215 | 215 | { |
216 | 216 | $oModule->moduleUpdate(); |
217 | 217 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $this->_download(); |
232 | 232 | $file_list = $this->_unPack(); |
233 | 233 | $output = $this->_copyDir($file_list); |
234 | - if(!$output->toBool()) |
|
234 | + if (!$output->toBool()) |
|
235 | 235 | { |
236 | 236 | FileHandler::removeDir($this->temp_dir); |
237 | 237 | return $output; |
@@ -256,9 +256,9 @@ discard block |
||
256 | 256 | |
257 | 257 | $_files = $oTar->files; |
258 | 258 | $file_list = array(); |
259 | - if(is_array($_files)) |
|
259 | + if (is_array($_files)) |
|
260 | 260 | { |
261 | - foreach($_files as $key => $info) |
|
261 | + foreach ($_files as $key => $info) |
|
262 | 262 | { |
263 | 263 | FileHandler::writeFile($this->download_path . "/" . $info['name'], $info['file']); |
264 | 264 | $file_list[] = $info['name']; |
@@ -278,22 +278,22 @@ discard block |
||
278 | 278 | $real_path = FileHandler::getRealPath($path); |
279 | 279 | $oDir = dir($path); |
280 | 280 | $files = array(); |
281 | - while($file = $oDir->read()) |
|
281 | + while ($file = $oDir->read()) |
|
282 | 282 | { |
283 | - if($file == "." || $file == "..") |
|
283 | + if ($file == "." || $file == "..") |
|
284 | 284 | { |
285 | 285 | continue; |
286 | 286 | } |
287 | 287 | $files[] = $file; |
288 | 288 | } |
289 | 289 | |
290 | - foreach($files as $file) |
|
290 | + foreach ($files as $file) |
|
291 | 291 | { |
292 | 292 | $file_path = $path . "/" . $file; |
293 | - if(is_dir(FileHandler::getRealPath($file_path))) |
|
293 | + if (is_dir(FileHandler::getRealPath($file_path))) |
|
294 | 294 | { |
295 | 295 | $output = $this->_removeDir($file_path); |
296 | - if(!$output->toBool()) |
|
296 | + if (!$output->toBool()) |
|
297 | 297 | { |
298 | 298 | return $output; |
299 | 299 | } |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | else |
302 | 302 | { |
303 | 303 | $output = $this->_removeFile($file_path); |
304 | - if(!$output->toBool()) |
|
304 | + if (!$output->toBool()) |
|
305 | 305 | { |
306 | 306 | return $output; |
307 | 307 | } |
@@ -357,17 +357,17 @@ discard block |
||
357 | 357 | */ |
358 | 358 | function _connect() |
359 | 359 | { |
360 | - if(!function_exists('ssh2_connect')) |
|
360 | + if (!function_exists('ssh2_connect')) |
|
361 | 361 | { |
362 | 362 | return new Object(-1, 'msg_sftp_not_supported'); |
363 | 363 | } |
364 | 364 | |
365 | - if(!$this->ftp_info->ftp_user || !$this->ftp_info->sftp || $this->ftp_info->sftp != 'Y') |
|
365 | + if (!$this->ftp_info->ftp_user || !$this->ftp_info->sftp || $this->ftp_info->sftp != 'Y') |
|
366 | 366 | { |
367 | 367 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
368 | 368 | } |
369 | 369 | |
370 | - if($this->ftp_info->ftp_host) |
|
370 | + if ($this->ftp_info->ftp_host) |
|
371 | 371 | { |
372 | 372 | $ftp_host = $this->ftp_info->ftp_host; |
373 | 373 | } |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | $ftp_host = "127.0.0.1"; |
377 | 377 | } |
378 | 378 | $this->connection = ssh2_connect($ftp_host, $this->ftp_info->ftp_port); |
379 | - if(!@ssh2_auth_password($this->connection, $this->ftp_info->ftp_user, $this->ftp_password)) |
|
379 | + if (!@ssh2_auth_password($this->connection, $this->ftp_info->ftp_user, $this->ftp_password)) |
|
380 | 380 | { |
381 | 381 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
382 | 382 | } |
@@ -403,13 +403,13 @@ discard block |
||
403 | 403 | */ |
404 | 404 | function _removeFile($path) |
405 | 405 | { |
406 | - if(substr($path, 0, 2) == "./") |
|
406 | + if (substr($path, 0, 2) == "./") |
|
407 | 407 | { |
408 | 408 | $path = substr($path, 2); |
409 | 409 | } |
410 | 410 | $target_path = $this->ftp_info->ftp_root_path . $path; |
411 | 411 | |
412 | - if(!@ssh2_sftp_unlink($this->sftp, $target_path)) |
|
412 | + if (!@ssh2_sftp_unlink($this->sftp, $target_path)) |
|
413 | 413 | { |
414 | 414 | return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path)); |
415 | 415 | } |
@@ -424,13 +424,13 @@ discard block |
||
424 | 424 | */ |
425 | 425 | function _removeDir_real($path) |
426 | 426 | { |
427 | - if(substr($path, 0, 2) == "./") |
|
427 | + if (substr($path, 0, 2) == "./") |
|
428 | 428 | { |
429 | 429 | $path = substr($path, 2); |
430 | 430 | } |
431 | 431 | $target_path = $this->ftp_info->ftp_root_path . $path; |
432 | 432 | |
433 | - if(!@ssh2_sftp_rmdir($this->sftp, $target_path)) |
|
433 | + if (!@ssh2_sftp_rmdir($this->sftp, $target_path)) |
|
434 | 434 | { |
435 | 435 | return new Object(-1, sprintf(Context::getLang('msg_delete_dir_failed'), $path)); |
436 | 436 | } |
@@ -445,31 +445,31 @@ discard block |
||
445 | 445 | */ |
446 | 446 | function _copyDir(&$file_list) |
447 | 447 | { |
448 | - if(!$this->ftp_password) |
|
448 | + if (!$this->ftp_password) |
|
449 | 449 | { |
450 | 450 | return new Object(-1, 'msg_ftp_password_input'); |
451 | 451 | } |
452 | 452 | |
453 | 453 | $output = $this->_connect(); |
454 | - if(!$output->toBool()) |
|
454 | + if (!$output->toBool()) |
|
455 | 455 | { |
456 | 456 | return $output; |
457 | 457 | } |
458 | 458 | $target_dir = $this->ftp_info->ftp_root_path . $this->target_path; |
459 | 459 | |
460 | - if(is_array($file_list)) |
|
460 | + if (is_array($file_list)) |
|
461 | 461 | { |
462 | - foreach($file_list as $k => $file) |
|
462 | + foreach ($file_list as $k => $file) |
|
463 | 463 | { |
464 | 464 | $org_file = $file; |
465 | - if($this->package->path == ".") |
|
465 | + if ($this->package->path == ".") |
|
466 | 466 | { |
467 | 467 | $file = substr($file, 3); |
468 | 468 | } |
469 | 469 | $path = FileHandler::getRealPath("./" . $this->target_path . "/" . $file); |
470 | 470 | $pathname = dirname($target_dir . "/" . $file); |
471 | 471 | |
472 | - if(!file_exists(FileHandler::getRealPath($real_path))) |
|
472 | + if (!file_exists(FileHandler::getRealPath($real_path))) |
|
473 | 473 | { |
474 | 474 | ssh2_sftp_mkdir($this->sftp, $pathname, 0755, TRUE); |
475 | 475 | } |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | */ |
521 | 521 | function _connect() |
522 | 522 | { |
523 | - if($this->ftp_info->ftp_host) |
|
523 | + if ($this->ftp_info->ftp_host) |
|
524 | 524 | { |
525 | 525 | $ftp_host = $this->ftp_info->ftp_host; |
526 | 526 | } |
@@ -530,20 +530,20 @@ discard block |
||
530 | 530 | } |
531 | 531 | |
532 | 532 | $this->connection = ftp_connect($ftp_host, $this->ftp_info->ftp_port); |
533 | - if(!$this->connection) |
|
533 | + if (!$this->connection) |
|
534 | 534 | { |
535 | 535 | return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_host)); |
536 | 536 | } |
537 | 537 | |
538 | 538 | $login_result = @ftp_login($this->connection, $this->ftp_info->ftp_user, $this->ftp_password); |
539 | - if(!$login_result) |
|
539 | + if (!$login_result) |
|
540 | 540 | { |
541 | 541 | $this->_close(); |
542 | 542 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
543 | 543 | } |
544 | 544 | |
545 | 545 | $_SESSION['ftp_password'] = $this->ftp_password; |
546 | - if($this->ftp_info->ftp_pasv != "N") |
|
546 | + if ($this->ftp_info->ftp_pasv != "N") |
|
547 | 547 | { |
548 | 548 | ftp_pasv($this->connection, TRUE); |
549 | 549 | } |
@@ -558,13 +558,13 @@ discard block |
||
558 | 558 | */ |
559 | 559 | function _removeFile($path) |
560 | 560 | { |
561 | - if(substr($path, 0, 2) == "./") |
|
561 | + if (substr($path, 0, 2) == "./") |
|
562 | 562 | { |
563 | 563 | $path = substr($path, 2); |
564 | 564 | } |
565 | 565 | $target_path = $this->ftp_info->ftp_root_path . $path; |
566 | 566 | |
567 | - if(!@ftp_delete($this->connection, $target_path)) |
|
567 | + if (!@ftp_delete($this->connection, $target_path)) |
|
568 | 568 | { |
569 | 569 | return new Object(-1, "failed to delete file " . $path); |
570 | 570 | } |
@@ -579,13 +579,13 @@ discard block |
||
579 | 579 | */ |
580 | 580 | function _removeDir_real($path) |
581 | 581 | { |
582 | - if(substr($path, 0, 2) == "./") |
|
582 | + if (substr($path, 0, 2) == "./") |
|
583 | 583 | { |
584 | 584 | $path = substr($path, 2); |
585 | 585 | } |
586 | 586 | $target_path = $this->ftp_info->ftp_root_path . $path; |
587 | 587 | |
588 | - if(!@ftp_rmdir($this->connection, $target_path)) |
|
588 | + if (!@ftp_rmdir($this->connection, $target_path)) |
|
589 | 589 | { |
590 | 590 | return new Object(-1, "failed to delete directory " . $path); |
591 | 591 | } |
@@ -610,37 +610,37 @@ discard block |
||
610 | 610 | */ |
611 | 611 | function _copyDir(&$file_list) |
612 | 612 | { |
613 | - if(!$this->ftp_password) |
|
613 | + if (!$this->ftp_password) |
|
614 | 614 | { |
615 | 615 | return new Object(-1, 'msg_ftp_password_input'); |
616 | 616 | } |
617 | 617 | |
618 | 618 | $output = $this->_connect(); |
619 | - if(!$output->toBool()) |
|
619 | + if (!$output->toBool()) |
|
620 | 620 | { |
621 | 621 | return $output; |
622 | 622 | } |
623 | 623 | |
624 | - if(!$this->target_path) |
|
624 | + if (!$this->target_path) |
|
625 | 625 | { |
626 | 626 | $this->target_path = '.'; |
627 | 627 | } |
628 | - if(substr($this->download_path, -1) == '/') |
|
628 | + if (substr($this->download_path, -1) == '/') |
|
629 | 629 | { |
630 | 630 | $this->download_path = substr($this->download_path, 0, -1); |
631 | 631 | } |
632 | 632 | $target_dir = $this->ftp_info->ftp_root_path . $this->target_path; |
633 | 633 | |
634 | - if(is_array($file_list)) |
|
634 | + if (is_array($file_list)) |
|
635 | 635 | { |
636 | - foreach($file_list as $k => $file) |
|
636 | + foreach ($file_list as $k => $file) |
|
637 | 637 | { |
638 | - if(!$file) |
|
638 | + if (!$file) |
|
639 | 639 | { |
640 | 640 | continue; |
641 | 641 | } |
642 | 642 | $org_file = $file; |
643 | - if($this->package->path == ".") |
|
643 | + if ($this->package->path == ".") |
|
644 | 644 | { |
645 | 645 | $file = substr($file, 3); |
646 | 646 | } |
@@ -650,33 +650,33 @@ discard block |
||
650 | 650 | $real_path = "./"; |
651 | 651 | $ftp_path = $this->ftp_info->ftp_root_path; |
652 | 652 | |
653 | - for($i = 0; $i < count($path_list); $i++) |
|
653 | + for ($i = 0; $i < count($path_list); $i++) |
|
654 | 654 | { |
655 | - if($path_list == "") |
|
655 | + if ($path_list == "") |
|
656 | 656 | { |
657 | 657 | continue; |
658 | 658 | } |
659 | 659 | $real_path .= $path_list[$i] . "/"; |
660 | 660 | $ftp_path .= $path_list[$i] . "/"; |
661 | - if(!file_exists(FileHandler::getRealPath($real_path))) |
|
661 | + if (!file_exists(FileHandler::getRealPath($real_path))) |
|
662 | 662 | { |
663 | - if(!@ftp_mkdir($this->connection, $ftp_path)) |
|
663 | + if (!@ftp_mkdir($this->connection, $ftp_path)) |
|
664 | 664 | { |
665 | 665 | return new Object(-1, "msg_make_directory_failed"); |
666 | 666 | } |
667 | 667 | |
668 | - if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') |
|
668 | + if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') |
|
669 | 669 | { |
670 | - if(function_exists('ftp_chmod')) |
|
670 | + if (function_exists('ftp_chmod')) |
|
671 | 671 | { |
672 | - if(!ftp_chmod($this->connection, 0755, $ftp_path)) |
|
672 | + if (!ftp_chmod($this->connection, 0755, $ftp_path)) |
|
673 | 673 | { |
674 | 674 | return new Object(-1, "msg_permission_adjust_failed"); |
675 | 675 | } |
676 | 676 | } |
677 | 677 | else |
678 | 678 | { |
679 | - if(!ftp_site($this->connection, "CHMOD 755 " . $ftp_path)) |
|
679 | + if (!ftp_site($this->connection, "CHMOD 755 " . $ftp_path)) |
|
680 | 680 | { |
681 | 681 | return new Object(-1, "msg_permission_adjust_failed"); |
682 | 682 | } |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | } |
685 | 685 | } |
686 | 686 | } |
687 | - if(!ftp_put($this->connection, $target_dir . '/' . $file, FileHandler::getRealPath($this->download_path . "/" . $org_file), FTP_BINARY)) |
|
687 | + if (!ftp_put($this->connection, $target_dir . '/' . $file, FileHandler::getRealPath($this->download_path . "/" . $org_file), FTP_BINARY)) |
|
688 | 688 | { |
689 | 689 | return new Object(-1, "msg_ftp_upload_failed"); |
690 | 690 | } |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | */ |
734 | 734 | function _connect() |
735 | 735 | { |
736 | - if($this->ftp_info->ftp_host) |
|
736 | + if ($this->ftp_info->ftp_host) |
|
737 | 737 | { |
738 | 738 | $ftp_host = $this->ftp_info->ftp_host; |
739 | 739 | } |
@@ -743,11 +743,11 @@ discard block |
||
743 | 743 | } |
744 | 744 | |
745 | 745 | $this->oFtp = new ftp(); |
746 | - if(!$this->oFtp->ftp_connect($ftp_host, $this->ftp_info->ftp_port)) |
|
746 | + if (!$this->oFtp->ftp_connect($ftp_host, $this->ftp_info->ftp_port)) |
|
747 | 747 | { |
748 | 748 | return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_host)); |
749 | 749 | } |
750 | - if(!$this->oFtp->ftp_login($this->ftp_info->ftp_user, $this->ftp_password)) |
|
750 | + if (!$this->oFtp->ftp_login($this->ftp_info->ftp_user, $this->ftp_password)) |
|
751 | 751 | { |
752 | 752 | $this->_close(); |
753 | 753 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
@@ -764,13 +764,13 @@ discard block |
||
764 | 764 | */ |
765 | 765 | function _removeFile($path) |
766 | 766 | { |
767 | - if(substr($path, 0, 2) == "./") |
|
767 | + if (substr($path, 0, 2) == "./") |
|
768 | 768 | { |
769 | 769 | $path = substr($path, 2); |
770 | 770 | } |
771 | 771 | $target_path = $this->ftp_info->ftp_root_path . $path; |
772 | 772 | |
773 | - if(!$this->oFtp->ftp_delete($target_path)) |
|
773 | + if (!$this->oFtp->ftp_delete($target_path)) |
|
774 | 774 | { |
775 | 775 | return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path)); |
776 | 776 | } |
@@ -784,13 +784,13 @@ discard block |
||
784 | 784 | */ |
785 | 785 | function _removeDir_real($path) |
786 | 786 | { |
787 | - if(substr($path, 0, 2) == "./") |
|
787 | + if (substr($path, 0, 2) == "./") |
|
788 | 788 | { |
789 | 789 | $path = substr($path, 2); |
790 | 790 | } |
791 | 791 | $target_path = $this->ftp_info->ftp_root_path . $path; |
792 | 792 | |
793 | - if(!$this->oFtp->ftp_rmdir($target_path)) |
|
793 | + if (!$this->oFtp->ftp_rmdir($target_path)) |
|
794 | 794 | { |
795 | 795 | return new Object(-1, sprintf(Context::getLang('msg_delete_dir_failed'), $path)); |
796 | 796 | } |
@@ -815,13 +815,13 @@ discard block |
||
815 | 815 | */ |
816 | 816 | function _copyDir(&$file_list) |
817 | 817 | { |
818 | - if(!$this->ftp_password) |
|
818 | + if (!$this->ftp_password) |
|
819 | 819 | { |
820 | 820 | return new Object(-1, 'msg_ftp_password_input'); |
821 | 821 | } |
822 | 822 | |
823 | 823 | $output = $this->_connect(); |
824 | - if(!$output->toBool()) |
|
824 | + if (!$output->toBool()) |
|
825 | 825 | { |
826 | 826 | return $output; |
827 | 827 | } |
@@ -829,12 +829,12 @@ discard block |
||
829 | 829 | $oFtp = &$this->oFtp; |
830 | 830 | $target_dir = $this->ftp_info->ftp_root_path . $this->target_path; |
831 | 831 | |
832 | - if(is_array($file_list)) |
|
832 | + if (is_array($file_list)) |
|
833 | 833 | { |
834 | - foreach($file_list as $k => $file) |
|
834 | + foreach ($file_list as $k => $file) |
|
835 | 835 | { |
836 | 836 | $org_file = $file; |
837 | - if($this->package->path == ".") |
|
837 | + if ($this->package->path == ".") |
|
838 | 838 | { |
839 | 839 | $file = substr($file, 3); |
840 | 840 | } |
@@ -844,15 +844,15 @@ discard block |
||
844 | 844 | $real_path = "./"; |
845 | 845 | $ftp_path = $this->ftp_info->ftp_root_path; |
846 | 846 | |
847 | - for($i = 0; $i < count($path_list); $i++) |
|
847 | + for ($i = 0; $i < count($path_list); $i++) |
|
848 | 848 | { |
849 | - if($path_list == "") |
|
849 | + if ($path_list == "") |
|
850 | 850 | { |
851 | 851 | continue; |
852 | 852 | } |
853 | 853 | $real_path .= $path_list[$i] . "/"; |
854 | 854 | $ftp_path .= $path_list[$i] . "/"; |
855 | - if(!file_exists(FileHandler::getRealPath($real_path))) |
|
855 | + if (!file_exists(FileHandler::getRealPath($real_path))) |
|
856 | 856 | { |
857 | 857 | $oFtp->ftp_mkdir($ftp_path); |
858 | 858 | $oFtp->ftp_site("CHMOD 755 " . $ftp_path); |
@@ -903,13 +903,13 @@ discard block |
||
903 | 903 | */ |
904 | 904 | function _removeFile($path) |
905 | 905 | { |
906 | - if(substr($path, 0, 2) == "./") |
|
906 | + if (substr($path, 0, 2) == "./") |
|
907 | 907 | { |
908 | 908 | $path = substr($path, 2); |
909 | 909 | } |
910 | 910 | $target_path = FileHandler::getRealPath($path); |
911 | 911 | |
912 | - if(!FileHandler::removeFile($target_path)) |
|
912 | + if (!FileHandler::removeFile($target_path)) |
|
913 | 913 | { |
914 | 914 | return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path)); |
915 | 915 | } |
@@ -923,7 +923,7 @@ discard block |
||
923 | 923 | */ |
924 | 924 | function _removeDir_real($path) |
925 | 925 | { |
926 | - if(substr($path, 0, 2) == "./") |
|
926 | + if (substr($path, 0, 2) == "./") |
|
927 | 927 | { |
928 | 928 | $path = substr($path, 2); |
929 | 929 | } |
@@ -952,18 +952,18 @@ discard block |
||
952 | 952 | function _copyDir(&$file_list) |
953 | 953 | { |
954 | 954 | $output = $this->_connect(); |
955 | - if(!$output->toBool()) |
|
955 | + if (!$output->toBool()) |
|
956 | 956 | { |
957 | 957 | return $output; |
958 | 958 | } |
959 | 959 | $target_dir = $this->target_path; |
960 | 960 | |
961 | - if(is_array($file_list)) |
|
961 | + if (is_array($file_list)) |
|
962 | 962 | { |
963 | - foreach($file_list as $k => $file) |
|
963 | + foreach ($file_list as $k => $file) |
|
964 | 964 | { |
965 | 965 | $org_file = $file; |
966 | - if($this->package->path == ".") |
|
966 | + if ($this->package->path == ".") |
|
967 | 967 | { |
968 | 968 | $file = substr($file, 3); |
969 | 969 | } |
@@ -971,19 +971,19 @@ discard block |
||
971 | 971 | $path_list = explode('/', dirname($this->target_path . "/" . $file)); |
972 | 972 | $real_path = "./"; |
973 | 973 | |
974 | - for($i = 0; $i < count($path_list); $i++) |
|
974 | + for ($i = 0; $i < count($path_list); $i++) |
|
975 | 975 | { |
976 | - if($path_list == "") |
|
976 | + if ($path_list == "") |
|
977 | 977 | { |
978 | 978 | continue; |
979 | 979 | } |
980 | 980 | $real_path .= $path_list[$i] . "/"; |
981 | - if(!file_exists(FileHandler::getRealPath($real_path))) |
|
981 | + if (!file_exists(FileHandler::getRealPath($real_path))) |
|
982 | 982 | { |
983 | 983 | FileHandler::makeDir($real_path); |
984 | 984 | } |
985 | 985 | } |
986 | - FileHandler::copyFile( FileHandler::getRealPath($this->download_path . "/" . $org_file), FileHandler::getRealPath("./" . $target_dir . '/' . $file)); |
|
986 | + FileHandler::copyFile(FileHandler::getRealPath($this->download_path . "/" . $org_file), FileHandler::getRealPath("./" . $target_dir . '/' . $file)); |
|
987 | 987 | } |
988 | 988 | } |
989 | 989 |
@@ -121,8 +121,7 @@ discard block |
||
121 | 121 | $this->download_file = $this->temp_dir . "xe.tar"; |
122 | 122 | $this->target_path = ""; |
123 | 123 | $this->download_path = $this->temp_dir; |
124 | - } |
|
125 | - else |
|
124 | + } else |
|
126 | 125 | { |
127 | 126 | $subpath = trim(substr($this->package->path, 2), '/'); |
128 | 127 | $this->download_file = $this->temp_dir . $subpath . ".tar"; |
@@ -297,8 +296,7 @@ discard block |
||
297 | 296 | { |
298 | 297 | return $output; |
299 | 298 | } |
300 | - } |
|
301 | - else |
|
299 | + } else |
|
302 | 300 | { |
303 | 301 | $output = $this->_removeFile($file_path); |
304 | 302 | if(!$output->toBool()) |
@@ -370,8 +368,7 @@ discard block |
||
370 | 368 | if($this->ftp_info->ftp_host) |
371 | 369 | { |
372 | 370 | $ftp_host = $this->ftp_info->ftp_host; |
373 | - } |
|
374 | - else |
|
371 | + } else |
|
375 | 372 | { |
376 | 373 | $ftp_host = "127.0.0.1"; |
377 | 374 | } |
@@ -523,8 +520,7 @@ discard block |
||
523 | 520 | if($this->ftp_info->ftp_host) |
524 | 521 | { |
525 | 522 | $ftp_host = $this->ftp_info->ftp_host; |
526 | - } |
|
527 | - else |
|
523 | + } else |
|
528 | 524 | { |
529 | 525 | $ftp_host = "127.0.0.1"; |
530 | 526 | } |
@@ -673,8 +669,7 @@ discard block |
||
673 | 669 | { |
674 | 670 | return new Object(-1, "msg_permission_adjust_failed"); |
675 | 671 | } |
676 | - } |
|
677 | - else |
|
672 | + } else |
|
678 | 673 | { |
679 | 674 | if(!ftp_site($this->connection, "CHMOD 755 " . $ftp_path)) |
680 | 675 | { |
@@ -736,8 +731,7 @@ discard block |
||
736 | 731 | if($this->ftp_info->ftp_host) |
737 | 732 | { |
738 | 733 | $ftp_host = $this->ftp_info->ftp_host; |
739 | - } |
|
740 | - else |
|
734 | + } else |
|
741 | 735 | { |
742 | 736 | $ftp_host = "127.0.0.1"; |
743 | 737 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $args = new stdClass(); |
20 | 20 | $args->category_srl = $category_srl; |
21 | 21 | $output = executeQueryArray("autoinstall.getCategory", $args); |
22 | - if(!$output->data) |
|
22 | + if (!$output->data) |
|
23 | 23 | { |
24 | 24 | return null; |
25 | 25 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | function getPackages() |
35 | 35 | { |
36 | 36 | $output = executeQueryArray("autoinstall.getPackages"); |
37 | - if(!$output->data) |
|
37 | + if (!$output->data) |
|
38 | 38 | { |
39 | 39 | return array(); |
40 | 40 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $args = new stdClass(); |
53 | 53 | $args->package_srl = $package_srl; |
54 | 54 | $output = executeQueryArray("autoinstall.getInstalledPackage", $args); |
55 | - if(!$output->data) |
|
55 | + if (!$output->data) |
|
56 | 56 | { |
57 | 57 | return null; |
58 | 58 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $args = new stdClass(); |
71 | 71 | $args->package_srl = $package_srl; |
72 | 72 | $output = executeQueryArray("autoinstall.getPackage", $args); |
73 | - if(!$output->data) |
|
73 | + if (!$output->data) |
|
74 | 74 | { |
75 | 75 | return null; |
76 | 76 | } |
@@ -85,22 +85,22 @@ discard block |
||
85 | 85 | function getCategoryList() |
86 | 86 | { |
87 | 87 | $output = executeQueryArray("autoinstall.getCategories"); |
88 | - if(!$output->toBool() || !$output->data) |
|
88 | + if (!$output->toBool() || !$output->data) |
|
89 | 89 | { |
90 | 90 | return array(); |
91 | 91 | } |
92 | 92 | |
93 | 93 | $categoryList = array(); |
94 | - foreach($output->data as $category) |
|
94 | + foreach ($output->data as $category) |
|
95 | 95 | { |
96 | 96 | $category->children = array(); |
97 | 97 | $categoryList[$category->category_srl] = $category; |
98 | 98 | } |
99 | 99 | |
100 | 100 | $depth0 = array(); |
101 | - foreach($categoryList as $key => $category) |
|
101 | + foreach ($categoryList as $key => $category) |
|
102 | 102 | { |
103 | - if($category->parent_srl) |
|
103 | + if ($category->parent_srl) |
|
104 | 104 | { |
105 | 105 | $categoryList[$category->parent_srl]->children[] = & $categoryList[$key]; |
106 | 106 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | } |
112 | 112 | $resultList = array(); |
113 | - foreach($depth0 as $category_srl) |
|
113 | + foreach ($depth0 as $category_srl) |
|
114 | 114 | { |
115 | 115 | $this->setDepth($categoryList[$category_srl], 0, $categoryList, $resultList); |
116 | 116 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $args = new stdClass(); |
129 | 129 | $args->category_srl = $category_srl; |
130 | 130 | $output = executeQuery("autoinstall.getPackageCount", $args); |
131 | - if(!$output->data) |
|
131 | + if (!$output->data) |
|
132 | 132 | { |
133 | 133 | return 0; |
134 | 134 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | function getInstalledPackageCount() |
144 | 144 | { |
145 | 145 | $output = executeQuery("autoinstall.getInstalledPackageCount"); |
146 | - if(!$output->data) |
|
146 | + if (!$output->data) |
|
147 | 147 | { |
148 | 148 | return 0; |
149 | 149 | } |
@@ -164,11 +164,11 @@ discard block |
||
164 | 164 | $resultList[$item->category_srl] = &$item; |
165 | 165 | $item->depth = $depth; |
166 | 166 | $siblingList = $item->category_srl; |
167 | - foreach($item->children as $child) |
|
167 | + foreach ($item->children as $child) |
|
168 | 168 | { |
169 | 169 | $siblingList .= "," . $this->setDepth($list[$child->category_srl], $depth + 1, $list, $resultList); |
170 | 170 | } |
171 | - if(count($item->children) < 1) |
|
171 | + if (count($item->children) < 1) |
|
172 | 172 | { |
173 | 173 | $item->nPackages = $this->getPackageCount($item->category_srl); |
174 | 174 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | function getLatestPackage() |
185 | 185 | { |
186 | 186 | $output = executeQueryArray("autoinstall.getLatestPackage"); |
187 | - if(!$output->data) |
|
187 | + if (!$output->data) |
|
188 | 188 | { |
189 | 189 | return null; |
190 | 190 | } |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | $args->package_list = $package_list; |
204 | 204 | $output = executeQueryArray("autoinstall.getInstalledPackages", $args); |
205 | 205 | $result = array(); |
206 | - if(!$output->data) |
|
206 | + if (!$output->data) |
|
207 | 207 | { |
208 | 208 | return $result; |
209 | 209 | } |
210 | - foreach($output->data as $value) |
|
210 | + foreach ($output->data as $value) |
|
211 | 211 | { |
212 | 212 | $result[$value->package_srl] = $value; |
213 | 213 | } |
@@ -226,15 +226,15 @@ discard block |
||
226 | 226 | $args->page = $page; |
227 | 227 | $args->list_count = 10; |
228 | 228 | $args->page_count = 5; |
229 | - if(Context::getDBType() == 'mssql') |
|
229 | + if (Context::getDBType() == 'mssql') |
|
230 | 230 | { |
231 | 231 | $args->sort_index = 'package_srl'; |
232 | 232 | } |
233 | 233 | $output = executeQueryArray("autoinstall.getInstalledPackageList", $args); |
234 | 234 | $res = array(); |
235 | - if($output->data) |
|
235 | + if ($output->data) |
|
236 | 236 | { |
237 | - foreach($output->data as $val) |
|
237 | + foreach ($output->data as $val) |
|
238 | 238 | { |
239 | 239 | $res[$val->package_srl] = $val; |
240 | 240 | } |
@@ -251,19 +251,19 @@ discard block |
||
251 | 251 | */ |
252 | 252 | function getTypeFromPath($path) |
253 | 253 | { |
254 | - if(!$path) |
|
254 | + if (!$path) |
|
255 | 255 | { |
256 | 256 | return NULL; |
257 | 257 | } |
258 | 258 | |
259 | - if($path == ".") |
|
259 | + if ($path == ".") |
|
260 | 260 | { |
261 | 261 | return "core"; |
262 | 262 | } |
263 | 263 | |
264 | 264 | $path_array = explode("/", $path); |
265 | 265 | $target_name = array_pop($path_array); |
266 | - if(!$target_name) |
|
266 | + if (!$target_name) |
|
267 | 267 | { |
268 | 268 | $target_name = array_pop($path_array); |
269 | 269 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | function getConfigFilePath($type) |
281 | 281 | { |
282 | 282 | $config_file = NULL; |
283 | - switch($type) |
|
283 | + switch ($type) |
|
284 | 284 | { |
285 | 285 | case "m.layout": |
286 | 286 | case "module": |
@@ -317,11 +317,11 @@ discard block |
||
317 | 317 | $path_array = explode("/", $path); |
318 | 318 | $target_name = array_pop($path_array); |
319 | 319 | $oModule = getModule($target_name, "class"); |
320 | - if(!$oModule) |
|
320 | + if (!$oModule) |
|
321 | 321 | { |
322 | 322 | return FALSE; |
323 | 323 | } |
324 | - if(method_exists($oModule, "moduleUninstall")) |
|
324 | + if (method_exists($oModule, "moduleUninstall")) |
|
325 | 325 | { |
326 | 326 | return TRUE; |
327 | 327 | } |
@@ -339,17 +339,17 @@ discard block |
||
339 | 339 | */ |
340 | 340 | function getPackageSrlByPath($path) |
341 | 341 | { |
342 | - if(!$path) |
|
342 | + if (!$path) |
|
343 | 343 | { |
344 | 344 | return; |
345 | 345 | } |
346 | 346 | |
347 | - if(substr($path, -1) == '/') |
|
347 | + if (substr($path, -1) == '/') |
|
348 | 348 | { |
349 | 349 | $path = substr($path, 0, strlen($path) - 1); |
350 | 350 | } |
351 | 351 | |
352 | - if(!$GLOBLAS['XE_AUTOINSTALL_PACKAGE_SRL_BY_PATH'][$path]) |
|
352 | + if (!$GLOBLAS['XE_AUTOINSTALL_PACKAGE_SRL_BY_PATH'][$path]) |
|
353 | 353 | { |
354 | 354 | $args = new stdClass(); |
355 | 355 | $args->path = $path; |
@@ -370,12 +370,12 @@ discard block |
||
370 | 370 | function getRemoveUrlByPackageSrl($packageSrl) |
371 | 371 | { |
372 | 372 | $ftp_info = Context::getFTPInfo(); |
373 | - if(!$ftp_info->ftp_root_path) |
|
373 | + if (!$ftp_info->ftp_root_path) |
|
374 | 374 | { |
375 | 375 | return; |
376 | 376 | } |
377 | 377 | |
378 | - if(!$packageSrl) |
|
378 | + if (!$packageSrl) |
|
379 | 379 | { |
380 | 380 | return; |
381 | 381 | } |
@@ -391,19 +391,19 @@ discard block |
||
391 | 391 | */ |
392 | 392 | function getRemoveUrlByPath($path) |
393 | 393 | { |
394 | - if(!$path) |
|
394 | + if (!$path) |
|
395 | 395 | { |
396 | 396 | return; |
397 | 397 | } |
398 | 398 | |
399 | 399 | $ftp_info = Context::getFTPInfo(); |
400 | - if(!$ftp_info->ftp_root_path) |
|
400 | + if (!$ftp_info->ftp_root_path) |
|
401 | 401 | { |
402 | 402 | return; |
403 | 403 | } |
404 | 404 | |
405 | 405 | $packageSrl = $this->getPackageSrlByPath($path); |
406 | - if(!$packageSrl) |
|
406 | + if (!$packageSrl) |
|
407 | 407 | { |
408 | 408 | return; |
409 | 409 | } |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | */ |
420 | 420 | function getUpdateUrlByPackageSrl($packageSrl) |
421 | 421 | { |
422 | - if(!$packageSrl) |
|
422 | + if (!$packageSrl) |
|
423 | 423 | { |
424 | 424 | return; |
425 | 425 | } |
@@ -435,13 +435,13 @@ discard block |
||
435 | 435 | */ |
436 | 436 | function getUpdateUrlByPath($path) |
437 | 437 | { |
438 | - if(!$path) |
|
438 | + if (!$path) |
|
439 | 439 | { |
440 | 440 | return; |
441 | 441 | } |
442 | 442 | |
443 | 443 | $packageSrl = $this->getPackageSrlByPath($path); |
444 | - if(!$packageSrl) |
|
444 | + if (!$packageSrl) |
|
445 | 445 | { |
446 | 446 | return; |
447 | 447 | } |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | function getHaveInstance($columnList = array()) |
453 | 453 | { |
454 | 454 | $output = executeQueryArray('autoinstall.getHaveInstance', NULL, $columnList); |
455 | - if(!$output->data) |
|
455 | + if (!$output->data) |
|
456 | 456 | { |
457 | 457 | return array(); |
458 | 458 | } |
@@ -103,8 +103,7 @@ discard block |
||
103 | 103 | if($category->parent_srl) |
104 | 104 | { |
105 | 105 | $categoryList[$category->parent_srl]->children[] = & $categoryList[$key]; |
106 | - } |
|
107 | - else |
|
106 | + } else |
|
108 | 107 | { |
109 | 108 | $depth0[] = $key; |
110 | 109 | } |
@@ -324,8 +323,7 @@ discard block |
||
324 | 323 | if(method_exists($oModule, "moduleUninstall")) |
325 | 324 | { |
326 | 325 | return TRUE; |
327 | - } |
|
328 | - else |
|
326 | + } else |
|
329 | 327 | { |
330 | 328 | return FALSE; |
331 | 329 | } |
@@ -27,37 +27,37 @@ discard block |
||
27 | 27 | $args = Context::getRequestVars(); |
28 | 28 | $args->module = 'board'; |
29 | 29 | $args->mid = $args->board_name; |
30 | - if(is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status); |
|
30 | + if (is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status); |
|
31 | 31 | unset($args->board_name); |
32 | 32 | |
33 | 33 | // setup extra_order_target |
34 | 34 | $extra_order_target = array(); |
35 | - if($args->module_srl) |
|
35 | + if ($args->module_srl) |
|
36 | 36 | { |
37 | 37 | $oDocumentModel = getModel('document'); |
38 | 38 | $module_extra_vars = $oDocumentModel->getExtraKeys($args->module_srl); |
39 | - foreach($module_extra_vars as $oExtraItem) |
|
39 | + foreach ($module_extra_vars as $oExtraItem) |
|
40 | 40 | { |
41 | 41 | $extra_order_target[$oExtraItem->eid] = $oExtraItem->name; |
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | 45 | // setup other variables |
46 | - if($args->except_notice != 'Y') $args->except_notice = 'N'; |
|
47 | - if($args->use_anonymous != 'Y') $args->use_anonymous = 'N'; |
|
48 | - if($args->consultation != 'Y') $args->consultation = 'N'; |
|
49 | - if($args->protect_content!= 'Y') $args->protect_content = 'N'; |
|
50 | - if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order'; |
|
51 | - if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
46 | + if ($args->except_notice != 'Y') $args->except_notice = 'N'; |
|
47 | + if ($args->use_anonymous != 'Y') $args->use_anonymous = 'N'; |
|
48 | + if ($args->consultation != 'Y') $args->consultation = 'N'; |
|
49 | + if ($args->protect_content != 'Y') $args->protect_content = 'N'; |
|
50 | + if (!in_array($args->order_target, $this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order'; |
|
51 | + if (!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
52 | 52 | |
53 | 53 | // if there is an existed module |
54 | - if($args->module_srl) { |
|
54 | + if ($args->module_srl) { |
|
55 | 55 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl); |
56 | - if($module_info->module_srl != $args->module_srl) unset($args->module_srl); |
|
56 | + if ($module_info->module_srl != $args->module_srl) unset($args->module_srl); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // insert/update the board module based on module_srl |
60 | - if(!$args->module_srl) { |
|
60 | + if (!$args->module_srl) { |
|
61 | 61 | $args->hide_category = 'N'; |
62 | 62 | $output = $oModuleController->insertModule($args); |
63 | 63 | $msg_code = 'success_registed'; |
@@ -67,18 +67,18 @@ discard block |
||
67 | 67 | $msg_code = 'success_updated'; |
68 | 68 | } |
69 | 69 | |
70 | - if(!$output->toBool()) return $output; |
|
70 | + if (!$output->toBool()) return $output; |
|
71 | 71 | |
72 | 72 | // setup list config |
73 | - $list = explode(',',Context::get('list')); |
|
74 | - if(count($list)) |
|
73 | + $list = explode(',', Context::get('list')); |
|
74 | + if (count($list)) |
|
75 | 75 | { |
76 | 76 | $list_arr = array(); |
77 | - foreach($list as $val) |
|
77 | + foreach ($list as $val) |
|
78 | 78 | { |
79 | 79 | $val = trim($val); |
80 | - if(!$val) continue; |
|
81 | - if(substr($val,0,10)=='extra_vars') $val = substr($val,10); |
|
80 | + if (!$val) continue; |
|
81 | + if (substr($val, 0, 10) == 'extra_vars') $val = substr($val, 10); |
|
82 | 82 | $list_arr[] = $val; |
83 | 83 | } |
84 | 84 | $oModuleController = getController('module'); |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | $this->setMessage($msg_code); |
89 | - if (Context::get('success_return_url')){ |
|
89 | + if (Context::get('success_return_url')) { |
|
90 | 90 | changeValueInUrl('mid', $args->mid, $module_info->mid); |
91 | 91 | $this->setRedirectUrl(Context::get('success_return_url')); |
92 | - }else{ |
|
92 | + } else { |
|
93 | 93 | $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminBoardInfo', 'module_srl', $output->get('module_srl'))); |
94 | 94 | } |
95 | 95 | } |
@@ -105,17 +105,17 @@ discard block |
||
105 | 105 | // for board info |
106 | 106 | $args->module = 'board'; |
107 | 107 | $args->mid = $args->board_name; |
108 | - if(is_array($args->use_status)) |
|
108 | + if (is_array($args->use_status)) |
|
109 | 109 | { |
110 | 110 | $args->use_status = implode('|@|', $args->use_status); |
111 | 111 | } |
112 | 112 | unset($args->board_name); |
113 | 113 | |
114 | - if(!in_array($args->order_target, $this->order_target)) |
|
114 | + if (!in_array($args->order_target, $this->order_target)) |
|
115 | 115 | { |
116 | 116 | $args->order_target = 'list_order'; |
117 | 117 | } |
118 | - if(!in_array($args->order_type, array('asc', 'desc'))) |
|
118 | + if (!in_array($args->order_type, array('asc', 'desc'))) |
|
119 | 119 | { |
120 | 120 | $args->order_type = 'asc'; |
121 | 121 | } |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | |
126 | 126 | // for grant info, Register Admin ID |
127 | 127 | $oModuleController->deleteAdminId($args->module_srl); |
128 | - if($args->admin_member) |
|
128 | + if ($args->admin_member) |
|
129 | 129 | { |
130 | - $admin_members = explode(',',$args->admin_member); |
|
131 | - for($i=0;$i<count($admin_members);$i++) |
|
130 | + $admin_members = explode(',', $args->admin_member); |
|
131 | + for ($i = 0; $i < count($admin_members); $i++) |
|
132 | 132 | { |
133 | 133 | $admin_id = trim($admin_members[$i]); |
134 | - if(!$admin_id) continue; |
|
134 | + if (!$admin_id) continue; |
|
135 | 135 | $oModuleController->insertAdminId($args->module_srl, $admin_id); |
136 | 136 | } |
137 | 137 | } |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | // get the current module |
147 | 147 | $oModuleController = getController('module'); |
148 | 148 | $output = $oModuleController->deleteModule($module_srl); |
149 | - if(!$output->toBool()) return $output; |
|
149 | + if (!$output->toBool()) return $output; |
|
150 | 150 | |
151 | - $this->add('module','board'); |
|
152 | - $this->add('page',Context::get('page')); |
|
151 | + $this->add('module', 'board'); |
|
152 | + $this->add('page', Context::get('page')); |
|
153 | 153 | $this->setMessage('success_deleted'); |
154 | 154 | } |
155 | 155 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | $oModuleModel = getModel('module'); |
162 | 162 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
163 | - if($module_info->mid != $mid) |
|
163 | + if ($module_info->mid != $mid) |
|
164 | 164 | { |
165 | 165 | return new Object(-1, 'msg_invalid_request'); |
166 | 166 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $module_info->hide_category = Context::get('hide_category') == 'Y' ? 'Y' : 'N'; |
169 | 169 | $oModuleController = getController('module'); /* @var $oModuleController moduleController */ |
170 | 170 | $output = $oModuleController->updateModule($module_info); |
171 | - if(!$output->toBool()) |
|
171 | + if (!$output->toBool()) |
|
172 | 172 | { |
173 | 173 | return $output; |
174 | 174 | } |
@@ -27,7 +27,9 @@ discard block |
||
27 | 27 | $args = Context::getRequestVars(); |
28 | 28 | $args->module = 'board'; |
29 | 29 | $args->mid = $args->board_name; |
30 | - if(is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status); |
|
30 | + if(is_array($args->use_status)) { |
|
31 | + $args->use_status = implode('|@|', $args->use_status); |
|
32 | + } |
|
31 | 33 | unset($args->board_name); |
32 | 34 | |
33 | 35 | // setup extra_order_target |
@@ -43,17 +45,31 @@ discard block |
||
43 | 45 | } |
44 | 46 | |
45 | 47 | // setup other variables |
46 | - if($args->except_notice != 'Y') $args->except_notice = 'N'; |
|
47 | - if($args->use_anonymous != 'Y') $args->use_anonymous = 'N'; |
|
48 | - if($args->consultation != 'Y') $args->consultation = 'N'; |
|
49 | - if($args->protect_content!= 'Y') $args->protect_content = 'N'; |
|
50 | - if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order'; |
|
51 | - if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
48 | + if($args->except_notice != 'Y') { |
|
49 | + $args->except_notice = 'N'; |
|
50 | + } |
|
51 | + if($args->use_anonymous != 'Y') { |
|
52 | + $args->use_anonymous = 'N'; |
|
53 | + } |
|
54 | + if($args->consultation != 'Y') { |
|
55 | + $args->consultation = 'N'; |
|
56 | + } |
|
57 | + if($args->protect_content!= 'Y') { |
|
58 | + $args->protect_content = 'N'; |
|
59 | + } |
|
60 | + if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) { |
|
61 | + $args->order_target = 'list_order'; |
|
62 | + } |
|
63 | + if(!in_array($args->order_type, array('asc', 'desc'))) { |
|
64 | + $args->order_type = 'asc'; |
|
65 | + } |
|
52 | 66 | |
53 | 67 | // if there is an existed module |
54 | 68 | if($args->module_srl) { |
55 | 69 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl); |
56 | - if($module_info->module_srl != $args->module_srl) unset($args->module_srl); |
|
70 | + if($module_info->module_srl != $args->module_srl) { |
|
71 | + unset($args->module_srl); |
|
72 | + } |
|
57 | 73 | } |
58 | 74 | |
59 | 75 | // insert/update the board module based on module_srl |
@@ -67,7 +83,9 @@ discard block |
||
67 | 83 | $msg_code = 'success_updated'; |
68 | 84 | } |
69 | 85 | |
70 | - if(!$output->toBool()) return $output; |
|
86 | + if(!$output->toBool()) { |
|
87 | + return $output; |
|
88 | + } |
|
71 | 89 | |
72 | 90 | // setup list config |
73 | 91 | $list = explode(',',Context::get('list')); |
@@ -77,8 +95,12 @@ discard block |
||
77 | 95 | foreach($list as $val) |
78 | 96 | { |
79 | 97 | $val = trim($val); |
80 | - if(!$val) continue; |
|
81 | - if(substr($val,0,10)=='extra_vars') $val = substr($val,10); |
|
98 | + if(!$val) { |
|
99 | + continue; |
|
100 | + } |
|
101 | + if(substr($val,0,10)=='extra_vars') { |
|
102 | + $val = substr($val,10); |
|
103 | + } |
|
82 | 104 | $list_arr[] = $val; |
83 | 105 | } |
84 | 106 | $oModuleController = getController('module'); |
@@ -89,7 +111,7 @@ discard block |
||
89 | 111 | if (Context::get('success_return_url')){ |
90 | 112 | changeValueInUrl('mid', $args->mid, $module_info->mid); |
91 | 113 | $this->setRedirectUrl(Context::get('success_return_url')); |
92 | - }else{ |
|
114 | + } else{ |
|
93 | 115 | $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminBoardInfo', 'module_srl', $output->get('module_srl'))); |
94 | 116 | } |
95 | 117 | } |
@@ -131,7 +153,9 @@ discard block |
||
131 | 153 | for($i=0;$i<count($admin_members);$i++) |
132 | 154 | { |
133 | 155 | $admin_id = trim($admin_members[$i]); |
134 | - if(!$admin_id) continue; |
|
156 | + if(!$admin_id) { |
|
157 | + continue; |
|
158 | + } |
|
135 | 159 | $oModuleController->insertAdminId($args->module_srl, $admin_id); |
136 | 160 | } |
137 | 161 | } |
@@ -146,7 +170,9 @@ discard block |
||
146 | 170 | // get the current module |
147 | 171 | $oModuleController = getController('module'); |
148 | 172 | $output = $oModuleController->deleteModule($module_srl); |
149 | - if(!$output->toBool()) return $output; |
|
173 | + if(!$output->toBool()) { |
|
174 | + return $output; |
|
175 | + } |
|
150 | 176 | |
151 | 177 | $this->add('module','board'); |
152 | 178 | $this->add('page',Context::get('page')); |
@@ -177,8 +203,7 @@ discard block |
||
177 | 203 | if (Context::get('success_return_url')) |
178 | 204 | { |
179 | 205 | $this->setRedirectUrl(Context::get('success_return_url')); |
180 | - } |
|
181 | - else |
|
206 | + } else |
|
182 | 207 | { |
183 | 208 | $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminCategoryInfo', 'module_srl', $output->get('module_srl'))); |
184 | 209 | } |