@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | /** |
| 227 | 227 | * When the object gets serialized only include specific object members. |
| 228 | 228 | * |
| 229 | - * @return array |
|
| 229 | + * @return string[] |
|
| 230 | 230 | */ |
| 231 | 231 | public function __sleep() { |
| 232 | 232 | return array('options','objectFilters','enabled'); |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | * |
| 317 | 317 | * Will throw exceptions for each php error. |
| 318 | 318 | * |
| 319 | - * @return mixed Returns a string containing the previously defined error handler (if any) |
|
| 319 | + * @return null|callable Returns a string containing the previously defined error handler (if any) |
|
| 320 | 320 | */ |
| 321 | 321 | public function registerErrorHandler($throwErrorExceptions=true) |
| 322 | 322 | { |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | /** |
| 363 | 363 | * Register FirePHP as your exception handler |
| 364 | 364 | * |
| 365 | - * @return mixed Returns the name of the previously defined exception handler, |
|
| 365 | + * @return callable Returns the name of the previously defined exception handler, |
|
| 366 | 366 | * or NULL on error. |
| 367 | 367 | * If no previous handler was defined, NULL is also returned. |
| 368 | 368 | */ |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | * |
| 468 | 468 | * @param string $Name |
| 469 | 469 | * @param array $Options OPTIONAL Instructions on how to log the group |
| 470 | - * @return true |
|
| 470 | + * @return boolean |
|
| 471 | 471 | * @throws Exception |
| 472 | 472 | */ |
| 473 | 473 | public function group($Name, $Options=null) { |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | /** |
| 492 | 492 | * Ends a group you have started before |
| 493 | 493 | * |
| 494 | - * @return true |
|
| 494 | + * @return boolean |
|
| 495 | 495 | * @throws Exception |
| 496 | 496 | */ |
| 497 | 497 | public function groupEnd() { |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | * @see FirePHP::LOG |
| 505 | 505 | * @param mixes $Object |
| 506 | 506 | * @param string $Label |
| 507 | - * @return true |
|
| 507 | + * @return boolean |
|
| 508 | 508 | * @throws Exception |
| 509 | 509 | */ |
| 510 | 510 | public function log($Object, $Label=null) { |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | * @see FirePHP::INFO |
| 518 | 518 | * @param mixes $Object |
| 519 | 519 | * @param string $Label |
| 520 | - * @return true |
|
| 520 | + * @return boolean |
|
| 521 | 521 | * @throws Exception |
| 522 | 522 | */ |
| 523 | 523 | public function info($Object, $Label=null) { |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | * @see FirePHP::WARN |
| 531 | 531 | * @param mixes $Object |
| 532 | 532 | * @param string $Label |
| 533 | - * @return true |
|
| 533 | + * @return boolean |
|
| 534 | 534 | * @throws Exception |
| 535 | 535 | */ |
| 536 | 536 | public function warn($Object, $Label=null) { |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | * @see FirePHP::ERROR |
| 544 | 544 | * @param mixes $Object |
| 545 | 545 | * @param string $Label |
| 546 | - * @return true |
|
| 546 | + * @return boolean |
|
| 547 | 547 | * @throws Exception |
| 548 | 548 | */ |
| 549 | 549 | public function error($Object, $Label=null) { |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | * @see FirePHP::DUMP |
| 557 | 557 | * @param string $Key |
| 558 | 558 | * @param mixed $Variable |
| 559 | - * @return true |
|
| 559 | + * @return boolean |
|
| 560 | 560 | * @throws Exception |
| 561 | 561 | */ |
| 562 | 562 | public function dump($Key, $Variable) { |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | * |
| 569 | 569 | * @see FirePHP::TRACE |
| 570 | 570 | * @param string $Label |
| 571 | - * @return true |
|
| 571 | + * @return boolean |
|
| 572 | 572 | * @throws Exception |
| 573 | 573 | */ |
| 574 | 574 | public function trace($Label) { |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | * @see FirePHP::TABLE |
| 582 | 582 | * @param string $Label |
| 583 | 583 | * @param string $Table |
| 584 | - * @return true |
|
| 584 | + * @return boolean |
|
| 585 | 585 | * @throws Exception |
| 586 | 586 | */ |
| 587 | 587 | public function table($Label, $Table) { |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | * |
| 608 | 608 | * @see http://www.firephp.org/Wiki/Reference/Fb |
| 609 | 609 | * @param mixed $Object The variable to be logged |
| 610 | - * @return true Return TRUE if message was added to headers, FALSE otherwise |
|
| 610 | + * @return boolean Return TRUE if message was added to headers, FALSE otherwise |
|
| 611 | 611 | * @throws Exception |
| 612 | 612 | */ |
| 613 | 613 | public function fb($Object) { |
@@ -1005,7 +1005,6 @@ discard block |
||
| 1005 | 1005 | * protected and private visibility |
| 1006 | 1006 | * |
| 1007 | 1007 | * @param BaseObject $Object The object to be encoded |
| 1008 | - * @param int $Depth The current traversal depth |
|
| 1009 | 1008 | * @return array All members of the object |
| 1010 | 1009 | */ |
| 1011 | 1010 | protected function encodeObject($Object, $ObjectDepth = 1, $ArrayDepth = 1) |
@@ -145,7 +145,7 @@ |
||
| 145 | 145 | * Save setup |
| 146 | 146 | * |
| 147 | 147 | * @param string $addon Addon name |
| 148 | - * @param object $extra_vars Extra variables |
|
| 148 | + * @param BaseObject $extra_vars Extra variables |
|
| 149 | 149 | * @param int $site_srl Site srl |
| 150 | 150 | * @param string $gtype site or global |
| 151 | 151 | * @return BaseObject |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * initialization |
| 16 | - * @return void |
|
| 16 | + * @return ModuleObject|null |
|
| 17 | 17 | */ |
| 18 | 18 | function init() |
| 19 | 19 | { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Regenerate all cache files |
| 55 | - * @return void |
|
| 55 | + * @return BaseObject|null |
|
| 56 | 56 | */ |
| 57 | 57 | function procAdminRecompileCacheFile() |
| 58 | 58 | { |
@@ -156,6 +156,9 @@ discard block |
||
| 156 | 156 | return $this->setRedirectUrl(Context::get('error_return_url'), $output); |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | + /** |
|
| 160 | + * @param BaseObject $vars |
|
| 161 | + */ |
|
| 159 | 162 | public function updateDefaultDesignInfo($vars) |
| 160 | 163 | { |
| 161 | 164 | $siteDesignPath = _XE_PATH_ . 'files/site_design/'; |
@@ -207,6 +210,9 @@ discard block |
||
| 207 | 210 | return new BaseObject(); |
| 208 | 211 | } |
| 209 | 212 | |
| 213 | + /** |
|
| 214 | + * @param stdClass $designInfo |
|
| 215 | + */ |
|
| 210 | 216 | function makeDefaultDesignFile($designInfo, $site_srl = 0) |
| 211 | 217 | { |
| 212 | 218 | $buff = array(); |
@@ -433,6 +439,8 @@ discard block |
||
| 433 | 439 | |
| 434 | 440 | /** |
| 435 | 441 | * Insert favorite |
| 442 | + * @param string $siteSrl |
|
| 443 | + * @param string $module |
|
| 436 | 444 | * @return object query result |
| 437 | 445 | */ |
| 438 | 446 | function _insertFavorite($siteSrl, $module, $type = 'module') |
@@ -471,7 +479,7 @@ discard block |
||
| 471 | 479 | |
| 472 | 480 | /** |
| 473 | 481 | * Remove admin icon |
| 474 | - * @return object|void |
|
| 482 | + * @return BaseObject|null |
|
| 475 | 483 | */ |
| 476 | 484 | function procAdminRemoveIcons() |
| 477 | 485 | { |
@@ -181,8 +181,7 @@ discard block |
||
| 181 | 181 | if(is_readable($siteDesignFile)) |
| 182 | 182 | { |
| 183 | 183 | include($siteDesignFile); |
| 184 | - } |
|
| 185 | - else |
|
| 184 | + } else |
|
| 186 | 185 | { |
| 187 | 186 | $designInfo = new stdClass(); |
| 188 | 187 | } |
@@ -198,7 +197,9 @@ discard block |
||
| 198 | 197 | $moduleName = 'page'; |
| 199 | 198 | } |
| 200 | 199 | |
| 201 | - if(!isset($designInfo->module->{$moduleName})) $designInfo->module->{$moduleName} = new stdClass(); |
|
| 200 | + if(!isset($designInfo->module->{$moduleName})) { |
|
| 201 | + $designInfo->module->{$moduleName} = new stdClass(); |
|
| 202 | + } |
|
| 202 | 203 | $designInfo->module->{$moduleName}->{$skinTarget} = $skinName; |
| 203 | 204 | } |
| 204 | 205 | |
@@ -337,8 +338,7 @@ discard block |
||
| 337 | 338 | if($isAgree == 'true') |
| 338 | 339 | { |
| 339 | 340 | $_SESSION['enviroment_gather'] = 'Y'; |
| 340 | - } |
|
| 341 | - else |
|
| 341 | + } else |
|
| 342 | 342 | { |
| 343 | 343 | $_SESSION['enviroment_gather'] = 'N'; |
| 344 | 344 | } |
@@ -374,12 +374,10 @@ discard block |
||
| 374 | 374 | if($type == 3) |
| 375 | 375 | { |
| 376 | 376 | $ext = 'png'; |
| 377 | - } |
|
| 378 | - elseif($type == 2) |
|
| 377 | + } elseif($type == 2) |
|
| 379 | 378 | { |
| 380 | 379 | $ext = 'jpg'; |
| 381 | - } |
|
| 382 | - else |
|
| 380 | + } else |
|
| 383 | 381 | { |
| 384 | 382 | $ext = 'gif'; |
| 385 | 383 | } |
@@ -392,8 +390,7 @@ discard block |
||
| 392 | 390 | if($adminTitle) |
| 393 | 391 | { |
| 394 | 392 | $oAdminConfig->adminTitle = strip_tags($adminTitle); |
| 395 | - } |
|
| 396 | - else |
|
| 393 | + } else |
|
| 397 | 394 | { |
| 398 | 395 | unset($oAdminConfig->adminTitle); |
| 399 | 396 | } |
@@ -488,8 +485,7 @@ discard block |
||
| 488 | 485 | if($file_exist) |
| 489 | 486 | { |
| 490 | 487 | @FileHandler::removeFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname); |
| 491 | - } |
|
| 492 | - else |
|
| 488 | + } else |
|
| 493 | 489 | { |
| 494 | 490 | return new BaseObject(-1, 'fail_to_delete'); |
| 495 | 491 | } |
@@ -533,7 +529,9 @@ discard block |
||
| 533 | 529 | if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON'))) |
| 534 | 530 | { |
| 535 | 531 | $returnUrl = Context::get('success_return_url'); |
| 536 | - if(!$returnUrl) $returnUrl = getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral'); |
|
| 532 | + if(!$returnUrl) { |
|
| 533 | + $returnUrl = getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral'); |
|
| 534 | + } |
|
| 537 | 535 | header('location:' . $returnUrl); |
| 538 | 536 | return; |
| 539 | 537 | } |
@@ -577,7 +575,9 @@ discard block |
||
| 577 | 575 | if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON'))) |
| 578 | 576 | { |
| 579 | 577 | $returnUrl = Context::get('success_return_url'); |
| 580 | - if(!$returnUrl) $returnUrl = getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral'); |
|
| 578 | + if(!$returnUrl) { |
|
| 579 | + $returnUrl = getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral'); |
|
| 580 | + } |
|
| 581 | 581 | header('location:' . $returnUrl); |
| 582 | 582 | return; |
| 583 | 583 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | // forbit access if the user is not an administrator |
| 21 | 21 | $oMemberModel = getModel('member'); |
| 22 | 22 | $logged_info = $oMemberModel->getLoggedInfo(); |
| 23 | - if($logged_info->is_admin != 'Y') |
|
| 23 | + if ($logged_info->is_admin != 'Y') |
|
| 24 | 24 | { |
| 25 | 25 | return $this->stop("msg_is_not_administrator"); |
| 26 | 26 | } |
@@ -33,20 +33,20 @@ discard block |
||
| 33 | 33 | function procAdminMenuReset() |
| 34 | 34 | { |
| 35 | 35 | $menuSrl = Context::get('menu_srl'); |
| 36 | - if(!$menuSrl) |
|
| 36 | + if (!$menuSrl) |
|
| 37 | 37 | { |
| 38 | 38 | return $this->stop('msg_invalid_request'); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $oMenuAdminController = getAdminController('menu'); |
| 42 | 42 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
| 43 | - if($oCacheHandler->isSupport()) |
|
| 43 | + if ($oCacheHandler->isSupport()) |
|
| 44 | 44 | { |
| 45 | - $cache_key = 'admin_menu_langs:' . Context::getLangType(); |
|
| 45 | + $cache_key = 'admin_menu_langs:'.Context::getLangType(); |
|
| 46 | 46 | $oCacheHandler->delete($cache_key); |
| 47 | 47 | } |
| 48 | 48 | $output = $oMenuAdminController->deleteMenu($menuSrl); |
| 49 | - if(!$output->toBool()) |
|
| 49 | + if (!$output->toBool()) |
|
| 50 | 50 | { |
| 51 | 51 | return $output; |
| 52 | 52 | } |
@@ -63,27 +63,27 @@ discard block |
||
| 63 | 63 | function procAdminRecompileCacheFile() |
| 64 | 64 | { |
| 65 | 65 | // rename cache dir |
| 66 | - $temp_cache_dir = './files/cache_' . $_SERVER['REQUEST_TIME']; |
|
| 66 | + $temp_cache_dir = './files/cache_'.$_SERVER['REQUEST_TIME']; |
|
| 67 | 67 | FileHandler::rename('./files/cache', $temp_cache_dir); |
| 68 | 68 | FileHandler::makeDir('./files/cache'); |
| 69 | 69 | |
| 70 | 70 | // remove module extend cache |
| 71 | - FileHandler::removeFile(_XE_PATH_ . 'files/config/module_extend.php'); |
|
| 71 | + FileHandler::removeFile(_XE_PATH_.'files/config/module_extend.php'); |
|
| 72 | 72 | |
| 73 | 73 | // remove debug files |
| 74 | - FileHandler::removeFile(_XE_PATH_ . 'files/_debug_message.php'); |
|
| 75 | - FileHandler::removeFile(_XE_PATH_ . 'files/_debug_db_query.php'); |
|
| 76 | - FileHandler::removeFile(_XE_PATH_ . 'files/_db_slow_query.php'); |
|
| 74 | + FileHandler::removeFile(_XE_PATH_.'files/_debug_message.php'); |
|
| 75 | + FileHandler::removeFile(_XE_PATH_.'files/_debug_db_query.php'); |
|
| 76 | + FileHandler::removeFile(_XE_PATH_.'files/_db_slow_query.php'); |
|
| 77 | 77 | |
| 78 | 78 | $oModuleModel = getModel('module'); |
| 79 | 79 | $module_list = $oModuleModel->getModuleList(); |
| 80 | 80 | |
| 81 | 81 | // call recompileCache for each module |
| 82 | - foreach($module_list as $module) |
|
| 82 | + foreach ($module_list as $module) |
|
| 83 | 83 | { |
| 84 | 84 | $oModule = NULL; |
| 85 | 85 | $oModule = getClass($module->module); |
| 86 | - if(method_exists($oModule, 'recompileCache')) |
|
| 86 | + if (method_exists($oModule, 'recompileCache')) |
|
| 87 | 87 | { |
| 88 | 88 | $oModule->recompileCache(); |
| 89 | 89 | } |
@@ -94,37 +94,37 @@ discard block |
||
| 94 | 94 | $oObjectCacheHandler = CacheHandler::getInstance('object'); |
| 95 | 95 | $oTemplateCacheHandler = CacheHandler::getInstance('template'); |
| 96 | 96 | |
| 97 | - if($oObjectCacheHandler->isSupport()) |
|
| 97 | + if ($oObjectCacheHandler->isSupport()) |
|
| 98 | 98 | { |
| 99 | 99 | $truncated[] = $oObjectCacheHandler->truncate(); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - if($oTemplateCacheHandler->isSupport()) |
|
| 102 | + if ($oTemplateCacheHandler->isSupport()) |
|
| 103 | 103 | { |
| 104 | 104 | $truncated[] = $oTemplateCacheHandler->truncate(); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - if(count($truncated) && in_array(FALSE, $truncated)) |
|
| 107 | + if (count($truncated) && in_array(FALSE, $truncated)) |
|
| 108 | 108 | { |
| 109 | 109 | return new BaseObject(-1, 'msg_self_restart_cache_engine'); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | // remove cache dir |
| 113 | 113 | $tmp_cache_list = FileHandler::readDir('./files', '/(^cache_[0-9]+)/'); |
| 114 | - if($tmp_cache_list) |
|
| 114 | + if ($tmp_cache_list) |
|
| 115 | 115 | { |
| 116 | - foreach($tmp_cache_list as $tmp_dir) |
|
| 116 | + foreach ($tmp_cache_list as $tmp_dir) |
|
| 117 | 117 | { |
| 118 | - if($tmp_dir) |
|
| 118 | + if ($tmp_dir) |
|
| 119 | 119 | { |
| 120 | - FileHandler::removeDir('./files/' . $tmp_dir); |
|
| 120 | + FileHandler::removeDir('./files/'.$tmp_dir); |
|
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | // remove duplicate indexes (only for CUBRID) |
| 126 | 126 | $db_type = Context::getDBType(); |
| 127 | - if($db_type == 'cubrid') |
|
| 127 | + if ($db_type == 'cubrid') |
|
| 128 | 128 | { |
| 129 | 129 | $db = DB::getInstance(); |
| 130 | 130 | $db->deleteDuplicateIndexes(); |
@@ -146,13 +146,13 @@ discard block |
||
| 146 | 146 | $oMemberController = getController('member'); |
| 147 | 147 | $oMemberController->procMemberLogout(); |
| 148 | 148 | |
| 149 | - header('Location: ' . getNotEncodedUrl('', 'module', 'admin')); |
|
| 149 | + header('Location: '.getNotEncodedUrl('', 'module', 'admin')); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | public function procAdminInsertDefaultDesignInfo() |
| 153 | 153 | { |
| 154 | 154 | $vars = Context::getRequestVars(); |
| 155 | - if(!$vars->site_srl) |
|
| 155 | + if (!$vars->site_srl) |
|
| 156 | 156 | { |
| 157 | 157 | $vars->site_srl = 0; |
| 158 | 158 | } |
@@ -164,27 +164,27 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | public function updateDefaultDesignInfo($vars) |
| 166 | 166 | { |
| 167 | - $siteDesignPath = _XE_PATH_ . 'files/site_design/'; |
|
| 167 | + $siteDesignPath = _XE_PATH_.'files/site_design/'; |
|
| 168 | 168 | |
| 169 | 169 | $vars->module_skin = json_decode($vars->module_skin); |
| 170 | 170 | |
| 171 | - if(!is_dir($siteDesignPath)) |
|
| 171 | + if (!is_dir($siteDesignPath)) |
|
| 172 | 172 | { |
| 173 | 173 | FileHandler::makeDir($siteDesignPath); |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - $siteDesignFile = _XE_PATH_ . 'files/site_design/design_' . $vars->site_srl . '.php'; |
|
| 176 | + $siteDesignFile = _XE_PATH_.'files/site_design/design_'.$vars->site_srl.'.php'; |
|
| 177 | 177 | |
| 178 | 178 | $layoutTarget = 'layout_srl'; |
| 179 | 179 | $skinTarget = 'skin'; |
| 180 | 180 | |
| 181 | - if($vars->target_type == 'M') |
|
| 181 | + if ($vars->target_type == 'M') |
|
| 182 | 182 | { |
| 183 | 183 | $layoutTarget = 'mlayout_srl'; |
| 184 | 184 | $skinTarget = 'mskin'; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - if(is_readable($siteDesignFile)) |
|
| 187 | + if (is_readable($siteDesignFile)) |
|
| 188 | 188 | { |
| 189 | 189 | include($siteDesignFile); |
| 190 | 190 | } |
@@ -197,14 +197,14 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | $designInfo->{$layoutTarget} = $layoutSrl; |
| 199 | 199 | |
| 200 | - foreach($vars->module_skin as $moduleName => $skinName) |
|
| 200 | + foreach ($vars->module_skin as $moduleName => $skinName) |
|
| 201 | 201 | { |
| 202 | - if($moduleName == 'ARTICLE') |
|
| 202 | + if ($moduleName == 'ARTICLE') |
|
| 203 | 203 | { |
| 204 | 204 | $moduleName = 'page'; |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | - if(!isset($designInfo->module->{$moduleName})) $designInfo->module->{$moduleName} = new stdClass(); |
|
| 207 | + if (!isset($designInfo->module->{$moduleName})) $designInfo->module->{$moduleName} = new stdClass(); |
|
| 208 | 208 | $designInfo->module->{$moduleName}->{$skinTarget} = $skinName; |
| 209 | 209 | } |
| 210 | 210 | |
@@ -219,28 +219,28 @@ discard block |
||
| 219 | 219 | $buff[] = '<?php if(!defined("__XE__")) exit();'; |
| 220 | 220 | $buff[] = '$designInfo = new stdClass;'; |
| 221 | 221 | |
| 222 | - if($designInfo->layout_srl) |
|
| 222 | + if ($designInfo->layout_srl) |
|
| 223 | 223 | { |
| 224 | 224 | $buff[] = sprintf('$designInfo->layout_srl = %s; ', $designInfo->layout_srl); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - if($designInfo->mlayout_srl) |
|
| 227 | + if ($designInfo->mlayout_srl) |
|
| 228 | 228 | { |
| 229 | 229 | $buff[] = sprintf('$designInfo->mlayout_srl = %s;', $designInfo->mlayout_srl); |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | $buff[] = '$designInfo->module = new stdClass;'; |
| 233 | 233 | |
| 234 | - foreach($designInfo->module as $moduleName => $skinInfo) |
|
| 234 | + foreach ($designInfo->module as $moduleName => $skinInfo) |
|
| 235 | 235 | { |
| 236 | 236 | $buff[] = sprintf('$designInfo->module->%s = new stdClass;', $moduleName); |
| 237 | - foreach($skinInfo as $target => $skinName) |
|
| 237 | + foreach ($skinInfo as $target => $skinName) |
|
| 238 | 238 | { |
| 239 | 239 | $buff[] = sprintf('$designInfo->module->%s->%s = \'%s\';', $moduleName, $target, $skinName); |
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - $siteDesignFile = _XE_PATH_ . 'files/site_design/design_' . $site_srl . '.php'; |
|
| 243 | + $siteDesignFile = _XE_PATH_.'files/site_design/design_'.$site_srl.'.php'; |
|
| 244 | 244 | FileHandler::writeFile($siteDesignFile, implode(PHP_EOL, $buff)); |
| 245 | 245 | } |
| 246 | 246 | |
@@ -256,13 +256,13 @@ discard block |
||
| 256 | 256 | // check favorite exists |
| 257 | 257 | $oModel = getAdminModel('admin'); |
| 258 | 258 | $output = $oModel->isExistsFavorite($siteSrl, $moduleName); |
| 259 | - if(!$output->toBool()) |
|
| 259 | + if (!$output->toBool()) |
|
| 260 | 260 | { |
| 261 | 261 | return $output; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | // if exists, delete favorite |
| 265 | - if($output->get('result')) |
|
| 265 | + if ($output->get('result')) |
|
| 266 | 266 | { |
| 267 | 267 | $favoriteSrl = $output->get('favoriteSrl'); |
| 268 | 268 | $output = $this->_deleteFavorite($favoriteSrl); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | $result = 'on'; |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - if(!$output->toBool()) |
|
| 278 | + if (!$output->toBool()) |
|
| 279 | 279 | { |
| 280 | 280 | return $output; |
| 281 | 281 | } |
@@ -293,31 +293,31 @@ discard block |
||
| 293 | 293 | { |
| 294 | 294 | $oModel = getAdminModel('admin'); |
| 295 | 295 | $output = $oModel->getFavoriteList(); |
| 296 | - if(!$output->toBool()) |
|
| 296 | + if (!$output->toBool()) |
|
| 297 | 297 | { |
| 298 | 298 | return $output; |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | $favoriteList = $output->get('favoriteList'); |
| 302 | - if(!$favoriteList) |
|
| 302 | + if (!$favoriteList) |
|
| 303 | 303 | { |
| 304 | 304 | return new BaseObject(); |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | $deleteTargets = array(); |
| 308 | - foreach($favoriteList as $favorite) |
|
| 308 | + foreach ($favoriteList as $favorite) |
|
| 309 | 309 | { |
| 310 | - if($favorite->type == 'module') |
|
| 310 | + if ($favorite->type == 'module') |
|
| 311 | 311 | { |
| 312 | - $modulePath = _XE_PATH_ . 'modules/' . $favorite->module; |
|
| 313 | - if(!is_dir($modulePath)) |
|
| 312 | + $modulePath = _XE_PATH_.'modules/'.$favorite->module; |
|
| 313 | + if (!is_dir($modulePath)) |
|
| 314 | 314 | { |
| 315 | 315 | $deleteTargets[] = $favorite->admin_favorite_srl; |
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - if(!count($deleteTargets)) |
|
| 320 | + if (!count($deleteTargets)) |
|
| 321 | 321 | { |
| 322 | 322 | return new BaseObject(); |
| 323 | 323 | } |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | $args = new stdClass(); |
| 326 | 326 | $args->admin_favorite_srls = $deleteTargets; |
| 327 | 327 | $output = executeQuery('admin.deleteFavorites', $args); |
| 328 | - if(!$output->toBool()) |
|
| 328 | + if (!$output->toBool()) |
|
| 329 | 329 | { |
| 330 | 330 | return $output; |
| 331 | 331 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | function procAdminEnviromentGatheringAgreement() |
| 341 | 341 | { |
| 342 | 342 | $isAgree = Context::get('is_agree'); |
| 343 | - if($isAgree == 'true') |
|
| 343 | + if ($isAgree == 'true') |
|
| 344 | 344 | { |
| 345 | 345 | $_SESSION['enviroment_gather'] = 'Y'; |
| 346 | 346 | } |
@@ -365,23 +365,23 @@ discard block |
||
| 365 | 365 | $oModuleModel = getModel('module'); |
| 366 | 366 | $oAdminConfig = $oModuleModel->getModuleConfig('admin'); |
| 367 | 367 | |
| 368 | - if(!is_object($oAdminConfig)) |
|
| 368 | + if (!is_object($oAdminConfig)) |
|
| 369 | 369 | { |
| 370 | 370 | $oAdminConfig = new stdClass(); |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | - if($file['tmp_name']) |
|
| 373 | + if ($file['tmp_name']) |
|
| 374 | 374 | { |
| 375 | 375 | $target_path = 'files/attach/images/admin/'; |
| 376 | 376 | FileHandler::makeDir($target_path); |
| 377 | 377 | |
| 378 | 378 | // Get file information |
| 379 | 379 | list($width, $height, $type, $attrs) = @getimagesize($file['tmp_name']); |
| 380 | - if($type == 3) |
|
| 380 | + if ($type == 3) |
|
| 381 | 381 | { |
| 382 | 382 | $ext = 'png'; |
| 383 | 383 | } |
| 384 | - elseif($type == 2) |
|
| 384 | + elseif ($type == 2) |
|
| 385 | 385 | { |
| 386 | 386 | $ext = 'jpg'; |
| 387 | 387 | } |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | |
| 396 | 396 | $oAdminConfig->adminLogo = $target_filename; |
| 397 | 397 | } |
| 398 | - if($adminTitle) |
|
| 398 | + if ($adminTitle) |
|
| 399 | 399 | { |
| 400 | 400 | $oAdminConfig->adminTitle = strip_tags($adminTitle); |
| 401 | 401 | } |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | unset($oAdminConfig->adminTitle); |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | - if($oAdminConfig) |
|
| 407 | + if ($oAdminConfig) |
|
| 408 | 408 | { |
| 409 | 409 | $oModuleController = getController('module'); |
| 410 | 410 | $oModuleController->insertModuleConfig('admin', $oAdminConfig); |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | $oModuleModel = getModel('module'); |
| 426 | 426 | $oAdminConfig = $oModuleModel->getModuleConfig('admin'); |
| 427 | 427 | |
| 428 | - FileHandler::removeFile(_XE_PATH_ . $oAdminConfig->adminLogo); |
|
| 428 | + FileHandler::removeFile(_XE_PATH_.$oAdminConfig->adminLogo); |
|
| 429 | 429 | unset($oAdminConfig->adminLogo); |
| 430 | 430 | |
| 431 | 431 | $oModuleController = getController('module'); |
@@ -484,16 +484,16 @@ discard block |
||
| 484 | 484 | |
| 485 | 485 | $site_info = Context::get('site_module_info'); |
| 486 | 486 | $virtual_site = ''; |
| 487 | - if($site_info->site_srl) |
|
| 487 | + if ($site_info->site_srl) |
|
| 488 | 488 | { |
| 489 | - $virtual_site = $site_info->site_srl . '/'; |
|
| 489 | + $virtual_site = $site_info->site_srl.'/'; |
|
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 | $iconname = Context::get('iconname'); |
| 493 | - $file_exist = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname); |
|
| 494 | - if($file_exist) |
|
| 493 | + $file_exist = FileHandler::readFile(_XE_PATH_.'files/attach/xeicon/'.$virtual_site.$iconname); |
|
| 494 | + if ($file_exist) |
|
| 495 | 495 | { |
| 496 | - @FileHandler::removeFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname); |
|
| 496 | + @FileHandler::removeFile(_XE_PATH_.'files/attach/xeicon/'.$virtual_site.$iconname); |
|
| 497 | 497 | } |
| 498 | 498 | else |
| 499 | 499 | { |
@@ -514,33 +514,33 @@ discard block |
||
| 514 | 514 | $db_info->sitelock_message = $vars->sitelock_message; |
| 515 | 515 | |
| 516 | 516 | $whitelist = $vars->sitelock_whitelist; |
| 517 | - $whitelist = preg_replace("/[\r|\n|\r\n]+/",",",$whitelist); |
|
| 518 | - $whitelist = preg_replace("/\s+/","",$whitelist); |
|
| 519 | - if(preg_match('/(<\?|<\?php|\?>)/xsm', $whitelist)) |
|
| 517 | + $whitelist = preg_replace("/[\r|\n|\r\n]+/", ",", $whitelist); |
|
| 518 | + $whitelist = preg_replace("/\s+/", "", $whitelist); |
|
| 519 | + if (preg_match('/(<\?|<\?php|\?>)/xsm', $whitelist)) |
|
| 520 | 520 | { |
| 521 | 521 | $whitelist = ''; |
| 522 | 522 | } |
| 523 | - $whitelist .= ',127.0.0.1,' . $_SERVER['REMOTE_ADDR']; |
|
| 524 | - $whitelist = explode(',',trim($whitelist, ',')); |
|
| 523 | + $whitelist .= ',127.0.0.1,'.$_SERVER['REMOTE_ADDR']; |
|
| 524 | + $whitelist = explode(',', trim($whitelist, ',')); |
|
| 525 | 525 | $whitelist = array_unique($whitelist); |
| 526 | 526 | |
| 527 | - if(!IpFilter::validate($whitelist)) { |
|
| 527 | + if (!IpFilter::validate($whitelist)) { |
|
| 528 | 528 | return new BaseObject(-1, 'msg_invalid_ip'); |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | $db_info->sitelock_whitelist = $whitelist; |
| 532 | 532 | |
| 533 | 533 | $oInstallController = getController('install'); |
| 534 | - if(!$oInstallController->makeConfigFile()) |
|
| 534 | + if (!$oInstallController->makeConfigFile()) |
|
| 535 | 535 | { |
| 536 | 536 | return new BaseObject(-1, 'msg_invalid_request'); |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | - if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON'))) |
|
| 539 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 540 | 540 | { |
| 541 | 541 | $returnUrl = Context::get('success_return_url'); |
| 542 | - if(!$returnUrl) $returnUrl = getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral'); |
|
| 543 | - header('location:' . $returnUrl); |
|
| 542 | + if (!$returnUrl) $returnUrl = getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral'); |
|
| 543 | + header('location:'.$returnUrl); |
|
| 544 | 544 | return; |
| 545 | 545 | } |
| 546 | 546 | } |
@@ -571,20 +571,20 @@ discard block |
||
| 571 | 571 | $db_info->embed_white_iframe = $white_iframe; |
| 572 | 572 | |
| 573 | 573 | $oInstallController = getController('install'); |
| 574 | - if(!$oInstallController->makeConfigFile()) |
|
| 574 | + if (!$oInstallController->makeConfigFile()) |
|
| 575 | 575 | { |
| 576 | 576 | return new BaseObject(-1, 'msg_invalid_request'); |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | - require_once(_XE_PATH_ . 'classes/security/EmbedFilter.class.php'); |
|
| 579 | + require_once(_XE_PATH_.'classes/security/EmbedFilter.class.php'); |
|
| 580 | 580 | $oEmbedFilter = EmbedFilter::getInstance(); |
| 581 | 581 | $oEmbedFilter->_makeWhiteDomainList($whitelist); |
| 582 | 582 | |
| 583 | - if(!in_array(Context::getRequestMethod(), array('XMLRPC','JSON'))) |
|
| 583 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 584 | 584 | { |
| 585 | 585 | $returnUrl = Context::get('success_return_url'); |
| 586 | - if(!$returnUrl) $returnUrl = getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral'); |
|
| 587 | - header('location:' . $returnUrl); |
|
| 586 | + if (!$returnUrl) $returnUrl = getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral'); |
|
| 587 | + header('location:'.$returnUrl); |
|
| 588 | 588 | return; |
| 589 | 589 | } |
| 590 | 590 | } |
@@ -867,6 +867,7 @@ discard block |
||
| 867 | 867 | * Returns a list of all sites that contain modules |
| 868 | 868 | * For each site domain and site_srl are retrieved |
| 869 | 869 | * |
| 870 | + * @param string $domain |
|
| 870 | 871 | * @return array |
| 871 | 872 | */ |
| 872 | 873 | function getAllSitesThatHaveModules($domain = NULL) |
@@ -945,6 +946,11 @@ discard block |
||
| 945 | 946 | return $this->iconUrlCheck('mobicon.png', 'mobiconSample.png', $default); |
| 946 | 947 | } |
| 947 | 948 | |
| 949 | + /** |
|
| 950 | + * @param string $iconname |
|
| 951 | + * @param string $default_icon_name |
|
| 952 | + * @param boolean $default |
|
| 953 | + */ |
|
| 948 | 954 | function iconUrlCheck($iconname, $default_icon_name, $default) |
| 949 | 955 | { |
| 950 | 956 | $site_info = Context::get('site_module_info'); |
@@ -30,18 +30,18 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $ftp_info = Context::getRequestVars(); |
| 32 | 32 | |
| 33 | - if(!$ftp_info->ftp_host) |
|
| 33 | + if (!$ftp_info->ftp_host) |
|
| 34 | 34 | { |
| 35 | 35 | $ftp_info->ftp_host = "127.0.0.1"; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
| 38 | + if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
| 39 | 39 | { |
| 40 | 40 | $ftp_info->ftp_port = '22'; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port); |
| 44 | - if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
| 44 | + if (!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
| 45 | 45 | { |
| 46 | 46 | return new BaseObject(-1, 'msg_ftp_invalid_auth_info'); |
| 47 | 47 | } |
@@ -58,29 +58,29 @@ discard block |
||
| 58 | 58 | $path_candidate = array(); |
| 59 | 59 | |
| 60 | 60 | $temp = ''; |
| 61 | - foreach($path_info as $path) |
|
| 61 | + foreach ($path_info as $path) |
|
| 62 | 62 | { |
| 63 | - $temp = '/' . $path . $temp; |
|
| 63 | + $temp = '/'.$path.$temp; |
|
| 64 | 64 | $path_candidate[] = $temp; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | // try |
| 68 | - foreach($path_candidate as $path) |
|
| 68 | + foreach ($path_candidate as $path) |
|
| 69 | 69 | { |
| 70 | 70 | // upload check file |
| 71 | - if(!@ssh2_scp_send($connection, FileHandler::getRealPath('./files/cache/ftp_check'), $path . 'ftp_check.html')) |
|
| 71 | + if (!@ssh2_scp_send($connection, FileHandler::getRealPath('./files/cache/ftp_check'), $path.'ftp_check.html')) |
|
| 72 | 72 | { |
| 73 | 73 | continue; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // get check file |
| 77 | - $result = FileHandler::getRemoteResource(getNotencodedFullUrl() . 'ftp_check.html'); |
|
| 77 | + $result = FileHandler::getRemoteResource(getNotencodedFullUrl().'ftp_check.html'); |
|
| 78 | 78 | |
| 79 | 79 | // delete temp check file |
| 80 | - @ssh2_sftp_unlink($sftp, $path . 'ftp_check.html'); |
|
| 80 | + @ssh2_sftp_unlink($sftp, $path.'ftp_check.html'); |
|
| 81 | 81 | |
| 82 | 82 | // found |
| 83 | - if($result == $pin) |
|
| 83 | + if ($result == $pin) |
|
| 84 | 84 | { |
| 85 | 85 | $found_path = $path; |
| 86 | 86 | break; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | FileHandler::removeFile('./files/cache/ftp_check', $pin); |
| 91 | 91 | |
| 92 | - if($found_path) |
|
| 92 | + if ($found_path) |
|
| 93 | 93 | { |
| 94 | 94 | $this->add('found_path', $found_path); |
| 95 | 95 | } |
@@ -99,24 +99,24 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | $ftp_info = Context::getRequestVars(); |
| 101 | 101 | |
| 102 | - if(!$ftp_info->ftp_host) |
|
| 102 | + if (!$ftp_info->ftp_host) |
|
| 103 | 103 | { |
| 104 | 104 | $ftp_info->ftp_host = "127.0.0.1"; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
| 107 | + if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
| 108 | 108 | { |
| 109 | 109 | $ftp_info->ftp_port = '22'; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | $connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port); |
| 113 | - if(!$connection) |
|
| 113 | + if (!$connection) |
|
| 114 | 114 | { |
| 115 | 115 | return new BaseObject(-1, sprintf(Context::getLang('msg_ftp_not_connected'), 'host')); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $login_result = @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password); |
| 119 | - if(!$login_result) |
|
| 119 | + if (!$login_result) |
|
| 120 | 120 | { |
| 121 | 121 | ftp_close($connection); |
| 122 | 122 | return new BaseObject(-1, 'msg_ftp_invalid_auth_info'); |
@@ -133,29 +133,29 @@ discard block |
||
| 133 | 133 | $path_candidate = array(); |
| 134 | 134 | |
| 135 | 135 | $temp = ''; |
| 136 | - foreach($path_info as $path) |
|
| 136 | + foreach ($path_info as $path) |
|
| 137 | 137 | { |
| 138 | - $temp = '/' . $path . $temp; |
|
| 138 | + $temp = '/'.$path.$temp; |
|
| 139 | 139 | $path_candidate[] = $temp; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | // try |
| 143 | - foreach($path_candidate as $path) |
|
| 143 | + foreach ($path_candidate as $path) |
|
| 144 | 144 | { |
| 145 | 145 | // upload check file |
| 146 | - if(!ftp_put($connection, $path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'), FTP_BINARY)) |
|
| 146 | + if (!ftp_put($connection, $path.'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'), FTP_BINARY)) |
|
| 147 | 147 | { |
| 148 | 148 | continue; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // get check file |
| 152 | - $result = FileHandler::getRemoteResource(getNotencodedFullUrl() . 'ftp_check.html'); |
|
| 152 | + $result = FileHandler::getRemoteResource(getNotencodedFullUrl().'ftp_check.html'); |
|
| 153 | 153 | |
| 154 | 154 | // delete temp check file |
| 155 | - ftp_delete($connection, $path . 'ftp_check.html'); |
|
| 155 | + ftp_delete($connection, $path.'ftp_check.html'); |
|
| 156 | 156 | |
| 157 | 157 | // found |
| 158 | - if($result == $pin) |
|
| 158 | + if ($result == $pin) |
|
| 159 | 159 | { |
| 160 | 160 | $found_path = $path; |
| 161 | 161 | break; |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | FileHandler::removeFile('./files/cache/ftp_check', $pin); |
| 166 | 166 | |
| 167 | - if($found_path) |
|
| 167 | + if ($found_path) |
|
| 168 | 168 | { |
| 169 | 169 | $this->add('found_path', $found_path); |
| 170 | 170 | } |
@@ -175,39 +175,39 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | function getAdminFTPPath() |
| 177 | 177 | { |
| 178 | - Context::loadLang(_XE_PATH_ . 'modules/autoinstall/lang'); |
|
| 178 | + Context::loadLang(_XE_PATH_.'modules/autoinstall/lang'); |
|
| 179 | 179 | @set_time_limit(5); |
| 180 | - require_once(_XE_PATH_ . 'libs/ftp.class.php'); |
|
| 180 | + require_once(_XE_PATH_.'libs/ftp.class.php'); |
|
| 181 | 181 | |
| 182 | 182 | $ftp_info = Context::getRequestVars(); |
| 183 | 183 | |
| 184 | - if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) |
|
| 184 | + if (!$ftp_info->ftp_user || !$ftp_info->ftp_password) |
|
| 185 | 185 | { |
| 186 | 186 | return new BaseObject(1, 'msg_ftp_invalid_auth_info'); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - if(!$ftp_info->ftp_host) |
|
| 189 | + if (!$ftp_info->ftp_host) |
|
| 190 | 190 | { |
| 191 | 191 | $ftp_info->ftp_host = '127.0.0.1'; |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | - if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
| 194 | + if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
| 195 | 195 | { |
| 196 | 196 | $ftp_info->ftp_port = '21'; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - if($ftp_info->sftp == 'Y') |
|
| 199 | + if ($ftp_info->sftp == 'Y') |
|
| 200 | 200 | { |
| 201 | - if(!function_exists('ssh2_sftp')) |
|
| 201 | + if (!function_exists('ssh2_sftp')) |
|
| 202 | 202 | { |
| 203 | 203 | return new BaseObject(-1, 'disable_sftp_support'); |
| 204 | 204 | } |
| 205 | 205 | return $this->getSFTPPath(); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - if($ftp_info->ftp_pasv == 'N') |
|
| 208 | + if ($ftp_info->ftp_pasv == 'N') |
|
| 209 | 209 | { |
| 210 | - if(function_exists('ftp_connect')) |
|
| 210 | + if (function_exists('ftp_connect')) |
|
| 211 | 211 | { |
| 212 | 212 | return $this->getFTPPath(); |
| 213 | 213 | } |
@@ -215,12 +215,12 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | $oFTP = new ftp(); |
| 218 | - if(!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) |
|
| 218 | + if (!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) |
|
| 219 | 219 | { |
| 220 | 220 | return new BaseObject(1, sprintf(Context::getLang('msg_ftp_not_connected'), 'host')); |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - if(!$oFTP->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
| 223 | + if (!$oFTP->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
| 224 | 224 | { |
| 225 | 225 | return new BaseObject(1, 'msg_ftp_invalid_auth_info'); |
| 226 | 226 | } |
@@ -236,29 +236,29 @@ discard block |
||
| 236 | 236 | $path_candidate = array(); |
| 237 | 237 | |
| 238 | 238 | $temp = ''; |
| 239 | - foreach($path_info as $path) |
|
| 239 | + foreach ($path_info as $path) |
|
| 240 | 240 | { |
| 241 | - $temp = '/' . $path . $temp; |
|
| 241 | + $temp = '/'.$path.$temp; |
|
| 242 | 242 | $path_candidate[] = $temp; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | // try |
| 246 | - foreach($path_candidate as $path) |
|
| 246 | + foreach ($path_candidate as $path) |
|
| 247 | 247 | { |
| 248 | 248 | // upload check file |
| 249 | - if(!$oFTP->ftp_put($path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'))) |
|
| 249 | + if (!$oFTP->ftp_put($path.'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'))) |
|
| 250 | 250 | { |
| 251 | 251 | continue; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | // get check file |
| 255 | - $result = FileHandler::getRemoteResource(getNotencodedFullUrl() . 'ftp_check.html'); |
|
| 255 | + $result = FileHandler::getRemoteResource(getNotencodedFullUrl().'ftp_check.html'); |
|
| 256 | 256 | |
| 257 | 257 | // delete temp check file |
| 258 | - $oFTP->ftp_delete($path . 'ftp_check.html'); |
|
| 258 | + $oFTP->ftp_delete($path.'ftp_check.html'); |
|
| 259 | 259 | |
| 260 | 260 | // found |
| 261 | - if($result == $pin) |
|
| 261 | + if ($result == $pin) |
|
| 262 | 262 | { |
| 263 | 263 | $found_path = $path; |
| 264 | 264 | break; |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | FileHandler::removeFile('./files/cache/ftp_check', $pin); |
| 269 | 269 | |
| 270 | - if($found_path) |
|
| 270 | + if ($found_path) |
|
| 271 | 271 | { |
| 272 | 272 | $this->add('found_path', $found_path); |
| 273 | 273 | } |
@@ -280,27 +280,27 @@ discard block |
||
| 280 | 280 | function getSFTPList() |
| 281 | 281 | { |
| 282 | 282 | $ftp_info = Context::getRequestVars(); |
| 283 | - if(!$ftp_info->ftp_host) |
|
| 283 | + if (!$ftp_info->ftp_host) |
|
| 284 | 284 | { |
| 285 | 285 | $ftp_info->ftp_host = "127.0.0.1"; |
| 286 | 286 | } |
| 287 | 287 | $connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port); |
| 288 | - if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
| 288 | + if (!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
| 289 | 289 | { |
| 290 | 290 | return new BaseObject(-1, 'msg_ftp_invalid_auth_info'); |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | $sftp = ssh2_sftp($connection); |
| 294 | - $curpwd = "ssh2.sftp://$sftp" . $this->pwd; |
|
| 294 | + $curpwd = "ssh2.sftp://$sftp".$this->pwd; |
|
| 295 | 295 | $dh = @opendir($curpwd); |
| 296 | - if(!$dh) |
|
| 296 | + if (!$dh) |
|
| 297 | 297 | { |
| 298 | 298 | return new BaseObject(-1, 'msg_ftp_invalid_path'); |
| 299 | 299 | } |
| 300 | 300 | $list = array(); |
| 301 | - while(($file = readdir($dh)) !== FALSE) |
|
| 301 | + while (($file = readdir($dh)) !== FALSE) |
|
| 302 | 302 | { |
| 303 | - if(is_dir($curpwd . $file)) |
|
| 303 | + if (is_dir($curpwd.$file)) |
|
| 304 | 304 | { |
| 305 | 305 | $file .= "/"; |
| 306 | 306 | } |
@@ -320,32 +320,32 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | function getAdminFTPList() |
| 322 | 322 | { |
| 323 | - Context::loadLang(_XE_PATH_ . 'modules/autoinstall/lang'); |
|
| 323 | + Context::loadLang(_XE_PATH_.'modules/autoinstall/lang'); |
|
| 324 | 324 | @set_time_limit(5); |
| 325 | 325 | |
| 326 | - require_once(_XE_PATH_ . 'libs/ftp.class.php'); |
|
| 326 | + require_once(_XE_PATH_.'libs/ftp.class.php'); |
|
| 327 | 327 | |
| 328 | 328 | $ftp_info = Context::getRequestVars(); |
| 329 | - if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) |
|
| 329 | + if (!$ftp_info->ftp_user || !$ftp_info->ftp_password) |
|
| 330 | 330 | { |
| 331 | 331 | return new BaseObject(-1, 'msg_ftp_invalid_auth_info'); |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | $this->pwd = $ftp_info->ftp_root_path; |
| 335 | 335 | |
| 336 | - if(!$ftp_info->ftp_host) |
|
| 336 | + if (!$ftp_info->ftp_host) |
|
| 337 | 337 | { |
| 338 | 338 | $ftp_info->ftp_host = "127.0.0.1"; |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
| 341 | + if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) |
|
| 342 | 342 | { |
| 343 | 343 | $ftp_info->ftp_port = "21"; |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | - if($ftp_info->sftp == 'Y') |
|
| 346 | + if ($ftp_info->sftp == 'Y') |
|
| 347 | 347 | { |
| 348 | - if(!function_exists('ssh2_sftp')) |
|
| 348 | + if (!function_exists('ssh2_sftp')) |
|
| 349 | 349 | { |
| 350 | 350 | return new BaseObject(-1, 'disable_sftp_support'); |
| 351 | 351 | } |
@@ -353,9 +353,9 @@ discard block |
||
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | $oFtp = new ftp(); |
| 356 | - if($oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) |
|
| 356 | + if ($oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) |
|
| 357 | 357 | { |
| 358 | - if($oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
| 358 | + if ($oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
| 359 | 359 | { |
| 360 | 360 | $_list = $oFtp->ftp_rawlist($this->pwd); |
| 361 | 361 | $oFtp->ftp_quit(); |
@@ -367,17 +367,17 @@ discard block |
||
| 367 | 367 | } |
| 368 | 368 | $list = array(); |
| 369 | 369 | |
| 370 | - if($_list) |
|
| 370 | + if ($_list) |
|
| 371 | 371 | { |
| 372 | - foreach($_list as $k => $v) |
|
| 372 | + foreach ($_list as $k => $v) |
|
| 373 | 373 | { |
| 374 | 374 | $src = new stdClass(); |
| 375 | 375 | $src->data = $v; |
| 376 | 376 | $res = Context::convertEncoding($src); |
| 377 | 377 | $v = $res->data; |
| 378 | - if(strpos($v, 'd') === 0 || strpos($v, '<DIR>')) |
|
| 378 | + if (strpos($v, 'd') === 0 || strpos($v, '<DIR>')) |
|
| 379 | 379 | { |
| 380 | - $list[] = substr(strrchr($v, ' '), 1) . '/'; |
|
| 380 | + $list[] = substr(strrchr($v, ' '), 1).'/'; |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | , 'module' => array('addon', 'admin', 'autoinstall', 'comment', 'communication', 'counter', 'document', 'editor', 'file', 'importer', 'install', 'integration_search', 'layout', 'member', 'menu', 'message', 'module', 'opage', 'page', 'point', 'poll', 'rss', 'session', 'spamfilter', 'tag', 'trackback', 'trash', 'widget') |
| 401 | 401 | , 'addon' => array('autolink', 'blogapi', 'captcha', 'counter', 'member_communication', 'member_extra_info', 'mobile', 'openid_delegation_id', 'point_level_icon', 'resize_image') |
| 402 | 402 | , 'layout' => array('default') |
| 403 | - , 'widget' => array('content', 'language_select', 'login_info','mcontent') |
|
| 403 | + , 'widget' => array('content', 'language_select', 'login_info', 'mcontent') |
|
| 404 | 404 | , 'widgetstyle' => array(), |
| 405 | 405 | ); |
| 406 | 406 | $info = array(); |
@@ -420,86 +420,86 @@ discard block |
||
| 420 | 420 | $info['use_ssl'] = $db_info->use_ssl; |
| 421 | 421 | |
| 422 | 422 | $info['phpext'] = ''; |
| 423 | - foreach(get_loaded_extensions() as $ext) |
|
| 423 | + foreach (get_loaded_extensions() as $ext) |
|
| 424 | 424 | { |
| 425 | 425 | $ext = strtolower($ext); |
| 426 | - if(in_array($ext, $skip['ext'])) |
|
| 426 | + if (in_array($ext, $skip['ext'])) |
|
| 427 | 427 | { |
| 428 | 428 | continue; |
| 429 | 429 | } |
| 430 | - $info['phpext'] .= '|' . $ext; |
|
| 430 | + $info['phpext'] .= '|'.$ext; |
|
| 431 | 431 | } |
| 432 | 432 | $info['phpext'] = substr($info['phpext'], 1); |
| 433 | 433 | |
| 434 | 434 | $info['module'] = ''; |
| 435 | 435 | $oModuleModel = getModel('module'); |
| 436 | 436 | $module_list = $oModuleModel->getModuleList(); |
| 437 | - if($module_list) foreach($module_list as $module) |
|
| 437 | + if ($module_list) foreach ($module_list as $module) |
|
| 438 | 438 | { |
| 439 | - if(in_array($module->module, $skip['module'])) |
|
| 439 | + if (in_array($module->module, $skip['module'])) |
|
| 440 | 440 | { |
| 441 | 441 | continue; |
| 442 | 442 | } |
| 443 | - $info['module'] .= '|' . $module->module; |
|
| 443 | + $info['module'] .= '|'.$module->module; |
|
| 444 | 444 | } |
| 445 | 445 | $info['module'] = substr($info['module'], 1); |
| 446 | 446 | |
| 447 | 447 | $info['addon'] = ''; |
| 448 | 448 | $oAddonAdminModel = getAdminModel('addon'); |
| 449 | 449 | $addon_list = $oAddonAdminModel->getAddonList(); |
| 450 | - if($addon_list) foreach($addon_list as $addon) |
|
| 450 | + if ($addon_list) foreach ($addon_list as $addon) |
|
| 451 | 451 | { |
| 452 | - if(in_array($addon->addon, $skip['addon'])) |
|
| 452 | + if (in_array($addon->addon, $skip['addon'])) |
|
| 453 | 453 | { |
| 454 | 454 | continue; |
| 455 | 455 | } |
| 456 | - $info['addon'] .= '|' . $addon->addon; |
|
| 456 | + $info['addon'] .= '|'.$addon->addon; |
|
| 457 | 457 | } |
| 458 | 458 | $info['addon'] = substr($info['addon'], 1); |
| 459 | 459 | |
| 460 | 460 | $info['layout'] = ""; |
| 461 | 461 | $oLayoutModel = getModel('layout'); |
| 462 | 462 | $layout_list = $oLayoutModel->getDownloadedLayoutList(); |
| 463 | - if($layout_list) foreach($layout_list as $layout) |
|
| 463 | + if ($layout_list) foreach ($layout_list as $layout) |
|
| 464 | 464 | { |
| 465 | - if(in_array($layout->layout, $skip['layout'])) |
|
| 465 | + if (in_array($layout->layout, $skip['layout'])) |
|
| 466 | 466 | { |
| 467 | 467 | continue; |
| 468 | 468 | } |
| 469 | - $info['layout'] .= '|' . $layout->layout; |
|
| 469 | + $info['layout'] .= '|'.$layout->layout; |
|
| 470 | 470 | } |
| 471 | 471 | $info['layout'] = substr($info['layout'], 1); |
| 472 | 472 | |
| 473 | 473 | $info['widget'] = ""; |
| 474 | 474 | $oWidgetModel = getModel('widget'); |
| 475 | 475 | $widget_list = $oWidgetModel->getDownloadedWidgetList(); |
| 476 | - if($widget_list) foreach($widget_list as $widget) |
|
| 476 | + if ($widget_list) foreach ($widget_list as $widget) |
|
| 477 | 477 | { |
| 478 | - if(in_array($widget->widget, $skip['widget'])) |
|
| 478 | + if (in_array($widget->widget, $skip['widget'])) |
|
| 479 | 479 | { |
| 480 | 480 | continue; |
| 481 | 481 | } |
| 482 | - $info['widget'] .= '|' . $widget->widget; |
|
| 482 | + $info['widget'] .= '|'.$widget->widget; |
|
| 483 | 483 | } |
| 484 | 484 | $info['widget'] = substr($info['widget'], 1); |
| 485 | 485 | |
| 486 | 486 | $info['widgetstyle'] = ""; |
| 487 | 487 | $oWidgetModel = getModel('widget'); |
| 488 | 488 | $widgetstyle_list = $oWidgetModel->getDownloadedWidgetStyleList(); |
| 489 | - if($widgetstyle_list) foreach($widgetstyle_list as $widgetstyle) |
|
| 489 | + if ($widgetstyle_list) foreach ($widgetstyle_list as $widgetstyle) |
|
| 490 | 490 | { |
| 491 | - if(in_array($widgetstyle->widgetStyle, $skip['widgetstyle'])) |
|
| 491 | + if (in_array($widgetstyle->widgetStyle, $skip['widgetstyle'])) |
|
| 492 | 492 | { |
| 493 | 493 | continue; |
| 494 | 494 | } |
| 495 | - $info['widgetstyle'] .= '|' . $widgetstyle->widgetStyle; |
|
| 495 | + $info['widgetstyle'] .= '|'.$widgetstyle->widgetStyle; |
|
| 496 | 496 | } |
| 497 | 497 | $info['widgetstyle'] = substr($info['widgetstyle'], 1); |
| 498 | 498 | |
| 499 | 499 | $param = ''; |
| 500 | - foreach($info as $k => $v) |
|
| 500 | + foreach ($info as $k => $v) |
|
| 501 | 501 | { |
| 502 | - if($v) |
|
| 502 | + if ($v) |
|
| 503 | 503 | { |
| 504 | 504 | $param .= sprintf('&%s=%s', $k, urlencode($v)); |
| 505 | 505 | } |
@@ -515,13 +515,13 @@ discard block |
||
| 515 | 515 | */ |
| 516 | 516 | function getThemeList() |
| 517 | 517 | { |
| 518 | - $path = _XE_PATH_ . 'themes'; |
|
| 518 | + $path = _XE_PATH_.'themes'; |
|
| 519 | 519 | $list = FileHandler::readDir($path); |
| 520 | 520 | |
| 521 | 521 | $theme_info = array(); |
| 522 | - if(count($list) > 0) |
|
| 522 | + if (count($list) > 0) |
|
| 523 | 523 | { |
| 524 | - foreach($list as $val) |
|
| 524 | + foreach ($list as $val) |
|
| 525 | 525 | { |
| 526 | 526 | $theme_info[$val] = $this->getThemeInfo($val); |
| 527 | 527 | } |
@@ -538,20 +538,20 @@ discard block |
||
| 538 | 538 | */ |
| 539 | 539 | function getThemeInfo($theme_name, $layout_list = NULL) |
| 540 | 540 | { |
| 541 | - if($GLOBALS['__ThemeInfo__'][$theme_name]) |
|
| 541 | + if ($GLOBALS['__ThemeInfo__'][$theme_name]) |
|
| 542 | 542 | { |
| 543 | 543 | return $GLOBALS['__ThemeInfo__'][$theme_name]; |
| 544 | 544 | } |
| 545 | 545 | |
| 546 | - $info_file = _XE_PATH_ . 'themes/' . $theme_name . '/conf/info.xml'; |
|
| 547 | - if(!file_exists($info_file)) |
|
| 546 | + $info_file = _XE_PATH_.'themes/'.$theme_name.'/conf/info.xml'; |
|
| 547 | + if (!file_exists($info_file)) |
|
| 548 | 548 | { |
| 549 | 549 | return; |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | $oXmlParser = new XmlParser(); |
| 553 | 553 | $_xml_obj = $oXmlParser->loadXmlFile($info_file); |
| 554 | - if(!$_xml_obj->theme) |
|
| 554 | + if (!$_xml_obj->theme) |
|
| 555 | 555 | { |
| 556 | 556 | return; |
| 557 | 557 | } |
@@ -562,16 +562,16 @@ discard block |
||
| 562 | 562 | $theme_info = new stdClass(); |
| 563 | 563 | $theme_info->name = $theme_name; |
| 564 | 564 | $theme_info->title = $xml_obj->title->body; |
| 565 | - $thumbnail = './themes/' . $theme_name . '/thumbnail.png'; |
|
| 565 | + $thumbnail = './themes/'.$theme_name.'/thumbnail.png'; |
|
| 566 | 566 | $theme_info->thumbnail = (FileHandler::exists($thumbnail)) ? $thumbnail : NULL; |
| 567 | 567 | $theme_info->version = $xml_obj->version->body; |
| 568 | 568 | $date_obj = new stdClass(); |
| 569 | 569 | sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d); |
| 570 | 570 | $theme_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); |
| 571 | 571 | $theme_info->description = $xml_obj->description->body; |
| 572 | - $theme_info->path = './themes/' . $theme_name . '/'; |
|
| 572 | + $theme_info->path = './themes/'.$theme_name.'/'; |
|
| 573 | 573 | |
| 574 | - if(!is_array($xml_obj->publisher)) |
|
| 574 | + if (!is_array($xml_obj->publisher)) |
|
| 575 | 575 | { |
| 576 | 576 | $publisher_list = array(); |
| 577 | 577 | $publisher_list[] = $xml_obj->publisher; |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | $theme_info->publisher = array(); |
| 585 | - foreach($publisher_list as $publisher) |
|
| 585 | + foreach ($publisher_list as $publisher) |
|
| 586 | 586 | { |
| 587 | 587 | $publisher_obj = new stdClass(); |
| 588 | 588 | $publisher_obj->name = $publisher->name->body; |
@@ -595,10 +595,10 @@ discard block |
||
| 595 | 595 | $layout_path = $layout->directory->attrs->path; |
| 596 | 596 | $layout_parse = explode('/', $layout_path); |
| 597 | 597 | $layout_info = new stdClass(); |
| 598 | - switch($layout_parse[1]) |
|
| 598 | + switch ($layout_parse[1]) |
|
| 599 | 599 | { |
| 600 | 600 | case 'themes' : |
| 601 | - $layout_info->name = $theme_name . '|@|' . $layout_parse[count($layout_parse) - 1]; |
|
| 601 | + $layout_info->name = $theme_name.'|@|'.$layout_parse[count($layout_parse) - 1]; |
|
| 602 | 602 | break; |
| 603 | 603 | |
| 604 | 604 | case 'layouts' : |
@@ -615,11 +615,11 @@ discard block |
||
| 615 | 615 | $oLayoutModel = getModel('layout'); |
| 616 | 616 | $layout_info_list = array(); |
| 617 | 617 | $layout_list = $oLayoutModel->getLayoutList($site_info->site_srl); |
| 618 | - if($layout_list) |
|
| 618 | + if ($layout_list) |
|
| 619 | 619 | { |
| 620 | - foreach($layout_list as $val) |
|
| 620 | + foreach ($layout_list as $val) |
|
| 621 | 621 | { |
| 622 | - if($val->layout == $layout_info->name) |
|
| 622 | + if ($val->layout == $layout_info->name) |
|
| 623 | 623 | { |
| 624 | 624 | $is_new_layout = FALSE; |
| 625 | 625 | $layout_info->layout_srl = $val->layout_srl; |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | } |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | - if($is_new_layout) |
|
| 631 | + if ($is_new_layout) |
|
| 632 | 632 | { |
| 633 | 633 | $site_module_info = Context::get('site_module_info'); |
| 634 | 634 | $args = new stdClass(); |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | $theme_info->layout_info = $layout_info; |
| 647 | 647 | |
| 648 | 648 | $skin_infos = $xml_obj->skininfos; |
| 649 | - if(is_array($skin_infos->skininfo)) |
|
| 649 | + if (is_array($skin_infos->skininfo)) |
|
| 650 | 650 | { |
| 651 | 651 | $skin_list = $skin_infos->skininfo; |
| 652 | 652 | } |
@@ -657,17 +657,17 @@ discard block |
||
| 657 | 657 | |
| 658 | 658 | $oModuleModel = getModel('module'); |
| 659 | 659 | $skins = array(); |
| 660 | - foreach($skin_list as $val) |
|
| 660 | + foreach ($skin_list as $val) |
|
| 661 | 661 | { |
| 662 | 662 | $skin_info = new stdClass(); |
| 663 | 663 | unset($skin_parse); |
| 664 | 664 | $skin_parse = explode('/', $val->directory->attrs->path); |
| 665 | - switch($skin_parse[1]) |
|
| 665 | + switch ($skin_parse[1]) |
|
| 666 | 666 | { |
| 667 | 667 | case 'themes' : |
| 668 | 668 | $is_theme = TRUE; |
| 669 | 669 | $module_name = $skin_parse[count($skin_parse) - 1]; |
| 670 | - $skin_info->name = $theme_name . '|@|' . $module_name; |
|
| 670 | + $skin_info->name = $theme_name.'|@|'.$module_name; |
|
| 671 | 671 | break; |
| 672 | 672 | |
| 673 | 673 | case 'modules' : |
@@ -681,9 +681,9 @@ discard block |
||
| 681 | 681 | $skin_info->is_theme = $is_theme; |
| 682 | 682 | $skins[$module_name] = $skin_info; |
| 683 | 683 | |
| 684 | - if($is_theme) |
|
| 684 | + if ($is_theme) |
|
| 685 | 685 | { |
| 686 | - if(!$GLOBALS['__ThemeModuleSkin__'][$module_name]) |
|
| 686 | + if (!$GLOBALS['__ThemeModuleSkin__'][$module_name]) |
|
| 687 | 687 | { |
| 688 | 688 | $GLOBALS['__ThemeModuleSkin__'][$module_name] = array(); |
| 689 | 689 | $GLOBALS['__ThemeModuleSkin__'][$module_name]['skins'] = array(); |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | */ |
| 706 | 706 | function getModulesSkinList() |
| 707 | 707 | { |
| 708 | - if($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__']) |
|
| 708 | + if ($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__']) |
|
| 709 | 709 | { |
| 710 | 710 | return $GLOBALS['__ThemeModuleSkin__']; |
| 711 | 711 | } |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | sort($searched_list); |
| 714 | 714 | |
| 715 | 715 | $searched_count = count($searched_list); |
| 716 | - if(!$searched_count) |
|
| 716 | + if (!$searched_count) |
|
| 717 | 717 | { |
| 718 | 718 | return; |
| 719 | 719 | } |
@@ -721,13 +721,13 @@ discard block |
||
| 721 | 721 | $exceptionModule = array('editor', 'poll', 'homepage', 'textyle'); |
| 722 | 722 | |
| 723 | 723 | $oModuleModel = getModel('module'); |
| 724 | - foreach($searched_list as $val) |
|
| 724 | + foreach ($searched_list as $val) |
|
| 725 | 725 | { |
| 726 | - $skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/' . $val); |
|
| 726 | + $skin_list = $oModuleModel->getSkins(_XE_PATH_.'modules/'.$val); |
|
| 727 | 727 | |
| 728 | - if(is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule)) |
|
| 728 | + if (is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule)) |
|
| 729 | 729 | { |
| 730 | - if(!$GLOBALS['__ThemeModuleSkin__'][$val]) |
|
| 730 | + if (!$GLOBALS['__ThemeModuleSkin__'][$val]) |
|
| 731 | 731 | { |
| 732 | 732 | $GLOBALS['__ThemeModuleSkin__'][$val] = array(); |
| 733 | 733 | $moduleInfo = $oModuleModel->getModuleInfoXml($val); |
@@ -751,23 +751,23 @@ discard block |
||
| 751 | 751 | static $lang = false; |
| 752 | 752 | |
| 753 | 753 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
| 754 | - if($lang === false && $oCacheHandler->isSupport()) |
|
| 754 | + if ($lang === false && $oCacheHandler->isSupport()) |
|
| 755 | 755 | { |
| 756 | - $cache_key = 'admin_menu_langs:' . Context::getLangType(); |
|
| 756 | + $cache_key = 'admin_menu_langs:'.Context::getLangType(); |
|
| 757 | 757 | $lang = $oCacheHandler->get($cache_key); |
| 758 | 758 | |
| 759 | - if($lang === false) |
|
| 759 | + if ($lang === false) |
|
| 760 | 760 | { |
| 761 | 761 | $lang = array(); |
| 762 | 762 | $oModuleModel = getModel('module'); |
| 763 | 763 | $installed_module_list = $oModuleModel->getModulesXmlInfo(); |
| 764 | 764 | |
| 765 | - foreach($installed_module_list as $key => $value) |
|
| 765 | + foreach ($installed_module_list as $key => $value) |
|
| 766 | 766 | { |
| 767 | 767 | $moduleActionInfo = $oModuleModel->getModuleActionXml($value->module); |
| 768 | - if(is_object($moduleActionInfo->menu)) |
|
| 768 | + if (is_object($moduleActionInfo->menu)) |
|
| 769 | 769 | { |
| 770 | - foreach($moduleActionInfo->menu as $key2 => $value2) |
|
| 770 | + foreach ($moduleActionInfo->menu as $key2 => $value2) |
|
| 771 | 771 | { |
| 772 | 772 | $lang[$key2] = $value2->title; |
| 773 | 773 | } |
@@ -792,19 +792,19 @@ discard block |
||
| 792 | 792 | $args = new stdClass(); |
| 793 | 793 | $args->site_srl = $siteSrl; |
| 794 | 794 | $output = executeQueryArray('admin.getFavoriteList', $args); |
| 795 | - if(!$output->toBool()) |
|
| 795 | + if (!$output->toBool()) |
|
| 796 | 796 | { |
| 797 | 797 | return $output; |
| 798 | 798 | } |
| 799 | - if(!$output->data) |
|
| 799 | + if (!$output->data) |
|
| 800 | 800 | { |
| 801 | 801 | return new BaseObject(); |
| 802 | 802 | } |
| 803 | 803 | |
| 804 | - if($isGetModuleInfo && is_array($output->data)) |
|
| 804 | + if ($isGetModuleInfo && is_array($output->data)) |
|
| 805 | 805 | { |
| 806 | 806 | $oModuleModel = getModel('module'); |
| 807 | - foreach($output->data AS $key => $value) |
|
| 807 | + foreach ($output->data AS $key => $value) |
|
| 808 | 808 | { |
| 809 | 809 | $moduleInfo = $oModuleModel->getModuleInfoXml($value->module); |
| 810 | 810 | $output->data[$key]->admin_index_act = $moduleInfo->admin_index_act; |
@@ -829,13 +829,13 @@ discard block |
||
| 829 | 829 | $args->site_srl = $siteSrl; |
| 830 | 830 | $args->module = $module; |
| 831 | 831 | $output = executeQuery('admin.getFavorite', $args); |
| 832 | - if(!$output->toBool()) |
|
| 832 | + if (!$output->toBool()) |
|
| 833 | 833 | { |
| 834 | 834 | return $output; |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | 837 | $returnObject = new BaseObject(); |
| 838 | - if($output->data) |
|
| 838 | + if ($output->data) |
|
| 839 | 839 | { |
| 840 | 840 | $returnObject->add('result', TRUE); |
| 841 | 841 | $returnObject->add('favoriteSrl', $output->data->admin_favorite_srl); |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | */ |
| 855 | 855 | function getSiteAllList() |
| 856 | 856 | { |
| 857 | - if(Context::get('domain')) |
|
| 857 | + if (Context::get('domain')) |
|
| 858 | 858 | { |
| 859 | 859 | $domain = Context::get('domain'); |
| 860 | 860 | } |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | function getAllSitesThatHaveModules($domain = NULL) |
| 872 | 872 | { |
| 873 | 873 | $args = new stdClass(); |
| 874 | - if($domain) |
|
| 874 | + if ($domain) |
|
| 875 | 875 | { |
| 876 | 876 | $args->domain = $domain; |
| 877 | 877 | } |
@@ -879,31 +879,31 @@ discard block |
||
| 879 | 879 | |
| 880 | 880 | $siteList = array(); |
| 881 | 881 | $output = executeQueryArray('admin.getSiteAllList', $args, $columnList); |
| 882 | - if($output->toBool()) |
|
| 882 | + if ($output->toBool()) |
|
| 883 | 883 | { |
| 884 | 884 | $siteList = $output->data; |
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | $oModuleModel = getModel('module'); |
| 888 | - foreach($siteList as $key => $value) |
|
| 888 | + foreach ($siteList as $key => $value) |
|
| 889 | 889 | { |
| 890 | 890 | $args->site_srl = $value->site_srl; |
| 891 | 891 | $list = $oModuleModel->getModuleSrlList($args); |
| 892 | 892 | |
| 893 | - if(!is_array($list)) |
|
| 893 | + if (!is_array($list)) |
|
| 894 | 894 | { |
| 895 | 895 | $list = array($list); |
| 896 | 896 | } |
| 897 | 897 | |
| 898 | - foreach($list as $k => $v) |
|
| 898 | + foreach ($list as $k => $v) |
|
| 899 | 899 | { |
| 900 | - if(!is_dir(_XE_PATH_ . 'modules/' . $v->module)) |
|
| 900 | + if (!is_dir(_XE_PATH_.'modules/'.$v->module)) |
|
| 901 | 901 | { |
| 902 | 902 | unset($list[$k]); |
| 903 | 903 | } |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | - if(!count($list)) |
|
| 906 | + if (!count($list)) |
|
| 907 | 907 | { |
| 908 | 908 | unset($siteList[$key]); |
| 909 | 909 | } |
@@ -920,13 +920,13 @@ discard block |
||
| 920 | 920 | { |
| 921 | 921 | $args = new stdClass(); |
| 922 | 922 | |
| 923 | - if($date) |
|
| 923 | + if ($date) |
|
| 924 | 924 | { |
| 925 | 925 | $args->regDate = date('Ymd', strtotime($date)); |
| 926 | 926 | } |
| 927 | 927 | |
| 928 | 928 | $output = executeQuery('admin.getSiteCountByDate', $args); |
| 929 | - if(!$output->toBool()) |
|
| 929 | + if (!$output->toBool()) |
|
| 930 | 930 | { |
| 931 | 931 | return 0; |
| 932 | 932 | } |
@@ -948,21 +948,21 @@ discard block |
||
| 948 | 948 | { |
| 949 | 949 | $site_info = Context::get('site_module_info'); |
| 950 | 950 | $virtual_site = ''; |
| 951 | - if($site_info->site_srl) |
|
| 951 | + if ($site_info->site_srl) |
|
| 952 | 952 | { |
| 953 | - $virtual_site = $site_info->site_srl . '/'; |
|
| 953 | + $virtual_site = $site_info->site_srl.'/'; |
|
| 954 | 954 | } |
| 955 | 955 | |
| 956 | - $file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname); |
|
| 957 | - if(!$file_exsit && $default === true) |
|
| 956 | + $file_exsit = FileHandler::readFile(_XE_PATH_.'files/attach/xeicon/'.$virtual_site.$iconname); |
|
| 957 | + if (!$file_exsit && $default === true) |
|
| 958 | 958 | { |
| 959 | - $icon_url = './modules/admin/tpl/img/' . $default_icon_name; |
|
| 959 | + $icon_url = './modules/admin/tpl/img/'.$default_icon_name; |
|
| 960 | 960 | } |
| 961 | - elseif($file_exsit) |
|
| 961 | + elseif ($file_exsit) |
|
| 962 | 962 | { |
| 963 | 963 | $default_url = Context::getDefaultUrl(); |
| 964 | - if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1); |
|
| 965 | - $icon_url = $default_url . '/files/attach/xeicon/' . $virtual_site . $iconname; |
|
| 964 | + if ($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1); |
|
| 965 | + $icon_url = $default_url.'/files/attach/xeicon/'.$virtual_site.$iconname; |
|
| 966 | 966 | } |
| 967 | 967 | return $icon_url; |
| 968 | 968 | } |
@@ -303,8 +303,7 @@ discard block |
||
| 303 | 303 | if(is_dir($curpwd . $file)) |
| 304 | 304 | { |
| 305 | 305 | $file .= "/"; |
| 306 | - } |
|
| 307 | - else |
|
| 306 | + } else |
|
| 308 | 307 | { |
| 309 | 308 | continue; |
| 310 | 309 | } |
@@ -359,8 +358,7 @@ discard block |
||
| 359 | 358 | { |
| 360 | 359 | $_list = $oFtp->ftp_rawlist($this->pwd); |
| 361 | 360 | $oFtp->ftp_quit(); |
| 362 | - } |
|
| 363 | - else |
|
| 361 | + } else |
|
| 364 | 362 | { |
| 365 | 363 | return new BaseObject(-1, 'msg_ftp_invalid_auth_info'); |
| 366 | 364 | } |
@@ -380,8 +378,7 @@ discard block |
||
| 380 | 378 | $list[] = substr(strrchr($v, ' '), 1) . '/'; |
| 381 | 379 | } |
| 382 | 380 | } |
| 383 | - } |
|
| 384 | - else |
|
| 381 | + } else |
|
| 385 | 382 | { |
| 386 | 383 | return new BaseObject(-1, 'msg_ftp_no_directory'); |
| 387 | 384 | } |
@@ -434,11 +431,13 @@ discard block |
||
| 434 | 431 | $info['module'] = ''; |
| 435 | 432 | $oModuleModel = getModel('module'); |
| 436 | 433 | $module_list = $oModuleModel->getModuleList(); |
| 437 | - if($module_list) foreach($module_list as $module) |
|
| 434 | + if($module_list) { |
|
| 435 | + foreach($module_list as $module) |
|
| 438 | 436 | { |
| 439 | 437 | if(in_array($module->module, $skip['module'])) |
| 440 | 438 | { |
| 441 | 439 | continue; |
| 440 | + } |
|
| 442 | 441 | } |
| 443 | 442 | $info['module'] .= '|' . $module->module; |
| 444 | 443 | } |
@@ -447,11 +446,13 @@ discard block |
||
| 447 | 446 | $info['addon'] = ''; |
| 448 | 447 | $oAddonAdminModel = getAdminModel('addon'); |
| 449 | 448 | $addon_list = $oAddonAdminModel->getAddonList(); |
| 450 | - if($addon_list) foreach($addon_list as $addon) |
|
| 449 | + if($addon_list) { |
|
| 450 | + foreach($addon_list as $addon) |
|
| 451 | 451 | { |
| 452 | 452 | if(in_array($addon->addon, $skip['addon'])) |
| 453 | 453 | { |
| 454 | 454 | continue; |
| 455 | + } |
|
| 455 | 456 | } |
| 456 | 457 | $info['addon'] .= '|' . $addon->addon; |
| 457 | 458 | } |
@@ -460,11 +461,13 @@ discard block |
||
| 460 | 461 | $info['layout'] = ""; |
| 461 | 462 | $oLayoutModel = getModel('layout'); |
| 462 | 463 | $layout_list = $oLayoutModel->getDownloadedLayoutList(); |
| 463 | - if($layout_list) foreach($layout_list as $layout) |
|
| 464 | + if($layout_list) { |
|
| 465 | + foreach($layout_list as $layout) |
|
| 464 | 466 | { |
| 465 | 467 | if(in_array($layout->layout, $skip['layout'])) |
| 466 | 468 | { |
| 467 | 469 | continue; |
| 470 | + } |
|
| 468 | 471 | } |
| 469 | 472 | $info['layout'] .= '|' . $layout->layout; |
| 470 | 473 | } |
@@ -473,11 +476,13 @@ discard block |
||
| 473 | 476 | $info['widget'] = ""; |
| 474 | 477 | $oWidgetModel = getModel('widget'); |
| 475 | 478 | $widget_list = $oWidgetModel->getDownloadedWidgetList(); |
| 476 | - if($widget_list) foreach($widget_list as $widget) |
|
| 479 | + if($widget_list) { |
|
| 480 | + foreach($widget_list as $widget) |
|
| 477 | 481 | { |
| 478 | 482 | if(in_array($widget->widget, $skip['widget'])) |
| 479 | 483 | { |
| 480 | 484 | continue; |
| 485 | + } |
|
| 481 | 486 | } |
| 482 | 487 | $info['widget'] .= '|' . $widget->widget; |
| 483 | 488 | } |
@@ -486,11 +491,13 @@ discard block |
||
| 486 | 491 | $info['widgetstyle'] = ""; |
| 487 | 492 | $oWidgetModel = getModel('widget'); |
| 488 | 493 | $widgetstyle_list = $oWidgetModel->getDownloadedWidgetStyleList(); |
| 489 | - if($widgetstyle_list) foreach($widgetstyle_list as $widgetstyle) |
|
| 494 | + if($widgetstyle_list) { |
|
| 495 | + foreach($widgetstyle_list as $widgetstyle) |
|
| 490 | 496 | { |
| 491 | 497 | if(in_array($widgetstyle->widgetStyle, $skip['widgetstyle'])) |
| 492 | 498 | { |
| 493 | 499 | continue; |
| 500 | + } |
|
| 494 | 501 | } |
| 495 | 502 | $info['widgetstyle'] .= '|' . $widgetstyle->widgetStyle; |
| 496 | 503 | } |
@@ -575,8 +582,7 @@ discard block |
||
| 575 | 582 | { |
| 576 | 583 | $publisher_list = array(); |
| 577 | 584 | $publisher_list[] = $xml_obj->publisher; |
| 578 | - } |
|
| 579 | - else |
|
| 585 | + } else |
|
| 580 | 586 | { |
| 581 | 587 | $publisher_list = $xml_obj->publisher; |
| 582 | 588 | } |
@@ -649,8 +655,7 @@ discard block |
||
| 649 | 655 | if(is_array($skin_infos->skininfo)) |
| 650 | 656 | { |
| 651 | 657 | $skin_list = $skin_infos->skininfo; |
| 652 | - } |
|
| 653 | - else |
|
| 658 | + } else |
|
| 654 | 659 | { |
| 655 | 660 | $skin_list = array($skin_infos->skininfo); |
| 656 | 661 | } |
@@ -839,8 +844,7 @@ discard block |
||
| 839 | 844 | { |
| 840 | 845 | $returnObject->add('result', TRUE); |
| 841 | 846 | $returnObject->add('favoriteSrl', $output->data->admin_favorite_srl); |
| 842 | - } |
|
| 843 | - else |
|
| 847 | + } else |
|
| 844 | 848 | { |
| 845 | 849 | $returnObject->add('result', FALSE); |
| 846 | 850 | } |
@@ -957,11 +961,12 @@ discard block |
||
| 957 | 961 | if(!$file_exsit && $default === true) |
| 958 | 962 | { |
| 959 | 963 | $icon_url = './modules/admin/tpl/img/' . $default_icon_name; |
| 960 | - } |
|
| 961 | - elseif($file_exsit) |
|
| 964 | + } elseif($file_exsit) |
|
| 962 | 965 | { |
| 963 | 966 | $default_url = Context::getDefaultUrl(); |
| 964 | - if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1); |
|
| 967 | + if($default_url && substr_compare($default_url, '/', -1) === 0) { |
|
| 968 | + $default_url = substr($default_url, 0, -1); |
|
| 969 | + } |
|
| 965 | 970 | $icon_url = $default_url . '/files/attach/xeicon/' . $virtual_site . $iconname; |
| 966 | 971 | } |
| 967 | 972 | return $icon_url; |
@@ -332,6 +332,7 @@ |
||
| 332 | 332 | /** |
| 333 | 333 | * Uninstall package by package serial number |
| 334 | 334 | * |
| 335 | + * @param string $package_srl |
|
| 335 | 336 | * @return BaseObject |
| 336 | 337 | */ |
| 337 | 338 | function uninstallPackageByPackageSrl($package_srl) |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * |
| 86 | 86 | * @param object $item |
| 87 | 87 | * @param object $targets |
| 88 | - * @return object |
|
| 88 | + * @return stdClass |
|
| 89 | 89 | */ |
| 90 | 90 | function rearrange(&$item, &$targets) |
| 91 | 91 | { |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | /** |
| 348 | 348 | * Display install package |
| 349 | 349 | * |
| 350 | - * @return BaseObject |
|
| 350 | + * @return ModuleObject|null |
|
| 351 | 351 | */ |
| 352 | 352 | function dispAutoinstallAdminInstall() |
| 353 | 353 | { |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | /** |
| 385 | 385 | * Display package list |
| 386 | 386 | * |
| 387 | - * @return BaseObject |
|
| 387 | + * @return ModuleObject|null |
|
| 388 | 388 | */ |
| 389 | 389 | function dispAutoinstallAdminIndex() |
| 390 | 390 | { |
@@ -160,7 +160,6 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | 162 | * Check if module is using comment validation system |
| 163 | - * @param int $document_srl |
|
| 164 | 163 | * @param int $module_srl |
| 165 | 164 | * @return bool |
| 166 | 165 | */ |
@@ -1151,7 +1150,7 @@ discard block |
||
| 1151 | 1150 | |
| 1152 | 1151 | /** |
| 1153 | 1152 | * Report a blamed comment |
| 1154 | - * @param $comment_srl |
|
| 1153 | + * @param string $comment_srl |
|
| 1155 | 1154 | * @return void |
| 1156 | 1155 | */ |
| 1157 | 1156 | function declaredComment($comment_srl) |
@@ -1356,7 +1355,7 @@ discard block |
||
| 1356 | 1355 | /** |
| 1357 | 1356 | * Comment module config setting |
| 1358 | 1357 | * @param int $srl |
| 1359 | - * @param object $comment_config |
|
| 1358 | + * @param stdClass $comment_config |
|
| 1360 | 1359 | * @return BaseObject |
| 1361 | 1360 | */ |
| 1362 | 1361 | function setCommentModuleConfig($srl, $comment_config) |
@@ -1368,7 +1367,7 @@ discard block |
||
| 1368 | 1367 | |
| 1369 | 1368 | /** |
| 1370 | 1369 | * Get comment all list |
| 1371 | - * @return void |
|
| 1370 | + * @return BaseObject|null |
|
| 1372 | 1371 | */ |
| 1373 | 1372 | function procCommentGetList() |
| 1374 | 1373 | { |
@@ -27,13 +27,13 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | function procCommentVoteUp() |
| 29 | 29 | { |
| 30 | - if(!Context::get('is_logged')) |
|
| 30 | + if (!Context::get('is_logged')) |
|
| 31 | 31 | { |
| 32 | 32 | return new BaseObject(-1, 'msg_invalid_request'); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $comment_srl = Context::get('target_srl'); |
| 36 | - if(!$comment_srl) |
|
| 36 | + if (!$comment_srl) |
|
| 37 | 37 | { |
| 38 | 38 | return new BaseObject(-1, 'msg_invalid_request'); |
| 39 | 39 | } |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | $oCommentModel = getModel('comment'); |
| 42 | 42 | $oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE); |
| 43 | 43 | $module_srl = $oComment->get('module_srl'); |
| 44 | - if(!$module_srl) |
|
| 44 | + if (!$module_srl) |
|
| 45 | 45 | { |
| 46 | 46 | return new BaseObject(-1, 'msg_invalid_request'); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $oModuleModel = getModel('module'); |
| 50 | 50 | $comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl); |
| 51 | - if($comment_config->use_vote_up == 'N') |
|
| 51 | + if ($comment_config->use_vote_up == 'N') |
|
| 52 | 52 | { |
| 53 | 53 | return new BaseObject(-1, 'msg_invalid_request'); |
| 54 | 54 | } |
@@ -65,13 +65,13 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | function procCommentVoteDown() |
| 67 | 67 | { |
| 68 | - if(!Context::get('is_logged')) |
|
| 68 | + if (!Context::get('is_logged')) |
|
| 69 | 69 | { |
| 70 | 70 | return new BaseObject(-1, 'msg_invalid_request'); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $comment_srl = Context::get('target_srl'); |
| 74 | - if(!$comment_srl) |
|
| 74 | + if (!$comment_srl) |
|
| 75 | 75 | { |
| 76 | 76 | return new BaseObject(-1, 'msg_invalid_request'); |
| 77 | 77 | } |
@@ -79,14 +79,14 @@ discard block |
||
| 79 | 79 | $oCommentModel = getModel('comment'); |
| 80 | 80 | $oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE); |
| 81 | 81 | $module_srl = $oComment->get('module_srl'); |
| 82 | - if(!$module_srl) |
|
| 82 | + if (!$module_srl) |
|
| 83 | 83 | { |
| 84 | 84 | return new BaseObject(-1, 'msg_invalid_request'); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $oModuleModel = getModel('module'); |
| 88 | 88 | $comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl); |
| 89 | - if($comment_config->use_vote_down == 'N') |
|
| 89 | + if ($comment_config->use_vote_down == 'N') |
|
| 90 | 90 | { |
| 91 | 91 | return new BaseObject(-1, 'msg_invalid_request'); |
| 92 | 92 | } |
@@ -103,13 +103,13 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | function procCommentDeclare() |
| 105 | 105 | { |
| 106 | - if(!Context::get('is_logged')) |
|
| 106 | + if (!Context::get('is_logged')) |
|
| 107 | 107 | { |
| 108 | 108 | return new BaseObject(-1, 'msg_invalid_request'); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $comment_srl = Context::get('target_srl'); |
| 112 | - if(!$comment_srl) |
|
| 112 | + if (!$comment_srl) |
|
| 113 | 113 | { |
| 114 | 114 | return new BaseObject(-1, 'msg_invalid_request'); |
| 115 | 115 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | function triggerDeleteDocumentComments(&$obj) |
| 125 | 125 | { |
| 126 | 126 | $document_srl = $obj->document_srl; |
| 127 | - if(!$document_srl) |
|
| 127 | + if (!$document_srl) |
|
| 128 | 128 | { |
| 129 | 129 | return new BaseObject(); |
| 130 | 130 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | function triggerDeleteModuleComments(&$obj) |
| 140 | 140 | { |
| 141 | 141 | $module_srl = $obj->module_srl; |
| 142 | - if(!$module_srl) |
|
| 142 | + if (!$module_srl) |
|
| 143 | 143 | { |
| 144 | 144 | return new BaseObject(); |
| 145 | 145 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | function isModuleUsingPublishValidation($module_srl = NULL) |
| 168 | 168 | { |
| 169 | - if($module_srl == NULL) |
|
| 169 | + if ($module_srl == NULL) |
|
| 170 | 170 | { |
| 171 | 171 | return FALSE; |
| 172 | 172 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
| 176 | 176 | $module_part_config = $oModuleModel->getModulePartConfig('comment', $module_info->module_srl); |
| 177 | 177 | $use_validation = FALSE; |
| 178 | - if(isset($module_part_config->use_comment_validation) && $module_part_config->use_comment_validation == "Y") |
|
| 178 | + if (isset($module_part_config->use_comment_validation) && $module_part_config->use_comment_validation == "Y") |
|
| 179 | 179 | { |
| 180 | 180 | $use_validation = TRUE; |
| 181 | 181 | } |
@@ -190,12 +190,12 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | function insertComment($obj, $manual_inserted = FALSE) |
| 192 | 192 | { |
| 193 | - if(!$manual_inserted && !checkCSRF()) |
|
| 193 | + if (!$manual_inserted && !checkCSRF()) |
|
| 194 | 194 | { |
| 195 | 195 | return new BaseObject(-1, 'msg_invalid_request'); |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - if(!is_object($obj)) |
|
| 198 | + if (!is_object($obj)) |
|
| 199 | 199 | { |
| 200 | 200 | $obj = new stdClass(); |
| 201 | 201 | } |
@@ -203,12 +203,12 @@ discard block |
||
| 203 | 203 | // check if comment's module is using comment validation and set the publish status to 0 (false) |
| 204 | 204 | // for inserting query, otherwise default is 1 (true - means comment is published) |
| 205 | 205 | $using_validation = $this->isModuleUsingPublishValidation($obj->module_srl); |
| 206 | - if(!$manual_inserted) |
|
| 206 | + if (!$manual_inserted) |
|
| 207 | 207 | { |
| 208 | - if(Context::get('is_logged')) |
|
| 208 | + if (Context::get('is_logged')) |
|
| 209 | 209 | { |
| 210 | 210 | $logged_info = Context::get('logged_info'); |
| 211 | - if($logged_info->is_admin == 'Y') |
|
| 211 | + if ($logged_info->is_admin == 'Y') |
|
| 212 | 212 | { |
| 213 | 213 | $is_admin = TRUE; |
| 214 | 214 | } |
@@ -223,13 +223,13 @@ discard block |
||
| 223 | 223 | $is_admin = FALSE; |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - if(!$using_validation) |
|
| 226 | + if (!$using_validation) |
|
| 227 | 227 | { |
| 228 | 228 | $obj->status = 1; |
| 229 | 229 | } |
| 230 | 230 | else |
| 231 | 231 | { |
| 232 | - if($is_admin) |
|
| 232 | + if ($is_admin) |
|
| 233 | 233 | { |
| 234 | 234 | $obj->status = 1; |
| 235 | 235 | } |
@@ -242,14 +242,14 @@ discard block |
||
| 242 | 242 | |
| 243 | 243 | // call a trigger (before) |
| 244 | 244 | $output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj); |
| 245 | - if(!$output->toBool()) |
|
| 245 | + if (!$output->toBool()) |
|
| 246 | 246 | { |
| 247 | 247 | return $output; |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | // check if a posting of the corresponding document_srl exists |
| 251 | 251 | $document_srl = $obj->document_srl; |
| 252 | - if(!$document_srl) |
|
| 252 | + if (!$document_srl) |
|
| 253 | 253 | { |
| 254 | 254 | return new BaseObject(-1, 'msg_invalid_document'); |
| 255 | 255 | } |
@@ -258,36 +258,36 @@ discard block |
||
| 258 | 258 | $oDocumentModel = getModel('document'); |
| 259 | 259 | |
| 260 | 260 | // even for manual_inserted if password exists, hash it. |
| 261 | - if($obj->password) |
|
| 261 | + if ($obj->password) |
|
| 262 | 262 | { |
| 263 | 263 | $obj->password = getModel('member')->hashPassword($obj->password); |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | // get the original posting |
| 267 | - if(!$manual_inserted) |
|
| 267 | + if (!$manual_inserted) |
|
| 268 | 268 | { |
| 269 | 269 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 270 | 270 | |
| 271 | - if($document_srl != $oDocument->document_srl) |
|
| 271 | + if ($document_srl != $oDocument->document_srl) |
|
| 272 | 272 | { |
| 273 | 273 | return new BaseObject(-1, 'msg_invalid_document'); |
| 274 | 274 | } |
| 275 | - if($oDocument->isLocked()) |
|
| 275 | + if ($oDocument->isLocked()) |
|
| 276 | 276 | { |
| 277 | 277 | return new BaseObject(-1, 'msg_invalid_request'); |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | - if($obj->homepage) |
|
| 280 | + if ($obj->homepage) |
|
| 281 | 281 | { |
| 282 | 282 | $obj->homepage = removeHackTag($obj->homepage); |
| 283 | - if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage)) |
|
| 283 | + if (!preg_match('/^[a-z]+:\/\//i', $obj->homepage)) |
|
| 284 | 284 | { |
| 285 | 285 | $obj->homepage = 'http://'.$obj->homepage; |
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | // input the member's information if logged-in |
| 290 | - if(Context::get('is_logged')) |
|
| 290 | + if (Context::get('is_logged')) |
|
| 291 | 291 | { |
| 292 | 292 | $logged_info = Context::get('logged_info'); |
| 293 | 293 | $obj->member_srl = $logged_info->member_srl; |
@@ -302,16 +302,16 @@ discard block |
||
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | // error display if neither of log-in info and user name exist. |
| 305 | - if(!$logged_info->member_srl && !$obj->nick_name) |
|
| 305 | + if (!$logged_info->member_srl && !$obj->nick_name) |
|
| 306 | 306 | { |
| 307 | 307 | return new BaseObject(-1, 'msg_invalid_request'); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - if(!$obj->comment_srl) |
|
| 310 | + if (!$obj->comment_srl) |
|
| 311 | 311 | { |
| 312 | 312 | $obj->comment_srl = getNextSequence(); |
| 313 | 313 | } |
| 314 | - elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) |
|
| 314 | + elseif (!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) |
|
| 315 | 315 | { |
| 316 | 316 | return new BaseObject(-1, 'msg_not_permitted'); |
| 317 | 317 | } |
@@ -322,32 +322,32 @@ discard block |
||
| 322 | 322 | // remove XE's own tags from the contents |
| 323 | 323 | $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); |
| 324 | 324 | |
| 325 | - if(Mobile::isFromMobilePhone() && $obj->use_editor != 'Y') |
|
| 325 | + if (Mobile::isFromMobilePhone() && $obj->use_editor != 'Y') |
|
| 326 | 326 | { |
| 327 | - if($obj->use_html != 'Y') |
|
| 327 | + if ($obj->use_html != 'Y') |
|
| 328 | 328 | { |
| 329 | 329 | $obj->content = htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 330 | 330 | } |
| 331 | 331 | $obj->content = nl2br($obj->content); |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | - if(!$obj->regdate) |
|
| 334 | + if (!$obj->regdate) |
|
| 335 | 335 | { |
| 336 | 336 | $obj->regdate = date("YmdHis"); |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | // remove iframe and script if not a top administrator on the session. |
| 340 | - if($logged_info->is_admin != 'Y') |
|
| 340 | + if ($logged_info->is_admin != 'Y') |
|
| 341 | 341 | { |
| 342 | 342 | $obj->content = removeHackTag($obj->content); |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | - if(!$obj->notify_message) |
|
| 345 | + if (!$obj->notify_message) |
|
| 346 | 346 | { |
| 347 | 347 | $obj->notify_message = 'N'; |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | - if(!$obj->is_secret) |
|
| 350 | + if (!$obj->is_secret) |
|
| 351 | 351 | { |
| 352 | 352 | $obj->is_secret = 'N'; |
| 353 | 353 | } |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | $list_args->regdate = $obj->regdate; |
| 365 | 365 | |
| 366 | 366 | // If parent comment doesn't exist, set data directly |
| 367 | - if(!$obj->parent_srl) |
|
| 367 | + if (!$obj->parent_srl) |
|
| 368 | 368 | { |
| 369 | 369 | $list_args->head = $list_args->arrange = $obj->comment_srl; |
| 370 | 370 | $list_args->depth = 0; |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | $parent_output = executeQuery('comment.getCommentListItem', $parent_args); |
| 379 | 379 | |
| 380 | 380 | // return if no parent comment exists |
| 381 | - if(!$parent_output->toBool() || !$parent_output->data) |
|
| 381 | + if (!$parent_output->toBool() || !$parent_output->data) |
|
| 382 | 382 | { |
| 383 | 383 | return; |
| 384 | 384 | } |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | $list_args->depth = $parent->depth + 1; |
| 390 | 390 | |
| 391 | 391 | // if the depth of comments is less than 2, execute insert. |
| 392 | - if($list_args->depth < 2) |
|
| 392 | + if ($list_args->depth < 2) |
|
| 393 | 393 | { |
| 394 | 394 | $list_args->arrange = $obj->comment_srl; |
| 395 | 395 | // if the depth of comments is greater than 2, execute update. |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | $p_args->depth = $parent->depth; |
| 404 | 404 | $output = executeQuery('comment.getCommentParentNextSibling', $p_args); |
| 405 | 405 | |
| 406 | - if($output->data->arrange) |
|
| 406 | + if ($output->data->arrange) |
|
| 407 | 407 | { |
| 408 | 408 | $list_args->arrange = $output->data->arrange; |
| 409 | 409 | $output = executeQuery('comment.updateCommentListArrange', $list_args); |
@@ -416,14 +416,14 @@ discard block |
||
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | $output = executeQuery('comment.insertCommentList', $list_args); |
| 419 | - if(!$output->toBool()) |
|
| 419 | + if (!$output->toBool()) |
|
| 420 | 420 | { |
| 421 | 421 | return $output; |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | // insert comment |
| 425 | 425 | $output = executeQuery('comment.insertComment', $obj); |
| 426 | - if(!$output->toBool()) |
|
| 426 | + if (!$output->toBool()) |
|
| 427 | 427 | { |
| 428 | 428 | $oDB->rollback(); |
| 429 | 429 | return $output; |
@@ -439,29 +439,29 @@ discard block |
||
| 439 | 439 | $oDocumentController = getController('document'); |
| 440 | 440 | |
| 441 | 441 | // Update the number of comments in the post |
| 442 | - if(!$using_validation) |
|
| 442 | + if (!$using_validation) |
|
| 443 | 443 | { |
| 444 | 444 | $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE); |
| 445 | 445 | } |
| 446 | 446 | else |
| 447 | 447 | { |
| 448 | - if($is_admin) |
|
| 448 | + if ($is_admin) |
|
| 449 | 449 | { |
| 450 | 450 | $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE); |
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | // grant autority of the comment |
| 455 | - if(!$manual_inserted) |
|
| 455 | + if (!$manual_inserted) |
|
| 456 | 456 | { |
| 457 | 457 | $this->addGrant($obj->comment_srl); |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | // call a trigger(after) |
| 461 | - if($output->toBool()) |
|
| 461 | + if ($output->toBool()) |
|
| 462 | 462 | { |
| 463 | 463 | $trigger_output = ModuleHandler::triggerCall('comment.insertComment', 'after', $obj); |
| 464 | - if(!$trigger_output->toBool()) |
|
| 464 | + if (!$trigger_output->toBool()) |
|
| 465 | 465 | { |
| 466 | 466 | $oDB->rollback(); |
| 467 | 467 | return $trigger_output; |
@@ -471,16 +471,16 @@ discard block |
||
| 471 | 471 | // commit |
| 472 | 472 | $oDB->commit(); |
| 473 | 473 | |
| 474 | - if(!$manual_inserted) |
|
| 474 | + if (!$manual_inserted) |
|
| 475 | 475 | { |
| 476 | 476 | // send a message if notify_message option in enabled in the original article |
| 477 | 477 | $oDocument->notify(Context::getLang('comment'), $obj->content); |
| 478 | 478 | |
| 479 | 479 | // send a message if notify_message option in enabled in the original comment |
| 480 | - if($obj->parent_srl) |
|
| 480 | + if ($obj->parent_srl) |
|
| 481 | 481 | { |
| 482 | 482 | $oParent = $oCommentModel->getComment($obj->parent_srl); |
| 483 | - if($oParent->get('member_srl') != $oDocument->get('member_srl')) |
|
| 483 | + if ($oParent->get('member_srl') != $oDocument->get('member_srl')) |
|
| 484 | 484 | { |
| 485 | 485 | $oParent->notify(Context::getLang('comment'), $obj->content); |
| 486 | 486 | } |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | $oDocument = $oDocumentModel->getDocument($obj->document_srl); |
| 509 | 509 | |
| 510 | 510 | $oMemberModel = getModel("member"); |
| 511 | - if(isset($obj->member_srl) && !is_null($obj->member_srl)) |
|
| 511 | + if (isset($obj->member_srl) && !is_null($obj->member_srl)) |
|
| 512 | 512 | { |
| 513 | 513 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($obj->member_srl); |
| 514 | 514 | } |
@@ -528,47 +528,47 @@ discard block |
||
| 528 | 528 | $module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl); |
| 529 | 529 | |
| 530 | 530 | // If there is no problem to register comment then send an email to all admin were set in module admin panel |
| 531 | - if($module_info->admin_mail && $member_info->is_admin != 'Y') |
|
| 531 | + if ($module_info->admin_mail && $member_info->is_admin != 'Y') |
|
| 532 | 532 | { |
| 533 | 533 | $oMail = new Mail(); |
| 534 | 534 | $oMail->setSender($obj->email_address, $obj->email_address); |
| 535 | - $mail_title = "[XE - " . Context::get('mid') . "] A new comment was posted on document: \"" . $oDocument->getTitleText() . "\""; |
|
| 535 | + $mail_title = "[XE - ".Context::get('mid')."] A new comment was posted on document: \"".$oDocument->getTitleText()."\""; |
|
| 536 | 536 | $oMail->setTitle($mail_title); |
| 537 | - $url_comment = getFullUrl('','document_srl',$obj->document_srl).'#comment_'.$obj->comment_srl; |
|
| 538 | - if($using_validation) |
|
| 537 | + $url_comment = getFullUrl('', 'document_srl', $obj->document_srl).'#comment_'.$obj->comment_srl; |
|
| 538 | + if ($using_validation) |
|
| 539 | 539 | { |
| 540 | 540 | $url_approve = getFullUrl('', 'module', 'admin', 'act', 'procCommentAdminChangePublishedStatusChecked', 'cart[]', $obj->comment_srl, 'will_publish', '1', 'search_target', 'is_published', 'search_keyword', 'N'); |
| 541 | 541 | $url_trash = getFullUrl('', 'module', 'admin', 'act', 'procCommentAdminDeleteChecked', 'cart[]', $obj->comment_srl, 'search_target', 'is_trash', 'search_keyword', 'true'); |
| 542 | 542 | $mail_content = " |
| 543 | - A new comment on the document \"" . $oDocument->getTitleText() . "\" is waiting for your approval. |
|
| 543 | + A new comment on the document \"" . $oDocument->getTitleText()."\" is waiting for your approval. |
|
| 544 | 544 | <br /> |
| 545 | 545 | <br /> |
| 546 | - Author: " . $member_info->nick_name . " |
|
| 547 | - <br />Author e-mail: " . $member_info->email_address . " |
|
| 548 | - <br />From : <a href=\"" . $url_comment . "\">" . $url_comment . "</a> |
|
| 546 | + Author: " . $member_info->nick_name." |
|
| 547 | + <br />Author e-mail: " . $member_info->email_address." |
|
| 548 | + <br />From : <a href=\"" . $url_comment."\">".$url_comment."</a> |
|
| 549 | 549 | <br />Comment: |
| 550 | - <br />\"" . $obj->content . "\" |
|
| 550 | + <br />\"" . $obj->content."\" |
|
| 551 | 551 | <br />Document: |
| 552 | - <br />\"" . $oDocument->getContentText(). "\" |
|
| 552 | + <br />\"" . $oDocument->getContentText()."\" |
|
| 553 | 553 | <br /> |
| 554 | 554 | <br /> |
| 555 | - Approve it: <a href=\"" . $url_approve . "\">" . $url_approve . "</a> |
|
| 556 | - <br />Trash it: <a href=\"" . $url_trash . "\">" . $url_trash . "</a> |
|
| 557 | - <br />Currently " . $nr_comments_not_approved . " comments on \"" . Context::get('mid') . "\" module are waiting for approval. Please visit the moderation panel: |
|
| 558 | - <br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "\">" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "</a> |
|
| 555 | + Approve it: <a href=\"" . $url_approve."\">".$url_approve."</a> |
|
| 556 | + <br />Trash it: <a href=\"" . $url_trash."\">".$url_trash."</a> |
|
| 557 | + <br />Currently " . $nr_comments_not_approved." comments on \"".Context::get('mid')."\" module are waiting for approval. Please visit the moderation panel: |
|
| 558 | + <br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl)."\">".getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl)."</a> |
|
| 559 | 559 | "; |
| 560 | 560 | $oMail->setContent($mail_content); |
| 561 | 561 | } |
| 562 | 562 | else |
| 563 | 563 | { |
| 564 | 564 | $mail_content = " |
| 565 | - Author: " . $member_info->nick_name . " |
|
| 566 | - <br />Author e-mail: " . $member_info->email_address . " |
|
| 567 | - <br />From : <a href=\"" . $url_comment . "\">" . $url_comment . "</a> |
|
| 565 | + Author: " . $member_info->nick_name." |
|
| 566 | + <br />Author e-mail: " . $member_info->email_address." |
|
| 567 | + <br />From : <a href=\"" . $url_comment."\">".$url_comment."</a> |
|
| 568 | 568 | <br />Comment: |
| 569 | - <br />\"" . $obj->content . "\" |
|
| 569 | + <br />\"" . $obj->content."\" |
|
| 570 | 570 | <br />Document: |
| 571 | - <br />\"" . $oDocument->getContentText(). "\" |
|
| 571 | + <br />\"" . $oDocument->getContentText()."\" |
|
| 572 | 572 | "; |
| 573 | 573 | $oMail->setContent($mail_content); |
| 574 | 574 | |
@@ -597,10 +597,10 @@ discard block |
||
| 597 | 597 | $target_mail = explode(',', $admins_emails); |
| 598 | 598 | |
| 599 | 599 | // send email to all admins - START |
| 600 | - for($i = 0; $i < count($target_mail); $i++) |
|
| 600 | + for ($i = 0; $i < count($target_mail); $i++) |
|
| 601 | 601 | { |
| 602 | 602 | $email_address = trim($target_mail[$i]); |
| 603 | - if(!$email_address) |
|
| 603 | + if (!$email_address) |
|
| 604 | 604 | { |
| 605 | 605 | continue; |
| 606 | 606 | } |
@@ -646,12 +646,12 @@ discard block |
||
| 646 | 646 | */ |
| 647 | 647 | function updateComment($obj, $is_admin = FALSE, $manual_updated = FALSE) |
| 648 | 648 | { |
| 649 | - if(!$manual_updated && !checkCSRF()) |
|
| 649 | + if (!$manual_updated && !checkCSRF()) |
|
| 650 | 650 | { |
| 651 | 651 | return new BaseObject(-1, 'msg_invalid_request'); |
| 652 | 652 | } |
| 653 | 653 | |
| 654 | - if(!is_object($obj)) |
|
| 654 | + if (!is_object($obj)) |
|
| 655 | 655 | { |
| 656 | 656 | $obj = new stdClass(); |
| 657 | 657 | } |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | // call a trigger (before) |
| 662 | 662 | $output = ModuleHandler::triggerCall('comment.updateComment', 'before', $obj); |
| 663 | - if(!$output->toBool()) |
|
| 663 | + if (!$output->toBool()) |
|
| 664 | 664 | { |
| 665 | 665 | return $output; |
| 666 | 666 | } |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | |
| 671 | 671 | // get the original data |
| 672 | 672 | $source_obj = $oCommentModel->getComment($obj->comment_srl); |
| 673 | - if(!$source_obj->getMemberSrl()) |
|
| 673 | + if (!$source_obj->getMemberSrl()) |
|
| 674 | 674 | { |
| 675 | 675 | $obj->member_srl = $source_obj->get('member_srl'); |
| 676 | 676 | $obj->user_name = $source_obj->get('user_name'); |
@@ -680,30 +680,30 @@ discard block |
||
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | // check if permission is granted |
| 683 | - if(!$is_admin && !$source_obj->isGranted()) |
|
| 683 | + if (!$is_admin && !$source_obj->isGranted()) |
|
| 684 | 684 | { |
| 685 | 685 | return new BaseObject(-1, 'msg_not_permitted'); |
| 686 | 686 | } |
| 687 | 687 | |
| 688 | - if($obj->password) |
|
| 688 | + if ($obj->password) |
|
| 689 | 689 | { |
| 690 | 690 | $obj->password = getModel('member')->hashPassword($obj->password); |
| 691 | 691 | } |
| 692 | 692 | |
| 693 | - if($obj->homepage) |
|
| 693 | + if ($obj->homepage) |
|
| 694 | 694 | { |
| 695 | 695 | $obj->homepage = removeHackTag($obj->homepage); |
| 696 | - if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage)) |
|
| 696 | + if (!preg_match('/^[a-z]+:\/\//i', $obj->homepage)) |
|
| 697 | 697 | { |
| 698 | 698 | $obj->homepage = 'http://'.$obj->homepage; |
| 699 | 699 | } |
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | // set modifier's information if logged-in and posting author and modifier are matched. |
| 703 | - if(Context::get('is_logged')) |
|
| 703 | + if (Context::get('is_logged')) |
|
| 704 | 704 | { |
| 705 | 705 | $logged_info = Context::get('logged_info'); |
| 706 | - if($source_obj->member_srl == $logged_info->member_srl) |
|
| 706 | + if ($source_obj->member_srl == $logged_info->member_srl) |
|
| 707 | 707 | { |
| 708 | 708 | $obj->member_srl = $logged_info->member_srl; |
| 709 | 709 | $obj->user_name = $logged_info->user_name; |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | // if nick_name of the logged-in author doesn't exist |
| 717 | - if($source_obj->get('member_srl') && !$obj->nick_name) |
|
| 717 | + if ($source_obj->get('member_srl') && !$obj->nick_name) |
|
| 718 | 718 | { |
| 719 | 719 | $obj->member_srl = $source_obj->get('member_srl'); |
| 720 | 720 | $obj->user_name = $source_obj->get('user_name'); |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | $obj->homepage = $source_obj->get('homepage'); |
| 724 | 724 | } |
| 725 | 725 | |
| 726 | - if(!$obj->content) |
|
| 726 | + if (!$obj->content) |
|
| 727 | 727 | { |
| 728 | 728 | $obj->content = $source_obj->get('content'); |
| 729 | 729 | } |
@@ -731,9 +731,9 @@ discard block |
||
| 731 | 731 | // remove XE's wn tags from contents |
| 732 | 732 | $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); |
| 733 | 733 | |
| 734 | - if(Mobile::isFromMobilePhone() && $obj->use_editor != 'Y') |
|
| 734 | + if (Mobile::isFromMobilePhone() && $obj->use_editor != 'Y') |
|
| 735 | 735 | { |
| 736 | - if($obj->use_html != 'Y') |
|
| 736 | + if ($obj->use_html != 'Y') |
|
| 737 | 737 | { |
| 738 | 738 | $obj->content = htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 739 | 739 | } |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | } |
| 742 | 742 | |
| 743 | 743 | // remove iframe and script if not a top administrator on the session |
| 744 | - if($logged_info->is_admin != 'Y') |
|
| 744 | + if ($logged_info->is_admin != 'Y') |
|
| 745 | 745 | { |
| 746 | 746 | $obj->content = removeHackTag($obj->content); |
| 747 | 747 | } |
@@ -752,17 +752,17 @@ discard block |
||
| 752 | 752 | |
| 753 | 753 | // Update |
| 754 | 754 | $output = executeQuery('comment.updateComment', $obj); |
| 755 | - if(!$output->toBool()) |
|
| 755 | + if (!$output->toBool()) |
|
| 756 | 756 | { |
| 757 | 757 | $oDB->rollback(); |
| 758 | 758 | return $output; |
| 759 | 759 | } |
| 760 | 760 | |
| 761 | 761 | // call a trigger (after) |
| 762 | - if($output->toBool()) |
|
| 762 | + if ($output->toBool()) |
|
| 763 | 763 | { |
| 764 | 764 | $trigger_output = ModuleHandler::triggerCall('comment.updateComment', 'after', $obj); |
| 765 | - if(!$trigger_output->toBool()) |
|
| 765 | + if (!$trigger_output->toBool()) |
|
| 766 | 766 | { |
| 767 | 767 | $oDB->rollback(); |
| 768 | 768 | return $trigger_output; |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | |
| 792 | 792 | // check if comment already exists |
| 793 | 793 | $comment = $oCommentModel->getComment($comment_srl); |
| 794 | - if($comment->comment_srl != $comment_srl) |
|
| 794 | + if ($comment->comment_srl != $comment_srl) |
|
| 795 | 795 | { |
| 796 | 796 | return new BaseObject(-1, 'msg_invalid_request'); |
| 797 | 797 | } |
@@ -800,28 +800,28 @@ discard block |
||
| 800 | 800 | |
| 801 | 801 | // call a trigger (before) |
| 802 | 802 | $output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment); |
| 803 | - if(!$output->toBool()) |
|
| 803 | + if (!$output->toBool()) |
|
| 804 | 804 | { |
| 805 | 805 | return $output; |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | // check if permission is granted |
| 809 | - if(!$is_admin && !$comment->isGranted()) |
|
| 809 | + if (!$is_admin && !$comment->isGranted()) |
|
| 810 | 810 | { |
| 811 | 811 | return new BaseObject(-1, 'msg_not_permitted'); |
| 812 | 812 | } |
| 813 | 813 | |
| 814 | 814 | // check if child comment exists on the comment |
| 815 | 815 | $childs = $oCommentModel->getChildComments($comment_srl); |
| 816 | - if(count($childs) > 0) |
|
| 816 | + if (count($childs) > 0) |
|
| 817 | 817 | { |
| 818 | 818 | $deleteAllComment = TRUE; |
| 819 | - if(!$is_admin) |
|
| 819 | + if (!$is_admin) |
|
| 820 | 820 | { |
| 821 | 821 | $logged_info = Context::get('logged_info'); |
| 822 | - foreach($childs as $val) |
|
| 822 | + foreach ($childs as $val) |
|
| 823 | 823 | { |
| 824 | - if($val->member_srl != $logged_info->member_srl) |
|
| 824 | + if ($val->member_srl != $logged_info->member_srl) |
|
| 825 | 825 | { |
| 826 | 826 | $deleteAllComment = FALSE; |
| 827 | 827 | break; |
@@ -829,16 +829,16 @@ discard block |
||
| 829 | 829 | } |
| 830 | 830 | } |
| 831 | 831 | |
| 832 | - if(!$deleteAllComment) |
|
| 832 | + if (!$deleteAllComment) |
|
| 833 | 833 | { |
| 834 | 834 | return new BaseObject(-1, 'fail_to_delete_have_children'); |
| 835 | 835 | } |
| 836 | 836 | else |
| 837 | 837 | { |
| 838 | - foreach($childs as $val) |
|
| 838 | + foreach ($childs as $val) |
|
| 839 | 839 | { |
| 840 | 840 | $output = $this->deleteComment($val->comment_srl, $is_admin, $isMoveToTrash); |
| 841 | - if(!$output->toBool()) |
|
| 841 | + if (!$output->toBool()) |
|
| 842 | 842 | { |
| 843 | 843 | return $output; |
| 844 | 844 | } |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | $args = new stdClass(); |
| 855 | 855 | $args->comment_srl = $comment_srl; |
| 856 | 856 | $output = executeQuery('comment.deleteComment', $args); |
| 857 | - if(!$output->toBool()) |
|
| 857 | + if (!$output->toBool()) |
|
| 858 | 858 | { |
| 859 | 859 | $oDB->rollback(); |
| 860 | 860 | return $output; |
@@ -866,14 +866,14 @@ discard block |
||
| 866 | 866 | $comment_count = $oCommentModel->getCommentCount($document_srl); |
| 867 | 867 | |
| 868 | 868 | // only document is exists |
| 869 | - if(isset($comment_count)) |
|
| 869 | + if (isset($comment_count)) |
|
| 870 | 870 | { |
| 871 | 871 | // create the controller object of the document |
| 872 | 872 | $oDocumentController = getController('document'); |
| 873 | 873 | |
| 874 | 874 | // update comment count of the article posting |
| 875 | 875 | $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, NULL, FALSE); |
| 876 | - if(!$output->toBool()) |
|
| 876 | + if (!$output->toBool()) |
|
| 877 | 877 | { |
| 878 | 878 | $oDB->rollback(); |
| 879 | 879 | return $output; |
@@ -881,11 +881,11 @@ discard block |
||
| 881 | 881 | } |
| 882 | 882 | |
| 883 | 883 | // call a trigger (after) |
| 884 | - if($output->toBool()) |
|
| 884 | + if ($output->toBool()) |
|
| 885 | 885 | { |
| 886 | 886 | $comment->isMoveToTrash = $isMoveToTrash; |
| 887 | 887 | $trigger_output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment); |
| 888 | - if(!$trigger_output->toBool()) |
|
| 888 | + if (!$trigger_output->toBool()) |
|
| 889 | 889 | { |
| 890 | 890 | $oDB->rollback(); |
| 891 | 891 | return $trigger_output; |
@@ -893,7 +893,7 @@ discard block |
||
| 893 | 893 | unset($comment->isMoveToTrash); |
| 894 | 894 | } |
| 895 | 895 | |
| 896 | - if(!$isMoveToTrash) |
|
| 896 | + if (!$isMoveToTrash) |
|
| 897 | 897 | { |
| 898 | 898 | $this->_deleteDeclaredComments($args); |
| 899 | 899 | $this->_deleteVotedComments($args); |
@@ -937,7 +937,7 @@ discard block |
||
| 937 | 937 | $oCommentModel = getModel('comment'); |
| 938 | 938 | |
| 939 | 939 | // check if permission is granted |
| 940 | - if(is_object($obj)) |
|
| 940 | + if (is_object($obj)) |
|
| 941 | 941 | { |
| 942 | 942 | $oDocument = new documentItem(); |
| 943 | 943 | $oDocument->setAttribute($obj); |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 948 | 948 | } |
| 949 | 949 | |
| 950 | - if(!$oDocument->isExists() || !$oDocument->isGranted()) |
|
| 950 | + if (!$oDocument->isExists() || !$oDocument->isGranted()) |
|
| 951 | 951 | { |
| 952 | 952 | return new BaseObject(-1, 'msg_not_permitted'); |
| 953 | 953 | } |
@@ -956,23 +956,23 @@ discard block |
||
| 956 | 956 | $args = new stdClass(); |
| 957 | 957 | $args->document_srl = $document_srl; |
| 958 | 958 | $comments = executeQueryArray('comment.getAllComments', $args); |
| 959 | - if($comments->data) |
|
| 959 | + if ($comments->data) |
|
| 960 | 960 | { |
| 961 | 961 | $commentSrlList = array(); |
| 962 | - foreach($comments->data as $comment) |
|
| 962 | + foreach ($comments->data as $comment) |
|
| 963 | 963 | { |
| 964 | 964 | $commentSrlList[] = $comment->comment_srl; |
| 965 | 965 | |
| 966 | 966 | // call a trigger (before) |
| 967 | 967 | $output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment); |
| 968 | - if(!$output->toBool()) |
|
| 968 | + if (!$output->toBool()) |
|
| 969 | 969 | { |
| 970 | 970 | continue; |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | // call a trigger (after) |
| 974 | 974 | $output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment); |
| 975 | - if(!$output->toBool()) |
|
| 975 | + if (!$output->toBool()) |
|
| 976 | 976 | { |
| 977 | 977 | continue; |
| 978 | 978 | } |
@@ -982,7 +982,7 @@ discard block |
||
| 982 | 982 | // delete the comment |
| 983 | 983 | $args->document_srl = $document_srl; |
| 984 | 984 | $output = executeQuery('comment.deleteComments', $args); |
| 985 | - if(!$output->toBool()) |
|
| 985 | + if (!$output->toBool()) |
|
| 986 | 986 | { |
| 987 | 987 | return $output; |
| 988 | 988 | } |
@@ -991,7 +991,7 @@ discard block |
||
| 991 | 991 | $output = executeQuery('comment.deleteCommentsList', $args); |
| 992 | 992 | |
| 993 | 993 | //delete declared, declared_log, voted_log |
| 994 | - if(is_array($commentSrlList) && count($commentSrlList) > 0) |
|
| 994 | + if (is_array($commentSrlList) && count($commentSrlList) > 0) |
|
| 995 | 995 | { |
| 996 | 996 | $args = new stdClass(); |
| 997 | 997 | $args->comment_srl = join(',', $commentSrlList); |
@@ -1031,7 +1031,7 @@ discard block |
||
| 1031 | 1031 | */ |
| 1032 | 1032 | function updateVotedCount($comment_srl, $point = 1) |
| 1033 | 1033 | { |
| 1034 | - if($point > 0) |
|
| 1034 | + if ($point > 0) |
|
| 1035 | 1035 | { |
| 1036 | 1036 | $failed_voted = 'failed_voted'; |
| 1037 | 1037 | $success_message = 'success_voted'; |
@@ -1043,7 +1043,7 @@ discard block |
||
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | 1045 | // invalid vote if vote info exists in the session info. |
| 1046 | - if($_SESSION['voted_comment'][$comment_srl]) |
|
| 1046 | + if ($_SESSION['voted_comment'][$comment_srl]) |
|
| 1047 | 1047 | { |
| 1048 | 1048 | return new BaseObject(-1, $failed_voted); |
| 1049 | 1049 | } |
@@ -1052,21 +1052,21 @@ discard block |
||
| 1052 | 1052 | $oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE); |
| 1053 | 1053 | |
| 1054 | 1054 | // invalid vote if both ip addresses between author's and the current user are same. |
| 1055 | - if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) |
|
| 1055 | + if ($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) |
|
| 1056 | 1056 | { |
| 1057 | 1057 | $_SESSION['voted_comment'][$comment_srl] = TRUE; |
| 1058 | 1058 | return new BaseObject(-1, $failed_voted); |
| 1059 | 1059 | } |
| 1060 | 1060 | |
| 1061 | 1061 | // if the comment author is a member |
| 1062 | - if($oComment->get('member_srl')) |
|
| 1062 | + if ($oComment->get('member_srl')) |
|
| 1063 | 1063 | { |
| 1064 | 1064 | // create the member model object |
| 1065 | 1065 | $oMemberModel = getModel('member'); |
| 1066 | 1066 | $member_srl = $oMemberModel->getLoggedMemberSrl(); |
| 1067 | 1067 | |
| 1068 | 1068 | // session registered if the author information matches to the current logged-in user's. |
| 1069 | - if($member_srl && $member_srl == abs($oComment->get('member_srl'))) |
|
| 1069 | + if ($member_srl && $member_srl == abs($oComment->get('member_srl'))) |
|
| 1070 | 1070 | { |
| 1071 | 1071 | $_SESSION['voted_comment'][$comment_srl] = TRUE; |
| 1072 | 1072 | return new BaseObject(-1, $failed_voted); |
@@ -1076,7 +1076,7 @@ discard block |
||
| 1076 | 1076 | $args = new stdClass(); |
| 1077 | 1077 | |
| 1078 | 1078 | // If logged-in, use the member_srl. otherwise use the ipaddress. |
| 1079 | - if($member_srl) |
|
| 1079 | + if ($member_srl) |
|
| 1080 | 1080 | { |
| 1081 | 1081 | $args->member_srl = $member_srl; |
| 1082 | 1082 | } |
@@ -1089,7 +1089,7 @@ discard block |
||
| 1089 | 1089 | $output = executeQuery('comment.getCommentVotedLogInfo', $args); |
| 1090 | 1090 | |
| 1091 | 1091 | // session registered if log info contains recommendation vote log. |
| 1092 | - if($output->data->count) |
|
| 1092 | + if ($output->data->count) |
|
| 1093 | 1093 | { |
| 1094 | 1094 | $_SESSION['voted_comment'][$comment_srl] = TRUE; |
| 1095 | 1095 | return new BaseObject(-1, $failed_voted); |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | $oDB->begin(); |
| 1101 | 1101 | |
| 1102 | 1102 | // update the number of votes |
| 1103 | - if($point < 0) |
|
| 1103 | + if ($point < 0) |
|
| 1104 | 1104 | { |
| 1105 | 1105 | $args->blamed_count = $oComment->get('blamed_count') + $point; |
| 1106 | 1106 | $output = executeQuery('comment.updateBlamedCount', $args); |
@@ -1124,7 +1124,7 @@ discard block |
||
| 1124 | 1124 | $obj->before_point = ($point < 0) ? $oComment->get('blamed_count') : $oComment->get('voted_count'); |
| 1125 | 1125 | $obj->after_point = ($point < 0) ? $args->blamed_count : $args->voted_count; |
| 1126 | 1126 | $trigger_output = ModuleHandler::triggerCall('comment.updateVotedCount', 'after', $obj); |
| 1127 | - if(!$trigger_output->toBool()) |
|
| 1127 | + if (!$trigger_output->toBool()) |
|
| 1128 | 1128 | { |
| 1129 | 1129 | $oDB->rollback(); |
| 1130 | 1130 | return $trigger_output; |
@@ -1137,7 +1137,7 @@ discard block |
||
| 1137 | 1137 | |
| 1138 | 1138 | // Return the result |
| 1139 | 1139 | $output = new BaseObject(0, $success_message); |
| 1140 | - if($point > 0) |
|
| 1140 | + if ($point > 0) |
|
| 1141 | 1141 | { |
| 1142 | 1142 | $output->add('voted_count', $obj->after_point); |
| 1143 | 1143 | } |
@@ -1157,7 +1157,7 @@ discard block |
||
| 1157 | 1157 | function declaredComment($comment_srl) |
| 1158 | 1158 | { |
| 1159 | 1159 | // Fail if session information already has a reported document |
| 1160 | - if($_SESSION['declared_comment'][$comment_srl]) |
|
| 1160 | + if ($_SESSION['declared_comment'][$comment_srl]) |
|
| 1161 | 1161 | { |
| 1162 | 1162 | return new BaseObject(-1, 'failed_declared'); |
| 1163 | 1163 | } |
@@ -1166,7 +1166,7 @@ discard block |
||
| 1166 | 1166 | $args = new stdClass(); |
| 1167 | 1167 | $args->comment_srl = $comment_srl; |
| 1168 | 1168 | $output = executeQuery('comment.getDeclaredComment', $args); |
| 1169 | - if(!$output->toBool()) |
|
| 1169 | + if (!$output->toBool()) |
|
| 1170 | 1170 | { |
| 1171 | 1171 | return $output; |
| 1172 | 1172 | } |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | |
| 1179 | 1179 | // Call a trigger (before) |
| 1180 | 1180 | $trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'before', $trigger_obj); |
| 1181 | - if(!$trigger_output->toBool()) |
|
| 1181 | + if (!$trigger_output->toBool()) |
|
| 1182 | 1182 | { |
| 1183 | 1183 | return $trigger_output; |
| 1184 | 1184 | } |
@@ -1188,21 +1188,21 @@ discard block |
||
| 1188 | 1188 | $oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE); |
| 1189 | 1189 | |
| 1190 | 1190 | // failed if both ip addresses between author's and the current user are same. |
| 1191 | - if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) |
|
| 1191 | + if ($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) |
|
| 1192 | 1192 | { |
| 1193 | 1193 | $_SESSION['declared_comment'][$comment_srl] = TRUE; |
| 1194 | 1194 | return new BaseObject(-1, 'failed_declared'); |
| 1195 | 1195 | } |
| 1196 | 1196 | |
| 1197 | 1197 | // if the comment author is a member |
| 1198 | - if($oComment->get('member_srl')) |
|
| 1198 | + if ($oComment->get('member_srl')) |
|
| 1199 | 1199 | { |
| 1200 | 1200 | // create the member model object |
| 1201 | 1201 | $oMemberModel = getModel('member'); |
| 1202 | 1202 | $member_srl = $oMemberModel->getLoggedMemberSrl(); |
| 1203 | 1203 | |
| 1204 | 1204 | // session registered if the author information matches to the current logged-in user's. |
| 1205 | - if($member_srl && $member_srl == abs($oComment->get('member_srl'))) |
|
| 1205 | + if ($member_srl && $member_srl == abs($oComment->get('member_srl'))) |
|
| 1206 | 1206 | { |
| 1207 | 1207 | $_SESSION['declared_comment'][$comment_srl] = TRUE; |
| 1208 | 1208 | return new BaseObject(-1, 'failed_declared'); |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | } |
| 1211 | 1211 | |
| 1212 | 1212 | // If logged-in, use the member_srl. otherwise use the ipaddress. |
| 1213 | - if($member_srl) |
|
| 1213 | + if ($member_srl) |
|
| 1214 | 1214 | { |
| 1215 | 1215 | $args->member_srl = $member_srl; |
| 1216 | 1216 | } |
@@ -1222,7 +1222,7 @@ discard block |
||
| 1222 | 1222 | $log_output = executeQuery('comment.getCommentDeclaredLogInfo', $args); |
| 1223 | 1223 | |
| 1224 | 1224 | // session registered if log info contains report log. |
| 1225 | - if($log_output->data->count) |
|
| 1225 | + if ($log_output->data->count) |
|
| 1226 | 1226 | { |
| 1227 | 1227 | $_SESSION['declared_comment'][$comment_srl] = TRUE; |
| 1228 | 1228 | return new BaseObject(-1, 'failed_declared'); |
@@ -1233,7 +1233,7 @@ discard block |
||
| 1233 | 1233 | $oDB->begin(); |
| 1234 | 1234 | |
| 1235 | 1235 | // execute insert |
| 1236 | - if($output->data->declared_count > 0) |
|
| 1236 | + if ($output->data->declared_count > 0) |
|
| 1237 | 1237 | { |
| 1238 | 1238 | $output = executeQuery('comment.updateDeclaredComment', $args); |
| 1239 | 1239 | } |
@@ -1242,7 +1242,7 @@ discard block |
||
| 1242 | 1242 | $output = executeQuery('comment.insertDeclaredComment', $args); |
| 1243 | 1243 | } |
| 1244 | 1244 | |
| 1245 | - if(!$output->toBool()) |
|
| 1245 | + if (!$output->toBool()) |
|
| 1246 | 1246 | { |
| 1247 | 1247 | $oDB->rollback(); |
| 1248 | 1248 | return $output; |
@@ -1254,7 +1254,7 @@ discard block |
||
| 1254 | 1254 | // Call a trigger (after) |
| 1255 | 1255 | $trigger_obj->declared_count = $declared_count + 1; |
| 1256 | 1256 | $trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'after', $trigger_obj); |
| 1257 | - if(!$trigger_output->toBool()) |
|
| 1257 | + if (!$trigger_output->toBool()) |
|
| 1258 | 1258 | { |
| 1259 | 1259 | $oDB->rollback(); |
| 1260 | 1260 | return $trigger_output; |
@@ -1279,7 +1279,7 @@ discard block |
||
| 1279 | 1279 | function addCommentPopupMenu($url, $str, $icon = '', $target = 'self') |
| 1280 | 1280 | { |
| 1281 | 1281 | $comment_popup_menu_list = Context::get('comment_popup_menu_list'); |
| 1282 | - if(!is_array($comment_popup_menu_list)) |
|
| 1282 | + if (!is_array($comment_popup_menu_list)) |
|
| 1283 | 1283 | { |
| 1284 | 1284 | $comment_popup_menu_list = array(); |
| 1285 | 1285 | } |
@@ -1301,7 +1301,7 @@ discard block |
||
| 1301 | 1301 | function procCommentInsertModuleConfig() |
| 1302 | 1302 | { |
| 1303 | 1303 | $module_srl = Context::get('target_module_srl'); |
| 1304 | - if(preg_match('/^([0-9,]+)$/', $module_srl)) |
|
| 1304 | + if (preg_match('/^([0-9,]+)$/', $module_srl)) |
|
| 1305 | 1305 | { |
| 1306 | 1306 | $module_srl = explode(',', $module_srl); |
| 1307 | 1307 | } |
@@ -1312,33 +1312,33 @@ discard block |
||
| 1312 | 1312 | |
| 1313 | 1313 | $comment_config = new stdClass(); |
| 1314 | 1314 | $comment_config->comment_count = (int) Context::get('comment_count'); |
| 1315 | - if(!$comment_config->comment_count) |
|
| 1315 | + if (!$comment_config->comment_count) |
|
| 1316 | 1316 | { |
| 1317 | 1317 | $comment_config->comment_count = 50; |
| 1318 | 1318 | } |
| 1319 | 1319 | |
| 1320 | 1320 | $comment_config->use_vote_up = Context::get('use_vote_up'); |
| 1321 | - if(!$comment_config->use_vote_up) |
|
| 1321 | + if (!$comment_config->use_vote_up) |
|
| 1322 | 1322 | { |
| 1323 | 1323 | $comment_config->use_vote_up = 'Y'; |
| 1324 | 1324 | } |
| 1325 | 1325 | |
| 1326 | 1326 | $comment_config->use_vote_down = Context::get('use_vote_down'); |
| 1327 | - if(!$comment_config->use_vote_down) |
|
| 1327 | + if (!$comment_config->use_vote_down) |
|
| 1328 | 1328 | { |
| 1329 | 1329 | $comment_config->use_vote_down = 'Y'; |
| 1330 | 1330 | } |
| 1331 | 1331 | |
| 1332 | 1332 | $comment_config->use_comment_validation = Context::get('use_comment_validation'); |
| 1333 | - if(!$comment_config->use_comment_validation) |
|
| 1333 | + if (!$comment_config->use_comment_validation) |
|
| 1334 | 1334 | { |
| 1335 | 1335 | $comment_config->use_comment_validation = 'N'; |
| 1336 | 1336 | } |
| 1337 | 1337 | |
| 1338 | - for($i = 0; $i < count($module_srl); $i++) |
|
| 1338 | + for ($i = 0; $i < count($module_srl); $i++) |
|
| 1339 | 1339 | { |
| 1340 | 1340 | $srl = trim($module_srl[$i]); |
| 1341 | - if(!$srl) |
|
| 1341 | + if (!$srl) |
|
| 1342 | 1342 | { |
| 1343 | 1343 | continue; |
| 1344 | 1344 | } |
@@ -1372,25 +1372,25 @@ discard block |
||
| 1372 | 1372 | */ |
| 1373 | 1373 | function procCommentGetList() |
| 1374 | 1374 | { |
| 1375 | - if(!Context::get('is_logged')) |
|
| 1375 | + if (!Context::get('is_logged')) |
|
| 1376 | 1376 | { |
| 1377 | 1377 | return new BaseObject(-1, 'msg_not_permitted'); |
| 1378 | 1378 | } |
| 1379 | 1379 | |
| 1380 | 1380 | $commentSrls = Context::get('comment_srls'); |
| 1381 | - if($commentSrls) |
|
| 1381 | + if ($commentSrls) |
|
| 1382 | 1382 | { |
| 1383 | 1383 | $commentSrlList = explode(',', $commentSrls); |
| 1384 | 1384 | } |
| 1385 | 1385 | |
| 1386 | - if(count($commentSrlList) > 0) |
|
| 1386 | + if (count($commentSrlList) > 0) |
|
| 1387 | 1387 | { |
| 1388 | 1388 | $oCommentModel = getModel('comment'); |
| 1389 | 1389 | $commentList = $oCommentModel->getComments($commentSrlList); |
| 1390 | 1390 | |
| 1391 | - if(is_array($commentList)) |
|
| 1391 | + if (is_array($commentList)) |
|
| 1392 | 1392 | { |
| 1393 | - foreach($commentList as $value) |
|
| 1393 | + foreach ($commentList as $value) |
|
| 1394 | 1394 | { |
| 1395 | 1395 | $value->content = strip_tags($value->content); |
| 1396 | 1396 | } |
@@ -1415,9 +1415,9 @@ discard block |
||
| 1415 | 1415 | $commentConfig = $oModuleModel->getModulePartConfig('comment', $obj->originModuleSrl); |
| 1416 | 1416 | |
| 1417 | 1417 | $oModuleController = getController('module'); |
| 1418 | - if(is_array($obj->moduleSrlList)) |
|
| 1418 | + if (is_array($obj->moduleSrlList)) |
|
| 1419 | 1419 | { |
| 1420 | - foreach($obj->moduleSrlList as $moduleSrl) |
|
| 1420 | + foreach ($obj->moduleSrlList as $moduleSrl) |
|
| 1421 | 1421 | { |
| 1422 | 1422 | $oModuleController->insertModulePartConfig('comment', $moduleSrl, $commentConfig); |
| 1423 | 1423 | } |
@@ -211,14 +211,12 @@ discard block |
||
| 211 | 211 | if($logged_info->is_admin == 'Y') |
| 212 | 212 | { |
| 213 | 213 | $is_admin = TRUE; |
| 214 | - } |
|
| 215 | - else |
|
| 214 | + } else |
|
| 216 | 215 | { |
| 217 | 216 | $is_admin = FALSE; |
| 218 | 217 | } |
| 219 | 218 | } |
| 220 | - } |
|
| 221 | - else |
|
| 219 | + } else |
|
| 222 | 220 | { |
| 223 | 221 | $is_admin = FALSE; |
| 224 | 222 | } |
@@ -226,14 +224,12 @@ discard block |
||
| 226 | 224 | if(!$using_validation) |
| 227 | 225 | { |
| 228 | 226 | $obj->status = 1; |
| 229 | - } |
|
| 230 | - else |
|
| 227 | + } else |
|
| 231 | 228 | { |
| 232 | 229 | if($is_admin) |
| 233 | 230 | { |
| 234 | 231 | $obj->status = 1; |
| 235 | - } |
|
| 236 | - else |
|
| 232 | + } else |
|
| 237 | 233 | { |
| 238 | 234 | $obj->status = 0; |
| 239 | 235 | } |
@@ -310,8 +306,7 @@ discard block |
||
| 310 | 306 | if(!$obj->comment_srl) |
| 311 | 307 | { |
| 312 | 308 | $obj->comment_srl = getNextSequence(); |
| 313 | - } |
|
| 314 | - elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) |
|
| 309 | + } elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) |
|
| 315 | 310 | { |
| 316 | 311 | return new BaseObject(-1, 'msg_not_permitted'); |
| 317 | 312 | } |
@@ -369,8 +364,7 @@ discard block |
||
| 369 | 364 | $list_args->head = $list_args->arrange = $obj->comment_srl; |
| 370 | 365 | $list_args->depth = 0; |
| 371 | 366 | // If parent comment exists, get information of the parent comment |
| 372 | - } |
|
| 373 | - else |
|
| 367 | + } else |
|
| 374 | 368 | { |
| 375 | 369 | // get information of the parent comment posting |
| 376 | 370 | $parent_args = new stdClass(); |
@@ -393,8 +387,7 @@ discard block |
||
| 393 | 387 | { |
| 394 | 388 | $list_args->arrange = $obj->comment_srl; |
| 395 | 389 | // if the depth of comments is greater than 2, execute update. |
| 396 | - } |
|
| 397 | - else |
|
| 390 | + } else |
|
| 398 | 391 | { |
| 399 | 392 | // get the top listed comment among those in lower depth and same head with parent's. |
| 400 | 393 | $p_args = new stdClass(); |
@@ -407,8 +400,7 @@ discard block |
||
| 407 | 400 | { |
| 408 | 401 | $list_args->arrange = $output->data->arrange; |
| 409 | 402 | $output = executeQuery('comment.updateCommentListArrange', $list_args); |
| 410 | - } |
|
| 411 | - else |
|
| 403 | + } else |
|
| 412 | 404 | { |
| 413 | 405 | $list_args->arrange = $obj->comment_srl; |
| 414 | 406 | } |
@@ -442,8 +434,7 @@ discard block |
||
| 442 | 434 | if(!$using_validation) |
| 443 | 435 | { |
| 444 | 436 | $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE); |
| 445 | - } |
|
| 446 | - else |
|
| 437 | + } else |
|
| 447 | 438 | { |
| 448 | 439 | if($is_admin) |
| 449 | 440 | { |
@@ -511,8 +502,7 @@ discard block |
||
| 511 | 502 | if(isset($obj->member_srl) && !is_null($obj->member_srl)) |
| 512 | 503 | { |
| 513 | 504 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($obj->member_srl); |
| 514 | - } |
|
| 515 | - else |
|
| 505 | + } else |
|
| 516 | 506 | { |
| 517 | 507 | $member_info = new stdClass(); |
| 518 | 508 | $member_info->is_admin = "N"; |
@@ -558,8 +548,7 @@ discard block |
||
| 558 | 548 | <br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "\">" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "</a> |
| 559 | 549 | "; |
| 560 | 550 | $oMail->setContent($mail_content); |
| 561 | - } |
|
| 562 | - else |
|
| 551 | + } else |
|
| 563 | 552 | { |
| 564 | 553 | $mail_content = " |
| 565 | 554 | Author: " . $member_info->nick_name . " |
@@ -832,8 +821,7 @@ discard block |
||
| 832 | 821 | if(!$deleteAllComment) |
| 833 | 822 | { |
| 834 | 823 | return new BaseObject(-1, 'fail_to_delete_have_children'); |
| 835 | - } |
|
| 836 | - else |
|
| 824 | + } else |
|
| 837 | 825 | { |
| 838 | 826 | foreach($childs as $val) |
| 839 | 827 | { |
@@ -897,8 +885,7 @@ discard block |
||
| 897 | 885 | { |
| 898 | 886 | $this->_deleteDeclaredComments($args); |
| 899 | 887 | $this->_deleteVotedComments($args); |
| 900 | - } |
|
| 901 | - else |
|
| 888 | + } else |
|
| 902 | 889 | { |
| 903 | 890 | $args = new stdClass(); |
| 904 | 891 | $args->upload_target_srl = $comment_srl; |
@@ -941,8 +928,7 @@ discard block |
||
| 941 | 928 | { |
| 942 | 929 | $oDocument = new documentItem(); |
| 943 | 930 | $oDocument->setAttribute($obj); |
| 944 | - } |
|
| 945 | - else |
|
| 931 | + } else |
|
| 946 | 932 | { |
| 947 | 933 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 948 | 934 | } |
@@ -1035,8 +1021,7 @@ discard block |
||
| 1035 | 1021 | { |
| 1036 | 1022 | $failed_voted = 'failed_voted'; |
| 1037 | 1023 | $success_message = 'success_voted'; |
| 1038 | - } |
|
| 1039 | - else |
|
| 1024 | + } else |
|
| 1040 | 1025 | { |
| 1041 | 1026 | $failed_voted = 'failed_blamed'; |
| 1042 | 1027 | $success_message = 'success_blamed'; |
@@ -1079,8 +1064,7 @@ discard block |
||
| 1079 | 1064 | if($member_srl) |
| 1080 | 1065 | { |
| 1081 | 1066 | $args->member_srl = $member_srl; |
| 1082 | - } |
|
| 1083 | - else |
|
| 1067 | + } else |
|
| 1084 | 1068 | { |
| 1085 | 1069 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
| 1086 | 1070 | } |
@@ -1104,8 +1088,7 @@ discard block |
||
| 1104 | 1088 | { |
| 1105 | 1089 | $args->blamed_count = $oComment->get('blamed_count') + $point; |
| 1106 | 1090 | $output = executeQuery('comment.updateBlamedCount', $args); |
| 1107 | - } |
|
| 1108 | - else |
|
| 1091 | + } else |
|
| 1109 | 1092 | { |
| 1110 | 1093 | $args->voted_count = $oComment->get('voted_count') + $point; |
| 1111 | 1094 | $output = executeQuery('comment.updateVotedCount', $args); |
@@ -1140,8 +1123,7 @@ discard block |
||
| 1140 | 1123 | if($point > 0) |
| 1141 | 1124 | { |
| 1142 | 1125 | $output->add('voted_count', $obj->after_point); |
| 1143 | - } |
|
| 1144 | - else |
|
| 1126 | + } else |
|
| 1145 | 1127 | { |
| 1146 | 1128 | $output->add('blamed_count', $obj->after_point); |
| 1147 | 1129 | } |
@@ -1213,8 +1195,7 @@ discard block |
||
| 1213 | 1195 | if($member_srl) |
| 1214 | 1196 | { |
| 1215 | 1197 | $args->member_srl = $member_srl; |
| 1216 | - } |
|
| 1217 | - else |
|
| 1198 | + } else |
|
| 1218 | 1199 | { |
| 1219 | 1200 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
| 1220 | 1201 | } |
@@ -1236,8 +1217,7 @@ discard block |
||
| 1236 | 1217 | if($output->data->declared_count > 0) |
| 1237 | 1218 | { |
| 1238 | 1219 | $output = executeQuery('comment.updateDeclaredComment', $args); |
| 1239 | - } |
|
| 1240 | - else |
|
| 1220 | + } else |
|
| 1241 | 1221 | { |
| 1242 | 1222 | $output = executeQuery('comment.insertDeclaredComment', $args); |
| 1243 | 1223 | } |
@@ -1304,8 +1284,7 @@ discard block |
||
| 1304 | 1284 | if(preg_match('/^([0-9,]+)$/', $module_srl)) |
| 1305 | 1285 | { |
| 1306 | 1286 | $module_srl = explode(',', $module_srl); |
| 1307 | - } |
|
| 1308 | - else |
|
| 1287 | + } else |
|
| 1309 | 1288 | { |
| 1310 | 1289 | $module_srl = array($module_srl); |
| 1311 | 1290 | } |
@@ -1395,8 +1374,7 @@ discard block |
||
| 1395 | 1374 | $value->content = strip_tags($value->content); |
| 1396 | 1375 | } |
| 1397 | 1376 | } |
| 1398 | - } |
|
| 1399 | - else |
|
| 1377 | + } else |
|
| 1400 | 1378 | { |
| 1401 | 1379 | global $lang; |
| 1402 | 1380 | $commentList = array(); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | /** |
| 25 | 25 | * Add a form fot comment setting on the additional setting of module |
| 26 | 26 | * @param string $obj |
| 27 | - * @return string |
|
| 27 | + * @return BaseObject |
|
| 28 | 28 | */ |
| 29 | 29 | function triggerDispCommentAdditionSetup(&$obj) |
| 30 | 30 | { |
@@ -31,12 +31,12 @@ discard block |
||
| 31 | 31 | $current_module_srl = Context::get('module_srl'); |
| 32 | 32 | $current_module_srls = Context::get('module_srls'); |
| 33 | 33 | |
| 34 | - if(!$current_module_srl && !$current_module_srls) |
|
| 34 | + if (!$current_module_srl && !$current_module_srls) |
|
| 35 | 35 | { |
| 36 | 36 | // get information of the selected module |
| 37 | 37 | $current_module_info = Context::get('current_module_info'); |
| 38 | 38 | $current_module_srl = $current_module_info->module_srl; |
| 39 | - if(!$current_module_srl) |
|
| 39 | + if (!$current_module_srl) |
|
| 40 | 40 | { |
| 41 | 41 | return new BaseObject(); |
| 42 | 42 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | // Set a template file |
| 56 | 56 | $oTemplate = TemplateHandler::getInstance(); |
| 57 | - $tpl = $oTemplate->compile($this->module_path . 'tpl', 'comment_module_config'); |
|
| 57 | + $tpl = $oTemplate->compile($this->module_path.'tpl', 'comment_module_config'); |
|
| 58 | 58 | $obj .= $tpl; |
| 59 | 59 | |
| 60 | 60 | return new BaseObject(); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Display message box |
| 37 | - * @return void|BaseObject (void : success, BaseObject : fail) |
|
| 37 | + * @return ModuleObject|null (void : success, BaseObject : fail) |
|
| 38 | 38 | */ |
| 39 | 39 | function dispCommunicationMessages() |
| 40 | 40 | { |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | 132 | * Display message sending |
| 133 | - * @return void|BaseObject (void : success, BaseObject : fail) |
|
| 133 | + * @return ModuleObject|null (void : success, BaseObject : fail) |
|
| 134 | 134 | */ |
| 135 | 135 | function dispCommunicationSendMessage() |
| 136 | 136 | { |