@@ -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); |
@@ -169,14 +169,14 @@ discard block |
||
169 | 169 | |
170 | 170 | $is_authed = 0; |
171 | 171 | $output = $oAdminModel->checkUseDirectModuleInstall($package); |
172 | - if($output->toBool()==TRUE) |
|
172 | + if ($output->toBool() == TRUE) |
|
173 | 173 | { |
174 | 174 | $is_authed = 1; |
175 | 175 | } |
176 | 176 | else |
177 | 177 | { |
178 | 178 | $ftp_info = Context::getFTPInfo(); |
179 | - if(!$ftp_info->ftp_root_path) |
|
179 | + if (!$ftp_info->ftp_root_path) |
|
180 | 180 | { |
181 | 181 | $is_authed = -1; |
182 | 182 | } |
@@ -196,14 +196,14 @@ discard block |
||
196 | 196 | { |
197 | 197 | $oModel = getModel('autoinstall'); |
198 | 198 | $output = executeQueryArray('autoinstall.getNeedUpdate'); |
199 | - if(!is_array($output->data)) |
|
199 | + if (!is_array($output->data)) |
|
200 | 200 | { |
201 | 201 | return NULL; |
202 | 202 | } |
203 | 203 | |
204 | 204 | $result = array(); |
205 | 205 | $xml = new XmlParser(); |
206 | - foreach($output->data as $package) |
|
206 | + foreach ($output->data as $package) |
|
207 | 207 | { |
208 | 208 | $packageSrl = $package->package_srl; |
209 | 209 | |
@@ -213,27 +213,27 @@ discard block |
||
213 | 213 | $packageInfo->type = $oModel->getTypeFromPath($package->path); |
214 | 214 | $packageInfo->url = $oModel->getUpdateUrlByPackageSrl($package->package_srl); |
215 | 215 | |
216 | - if($packageInfo->type == 'core') |
|
216 | + if ($packageInfo->type == 'core') |
|
217 | 217 | { |
218 | 218 | $title = 'XpressEngine'; |
219 | 219 | } |
220 | 220 | else |
221 | 221 | { |
222 | 222 | $configFile = $oModel->getConfigFilePath($packageInfo->type); |
223 | - $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($package->path) . $configFile); |
|
223 | + $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($package->path).$configFile); |
|
224 | 224 | |
225 | - if($xmlDoc) |
|
225 | + if ($xmlDoc) |
|
226 | 226 | { |
227 | 227 | $type = $packageInfo->type; |
228 | - if($type == "drcomponent") |
|
228 | + if ($type == "drcomponent") |
|
229 | 229 | { |
230 | 230 | $type = "component"; |
231 | 231 | } |
232 | - if($type == "style" || $type == "m.skin") |
|
232 | + if ($type == "style" || $type == "m.skin") |
|
233 | 233 | { |
234 | 234 | $type = "skin"; |
235 | 235 | } |
236 | - if($type == "m.layout") |
|
236 | + if ($type == "m.layout") |
|
237 | 237 | { |
238 | 238 | $type = "layout"; |
239 | 239 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $oModel = getModel('autoinstall'); |
268 | 268 | |
269 | 269 | $targetpackages = array(); |
270 | - if($xmlDoc) |
|
270 | + if ($xmlDoc) |
|
271 | 271 | { |
272 | 272 | $xmlPackage = $xmlDoc->response->package; |
273 | 273 | $package = new stdClass(); |
@@ -276,15 +276,15 @@ discard block |
||
276 | 276 | $package->package_description = $xmlPackage->package_description->body; |
277 | 277 | $package->version = $xmlPackage->version->body; |
278 | 278 | $package->path = $xmlPackage->path->body; |
279 | - if($xmlPackage->depends) |
|
279 | + if ($xmlPackage->depends) |
|
280 | 280 | { |
281 | - if(!is_array($xmlPackage->depends->item)) |
|
281 | + if (!is_array($xmlPackage->depends->item)) |
|
282 | 282 | { |
283 | 283 | $xmlPackage->depends->item = array($xmlPackage->depends->item); |
284 | 284 | } |
285 | 285 | |
286 | 286 | $package->depends = array(); |
287 | - foreach($xmlPackage->depends->item as $item) |
|
287 | + foreach ($xmlPackage->depends->item as $item) |
|
288 | 288 | { |
289 | 289 | $dep_item = new stdClass(); |
290 | 290 | $dep_item->package_srl = $item->package_srl->body; |
@@ -297,23 +297,23 @@ discard block |
||
297 | 297 | |
298 | 298 | $packages = $oModel->getInstalledPackages(array_keys($targetpackages)); |
299 | 299 | $package->deplist = ""; |
300 | - foreach($package->depends as $key => $dep) |
|
300 | + foreach ($package->depends as $key => $dep) |
|
301 | 301 | { |
302 | - if(!$packages[$dep->package_srl]) |
|
302 | + if (!$packages[$dep->package_srl]) |
|
303 | 303 | { |
304 | 304 | $package->depends[$key]->installed = FALSE; |
305 | - $package->package_srl .= "," . $dep->package_srl; |
|
305 | + $package->package_srl .= ",".$dep->package_srl; |
|
306 | 306 | } |
307 | 307 | else |
308 | 308 | { |
309 | 309 | $package->depends[$key]->installed = TRUE; |
310 | 310 | $package->depends[$key]->cur_version = $packages[$dep->package_srl]->current_version; |
311 | - if(version_compare($dep->version, $packages[$dep->package_srl]->current_version, ">")) |
|
311 | + if (version_compare($dep->version, $packages[$dep->package_srl]->current_version, ">")) |
|
312 | 312 | { |
313 | 313 | $package->depends[$key]->need_update = TRUE; |
314 | - $package->package_srl .= "," . $dep->package_srl; |
|
314 | + $package->package_srl .= ",".$dep->package_srl; |
|
315 | 315 | |
316 | - if($dep->path === '.') |
|
316 | + if ($dep->path === '.') |
|
317 | 317 | { |
318 | 318 | $package->contain_core = TRUE; |
319 | 319 | $package->contain_core_version = $dep->version; |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | } |
329 | 329 | |
330 | 330 | $installedPackage = $oModel->getInstalledPackage($packageSrl); |
331 | - if($installedPackage) |
|
331 | + if ($installedPackage) |
|
332 | 332 | { |
333 | 333 | $package->installed = TRUE; |
334 | 334 | $package->cur_version = $installedPackage->current_version; |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | public function getAutoInstallAdminInstallInfo() |
346 | 346 | { |
347 | 347 | $packageSrl = Context::get('package_srl'); |
348 | - if(!$packageSrl) |
|
348 | + if (!$packageSrl) |
|
349 | 349 | { |
350 | 350 | return new BaseObject(-1, 'msg_invalid_request'); |
351 | 351 | } |
@@ -359,23 +359,23 @@ discard block |
||
359 | 359 | $directModuleInstall = TRUE; |
360 | 360 | $arrUnwritableDir = array(); |
361 | 361 | $output = $this->isWritableDir($package->path); |
362 | - if($output->toBool()==FALSE) |
|
362 | + if ($output->toBool() == FALSE) |
|
363 | 363 | { |
364 | 364 | $directModuleInstall = FALSE; |
365 | 365 | $arrUnwritableDir[] = $output->get('path'); |
366 | 366 | } |
367 | 367 | |
368 | - foreach($package->depends as $dep) |
|
368 | + foreach ($package->depends as $dep) |
|
369 | 369 | { |
370 | 370 | $output = $this->isWritableDir($dep->path); |
371 | - if($output->toBool()==FALSE) |
|
371 | + if ($output->toBool() == FALSE) |
|
372 | 372 | { |
373 | 373 | $directModuleInstall = FALSE; |
374 | 374 | $arrUnwritableDir[] = $output->get('path'); |
375 | 375 | } |
376 | 376 | } |
377 | 377 | |
378 | - if($directModuleInstall==FALSE) |
|
378 | + if ($directModuleInstall == FALSE) |
|
379 | 379 | { |
380 | 380 | $output = new BaseObject(-1, 'msg_direct_inall_invalid'); |
381 | 381 | $output->add('path', $arrUnwritableDir); |
@@ -390,17 +390,17 @@ discard block |
||
390 | 390 | $path_list = explode('/', dirname($path)); |
391 | 391 | $real_path = './'; |
392 | 392 | |
393 | - while($path_list) |
|
393 | + while ($path_list) |
|
394 | 394 | { |
395 | - $check_path = realpath($real_path . implode('/', $path_list)); |
|
396 | - if(FileHandler::isDir($check_path)) |
|
395 | + $check_path = realpath($real_path.implode('/', $path_list)); |
|
396 | + if (FileHandler::isDir($check_path)) |
|
397 | 397 | { |
398 | 398 | break; |
399 | 399 | } |
400 | 400 | array_pop($path_list); |
401 | 401 | } |
402 | 402 | |
403 | - if(FileHandler::isWritableDir($check_path)==FALSE) |
|
403 | + if (FileHandler::isWritableDir($check_path) == FALSE) |
|
404 | 404 | { |
405 | 405 | $output = new BaseObject(-1, 'msg_unwritable_directory'); |
406 | 406 | $output->add('path', FileHandler::getRealPath($check_path)); |