@@ -92,8 +92,7 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $this->createXeAdminMenu(); |
| 94 | 94 | $output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName); |
| 95 | - } |
|
| 96 | - else |
|
| 95 | + } else |
|
| 97 | 96 | { |
| 98 | 97 | if(!is_readable(FileHandler::getRealPath($output->php_file))) |
| 99 | 98 | { |
@@ -140,8 +139,7 @@ discard block |
||
| 140 | 139 | if($value == 'dashboard') |
| 141 | 140 | { |
| 142 | 141 | $args->url = 'index.php?module=admin'; |
| 143 | - } |
|
| 144 | - else |
|
| 142 | + } else |
|
| 145 | 143 | { |
| 146 | 144 | $args->url = '#'; |
| 147 | 145 | } |
@@ -449,8 +447,7 @@ discard block |
||
| 449 | 447 | if($parentMenu[$menuItem->parent_srl] == 'extensions') |
| 450 | 448 | { |
| 451 | 449 | $newParentItem = $newAdminParentMenuList['advanced']; |
| 452 | - } |
|
| 453 | - else |
|
| 450 | + } else |
|
| 454 | 451 | { |
| 455 | 452 | $newParentItem = $newAdminParentMenuList[$parentMenu[$menuItem->parent_srl]]; |
| 456 | 453 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | function checkUpdate() |
| 35 | 35 | { |
| 36 | 36 | $oDB = DB::getInstance(); |
| 37 | - if(!$oDB->isColumnExists("admin_favorite", "type")) |
|
| 37 | + if (!$oDB->isColumnExists("admin_favorite", "type")) |
|
| 38 | 38 | { |
| 39 | 39 | return TRUE; |
| 40 | 40 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | function moduleUpdate() |
| 50 | 50 | { |
| 51 | 51 | $oDB = DB::getInstance(); |
| 52 | - if(!$oDB->isColumnExists("admin_favorite", "type")) |
|
| 52 | + if (!$oDB->isColumnExists("admin_favorite", "type")) |
|
| 53 | 53 | { |
| 54 | 54 | $oAdminAdminModel = getAdminModel('admin'); |
| 55 | 55 | $output = $oAdminAdminModel->getFavoriteList(); |
@@ -58,11 +58,11 @@ discard block |
||
| 58 | 58 | $oDB->dropColumn('admin_favorite', 'admin_favorite_srl'); |
| 59 | 59 | $oDB->addColumn('admin_favorite', "admin_favorite_srl", "number", 11, 0); |
| 60 | 60 | $oDB->addColumn('admin_favorite', "type", "varchar", 30, 'module'); |
| 61 | - if(is_array($favoriteList)) |
|
| 61 | + if (is_array($favoriteList)) |
|
| 62 | 62 | { |
| 63 | 63 | $oAdminAdminController = getAdminController('admin'); |
| 64 | 64 | $oAdminAdminController->_deleteAllFavorite(); |
| 65 | - foreach($favoriteList AS $key => $value) |
|
| 65 | + foreach ($favoriteList AS $key => $value) |
|
| 66 | 66 | { |
| 67 | 67 | $oAdminAdminController->_insertFavorite($value->site_srl, $value->module); |
| 68 | 68 | } |
@@ -83,19 +83,19 @@ discard block |
||
| 83 | 83 | public function checkAdminMenu() |
| 84 | 84 | { |
| 85 | 85 | // for admin menu |
| 86 | - if(Context::isInstalled()) |
|
| 86 | + if (Context::isInstalled()) |
|
| 87 | 87 | { |
| 88 | 88 | $oMenuAdminModel = getAdminModel('menu'); |
| 89 | 89 | $output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName); |
| 90 | 90 | |
| 91 | - if(!$output->menu_srl) |
|
| 91 | + if (!$output->menu_srl) |
|
| 92 | 92 | { |
| 93 | 93 | $this->createXeAdminMenu(); |
| 94 | 94 | $output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName); |
| 95 | 95 | } |
| 96 | 96 | else |
| 97 | 97 | { |
| 98 | - if(!is_readable(FileHandler::getRealPath($output->php_file))) |
|
| 98 | + if (!is_readable(FileHandler::getRealPath($output->php_file))) |
|
| 99 | 99 | { |
| 100 | 100 | $oMenuAdminController = getAdminController('menu'); |
| 101 | 101 | $oMenuAdminController->makeXmlFile($output->menu_srl); |
@@ -130,14 +130,14 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | // gnb item create |
| 132 | 132 | $gnbList = array('dashboard', 'menu', 'user', 'content', 'configuration', 'advanced'); |
| 133 | - foreach($gnbList AS $key => $value) |
|
| 133 | + foreach ($gnbList AS $key => $value) |
|
| 134 | 134 | { |
| 135 | 135 | //insert menu item |
| 136 | 136 | $args = new stdClass(); |
| 137 | 137 | $args->menu_srl = $menuSrl; |
| 138 | 138 | $args->menu_item_srl = getNextSequence(); |
| 139 | - $args->name = '{$lang->menu_gnb[\'' . $value . '\']}'; |
|
| 140 | - if($value == 'dashboard') |
|
| 139 | + $args->name = '{$lang->menu_gnb[\''.$value.'\']}'; |
|
| 140 | + if ($value == 'dashboard') |
|
| 141 | 141 | { |
| 142 | 142 | $args->url = 'index.php?module=admin'; |
| 143 | 143 | } |
@@ -152,9 +152,9 @@ discard block |
||
| 152 | 152 | $oMenuAdminModel = getAdminModel('menu'); |
| 153 | 153 | $columnList = array('menu_item_srl', 'name'); |
| 154 | 154 | $output = $oMenuAdminModel->getMenuItems($menuSrl, 0, $columnList); |
| 155 | - if(is_array($output->data)) |
|
| 155 | + if (is_array($output->data)) |
|
| 156 | 156 | { |
| 157 | - foreach($output->data AS $key => $value) |
|
| 157 | + foreach ($output->data AS $key => $value) |
|
| 158 | 158 | { |
| 159 | 159 | preg_match('/\{\$lang->menu_gnb\[(.*?)\]\}/i', $value->name, $m); |
| 160 | 160 | $gnbDBList[$m[1]] = $value->menu_item_srl; |
@@ -265,20 +265,20 @@ discard block |
||
| 265 | 265 | $args->group_srls = $adminGroupSrl; |
| 266 | 266 | $oModuleModel = getModel('module'); |
| 267 | 267 | |
| 268 | - foreach($gnbModuleList AS $key => $value) |
|
| 268 | + foreach ($gnbModuleList AS $key => $value) |
|
| 269 | 269 | { |
| 270 | - if(is_array($value['subMenu'])) |
|
| 270 | + if (is_array($value['subMenu'])) |
|
| 271 | 271 | { |
| 272 | 272 | $moduleActionInfo = $oModuleModel->getModuleActionXml($value['module']); |
| 273 | - foreach($value['subMenu'] AS $key2 => $value2) |
|
| 273 | + foreach ($value['subMenu'] AS $key2 => $value2) |
|
| 274 | 274 | { |
| 275 | - $gnbKey = "'" . $this->_getGnbKey($value2) . "'"; |
|
| 275 | + $gnbKey = "'".$this->_getGnbKey($value2)."'"; |
|
| 276 | 276 | |
| 277 | 277 | //insert menu item |
| 278 | 278 | $args->menu_item_srl = getNextSequence(); |
| 279 | 279 | $args->parent_srl = $gnbDBList[$gnbKey]; |
| 280 | - $args->name = '{$lang->menu_gnb_sub[\'' . $value2 . '\']}'; |
|
| 281 | - $args->url = 'index.php?module=admin&act=' . $moduleActionInfo->menu->{$value2}->index; |
|
| 280 | + $args->name = '{$lang->menu_gnb_sub[\''.$value2.'\']}'; |
|
| 281 | + $args->url = 'index.php?module=admin&act='.$moduleActionInfo->menu->{$value2}->index; |
|
| 282 | 282 | $args->listorder = -1 * $args->menu_item_srl; |
| 283 | 283 | $output = executeQuery('menu.insertMenuItem', $args); |
| 284 | 284 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | function _getGnbKey($menuName) |
| 301 | 301 | { |
| 302 | - switch($menuName) |
|
| 302 | + switch ($menuName) |
|
| 303 | 303 | { |
| 304 | 304 | case 'siteMap': |
| 305 | 305 | case 'siteDesign': |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | */ |
| 349 | 349 | function _getOldGnbKey($menuName) |
| 350 | 350 | { |
| 351 | - switch($menuName) |
|
| 351 | + switch ($menuName) |
|
| 352 | 352 | { |
| 353 | 353 | case 'siteMap': |
| 354 | 354 | return 'menu'; |
@@ -398,9 +398,9 @@ discard block |
||
| 398 | 398 | $newAdminmenuSrl = $output->menu_srl; |
| 399 | 399 | $output = $oMenuAdminModel->getMenuItems($newAdminmenuSrl, 0); |
| 400 | 400 | $newAdminParentMenuList = array(); |
| 401 | - if(is_array($output->data)) |
|
| 401 | + if (is_array($output->data)) |
|
| 402 | 402 | { |
| 403 | - foreach($output->data AS $key => $value) |
|
| 403 | + foreach ($output->data AS $key => $value) |
|
| 404 | 404 | { |
| 405 | 405 | $tmp = explode('\'', $value->name); |
| 406 | 406 | $newAdminParentMenuList[$tmp[1]] = $value; |
@@ -413,15 +413,15 @@ discard block |
||
| 413 | 413 | $menuSrl = $output->menu_srl; |
| 414 | 414 | |
| 415 | 415 | $oMenuAdminController = getAdminController('menu'); |
| 416 | - if($menuSrl) |
|
| 416 | + if ($menuSrl) |
|
| 417 | 417 | { |
| 418 | 418 | $output = $oMenuAdminModel->getMenuItems($menuSrl); |
| 419 | - if(is_array($output->data)) |
|
| 419 | + if (is_array($output->data)) |
|
| 420 | 420 | { |
| 421 | 421 | $parentMenu = array(); |
| 422 | - foreach($output->data AS $key => $menuItem) |
|
| 422 | + foreach ($output->data AS $key => $menuItem) |
|
| 423 | 423 | { |
| 424 | - if($menuItem->parent_srl == 0) |
|
| 424 | + if ($menuItem->parent_srl == 0) |
|
| 425 | 425 | { |
| 426 | 426 | $tmp = explode('\'', $menuItem->name); |
| 427 | 427 | $parentMenuKey = $tmp[1]; |
@@ -430,15 +430,15 @@ discard block |
||
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | $isUserAddedMenuMoved = FALSE; |
| 433 | - foreach($output->data AS $key => $menuItem) |
|
| 433 | + foreach ($output->data AS $key => $menuItem) |
|
| 434 | 434 | { |
| 435 | - if($menuItem->parent_srl != 0) |
|
| 435 | + if ($menuItem->parent_srl != 0) |
|
| 436 | 436 | { |
| 437 | 437 | $tmp = explode('\'', $menuItem->name); |
| 438 | 438 | $menuKey = $tmp[1]; |
| 439 | 439 | |
| 440 | 440 | $result = $this->_getOldGnbKey($menuKey); |
| 441 | - if($result == 'user_added_menu') |
|
| 441 | + if ($result == 'user_added_menu') |
|
| 442 | 442 | { |
| 443 | 443 | // theme menu use not anymore |
| 444 | 444 | /* if($parentMenu[$menuItem->parent_srl] == 'theme') |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | $newParentItem = $newAdminParentMenuList['menu']; |
| 447 | 447 | } |
| 448 | 448 | else */ |
| 449 | - if($parentMenu[$menuItem->parent_srl] == 'extensions') |
|
| 449 | + if ($parentMenu[$menuItem->parent_srl] == 'extensions') |
|
| 450 | 450 | { |
| 451 | 451 | $newParentItem = $newAdminParentMenuList['advanced']; |
| 452 | 452 | } |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | } |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | - if($isUserAddedMenuMoved) |
|
| 466 | + if ($isUserAddedMenuMoved) |
|
| 467 | 467 | { |
| 468 | 468 | $oMenuAdminController->makeXmlFile($newAdminmenuSrl); |
| 469 | 469 | } |
@@ -472,9 +472,9 @@ discard block |
||
| 472 | 472 | |
| 473 | 473 | // all old admin menu delete |
| 474 | 474 | $output = $oMenuAdminModel->getMenuListByTitle('__XE_ADMIN__'); |
| 475 | - if(is_array($output)) |
|
| 475 | + if (is_array($output)) |
|
| 476 | 476 | { |
| 477 | - foreach($output AS $key=>$value) |
|
| 477 | + foreach ($output AS $key=>$value) |
|
| 478 | 478 | { |
| 479 | 479 | $oMenuAdminController->deleteMenu($value->menu_srl); |
| 480 | 480 | } |
@@ -17,13 +17,13 @@ discard block |
||
| 17 | 17 | function generate(&$params) |
| 18 | 18 | { |
| 19 | 19 | $xmlDoc = '<?xml version="1.0" encoding="utf-8" ?><methodCall><params>'; |
| 20 | - if(!is_array($params)) |
|
| 20 | + if (!is_array($params)) |
|
| 21 | 21 | { |
| 22 | 22 | return NULL; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | $params["module"] = "resourceapi"; |
| 26 | - foreach($params as $key => $val) |
|
| 26 | + foreach ($params as $key => $val) |
|
| 27 | 27 | { |
| 28 | 28 | $xmlDoc .= sprintf("<%s><![CDATA[%s]]></%s>", $key, $val, $key); |
| 29 | 29 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $body = XmlGenerater::generate($params); |
| 43 | 43 | $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml"); |
| 44 | - if(!$buff) |
|
| 44 | + if (!$buff) |
|
| 45 | 45 | { |
| 46 | 46 | return; |
| 47 | 47 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | $oModuleModel = getModel('module'); |
| 76 | 76 | $config = $oModuleModel->getModuleConfig('autoinstall'); |
| 77 | - if($config->downloadServer != _XE_DOWNLOAD_SERVER_) |
|
| 77 | + if ($config->downloadServer != _XE_DOWNLOAD_SERVER_) |
|
| 78 | 78 | { |
| 79 | 79 | $this->stop('msg_not_match_server'); |
| 80 | 80 | } |
@@ -104,31 +104,31 @@ discard block |
||
| 104 | 104 | $oDB = DB::getInstance(); |
| 105 | 105 | $oModuleModel = getModel('module'); |
| 106 | 106 | |
| 107 | - if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml') && $oDB->isTableExists("autoinstall_installed_packages")) |
|
| 107 | + if (!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml') && $oDB->isTableExists("autoinstall_installed_packages")) |
|
| 108 | 108 | { |
| 109 | 109 | return TRUE; |
| 110 | 110 | } |
| 111 | - if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml') |
|
| 111 | + if (!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml') |
|
| 112 | 112 | && $oDB->isTableExists("autoinstall_remote_categories")) |
| 113 | 113 | { |
| 114 | 114 | return TRUE; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // 2011.08.08 add column 'list_order' in ai_remote_categories |
| 118 | - if(!$oDB->isColumnExists('ai_remote_categories', 'list_order')) |
|
| 118 | + if (!$oDB->isColumnExists('ai_remote_categories', 'list_order')) |
|
| 119 | 119 | { |
| 120 | 120 | return TRUE; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | // 2011.08.08 set _XE_DOWNLOAD_SERVER_ at module config |
| 124 | 124 | $config = $oModuleModel->getModuleConfig('autoinstall'); |
| 125 | - if(!isset($config->downloadServer)) |
|
| 125 | + if (!isset($config->downloadServer)) |
|
| 126 | 126 | { |
| 127 | 127 | return TRUE; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | // 2012.11.12 add column 'have_instance' in autoinstall_packages |
| 131 | - if(!$oDB->isColumnExists('autoinstall_packages', 'have_instance')) |
|
| 131 | + if (!$oDB->isColumnExists('autoinstall_packages', 'have_instance')) |
|
| 132 | 132 | { |
| 133 | 133 | return TRUE; |
| 134 | 134 | } |
@@ -147,19 +147,19 @@ discard block |
||
| 147 | 147 | $oModuleModel = getModel('module'); |
| 148 | 148 | $oModuleController = getController('module'); |
| 149 | 149 | |
| 150 | - if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml') |
|
| 150 | + if (!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml') |
|
| 151 | 151 | && $oDB->isTableExists("autoinstall_installed_packages")) |
| 152 | 152 | { |
| 153 | 153 | $oDB->dropTable("autoinstall_installed_packages"); |
| 154 | 154 | } |
| 155 | - if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml') |
|
| 155 | + if (!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml') |
|
| 156 | 156 | && $oDB->isTableExists("autoinstall_remote_categories")) |
| 157 | 157 | { |
| 158 | 158 | $oDB->dropTable("autoinstall_remote_categories"); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | // 2011.08.08 add column 'list_order' in 'ai_remote_categories |
| 162 | - if(!$oDB->isColumnExists('ai_remote_categories', 'list_order')) |
|
| 162 | + if (!$oDB->isColumnExists('ai_remote_categories', 'list_order')) |
|
| 163 | 163 | { |
| 164 | 164 | $oDB->addColumn('ai_remote_categories', 'list_order', 'number', 11, NULL, TRUE); |
| 165 | 165 | $oDB->addIndex('ai_remote_categories', 'idx_list_order', array('list_order')); |
@@ -167,14 +167,14 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | // 2011. 08. 08 set _XE_DOWNLOAD_SERVER_ at module config |
| 169 | 169 | $config = $oModuleModel->getModuleConfig('autoinstall'); |
| 170 | - if(!isset($config->downloadServer)) |
|
| 170 | + if (!isset($config->downloadServer)) |
|
| 171 | 171 | { |
| 172 | 172 | $config->downloadServer = _XE_DOWNLOAD_SERVER_; |
| 173 | 173 | $oModuleController->insertModuleConfig('autoinstall', $config); |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | // 2012.11.12 add column 'have_instance' in autoinstall_packages |
| 177 | - if(!$oDB->isColumnExists('autoinstall_packages', 'have_instance')) |
|
| 177 | + if (!$oDB->isColumnExists('autoinstall_packages', 'have_instance')) |
|
| 178 | 178 | { |
| 179 | 179 | $oDB->addColumn('autoinstall_packages', 'have_instance', 'char', '1', 'N', TRUE); |
| 180 | 180 | } |
@@ -121,8 +121,7 @@ discard block |
||
| 121 | 121 | $this->download_file = $this->temp_dir . "xe.tar"; |
| 122 | 122 | $this->target_path = ""; |
| 123 | 123 | $this->download_path = $this->temp_dir; |
| 124 | - } |
|
| 125 | - else |
|
| 124 | + } else |
|
| 126 | 125 | { |
| 127 | 126 | $subpath = trim(substr($this->package->path, 2), '/'); |
| 128 | 127 | $this->download_file = $this->temp_dir . $subpath . ".tar"; |
@@ -297,8 +296,7 @@ discard block |
||
| 297 | 296 | { |
| 298 | 297 | return $output; |
| 299 | 298 | } |
| 300 | - } |
|
| 301 | - else |
|
| 299 | + } else |
|
| 302 | 300 | { |
| 303 | 301 | $output = $this->_removeFile($file_path); |
| 304 | 302 | if(!$output->toBool()) |
@@ -370,8 +368,7 @@ discard block |
||
| 370 | 368 | if($this->ftp_info->ftp_host) |
| 371 | 369 | { |
| 372 | 370 | $ftp_host = $this->ftp_info->ftp_host; |
| 373 | - } |
|
| 374 | - else |
|
| 371 | + } else |
|
| 375 | 372 | { |
| 376 | 373 | $ftp_host = "127.0.0.1"; |
| 377 | 374 | } |
@@ -523,8 +520,7 @@ discard block |
||
| 523 | 520 | if($this->ftp_info->ftp_host) |
| 524 | 521 | { |
| 525 | 522 | $ftp_host = $this->ftp_info->ftp_host; |
| 526 | - } |
|
| 527 | - else |
|
| 523 | + } else |
|
| 528 | 524 | { |
| 529 | 525 | $ftp_host = "127.0.0.1"; |
| 530 | 526 | } |
@@ -673,8 +669,7 @@ discard block |
||
| 673 | 669 | { |
| 674 | 670 | return new Object(-1, "msg_permission_adjust_failed"); |
| 675 | 671 | } |
| 676 | - } |
|
| 677 | - else |
|
| 672 | + } else |
|
| 678 | 673 | { |
| 679 | 674 | if(!ftp_site($this->connection, "CHMOD 755 " . $ftp_path)) |
| 680 | 675 | { |
@@ -736,8 +731,7 @@ discard block |
||
| 736 | 731 | if($this->ftp_info->ftp_host) |
| 737 | 732 | { |
| 738 | 733 | $ftp_host = $this->ftp_info->ftp_host; |
| 739 | - } |
|
| 740 | - else |
|
| 734 | + } else |
|
| 741 | 735 | { |
| 742 | 736 | $ftp_host = "127.0.0.1"; |
| 743 | 737 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -require_once(_XE_PATH_ . 'libs/ftp.class.php'); |
|
| 4 | +require_once(_XE_PATH_.'libs/ftp.class.php'); |
|
| 5 | 5 | |
| 6 | 6 | /** |
| 7 | 7 | * Module installer |
@@ -78,17 +78,17 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | $oModel = getModel('autoinstall'); |
| 80 | 80 | $type = $oModel->getTypeFromPath($this->package->path); |
| 81 | - if($type == "module") |
|
| 81 | + if ($type == "module") |
|
| 82 | 82 | { |
| 83 | 83 | $output = $this->uninstallModule(); |
| 84 | - if(!$output->toBool()) |
|
| 84 | + if (!$output->toBool()) |
|
| 85 | 85 | { |
| 86 | 86 | return $output; |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $output = $this->_connect(); |
| 91 | - if(!$output->toBool()) |
|
| 91 | + if (!$output->toBool()) |
|
| 92 | 92 | { |
| 93 | 93 | return $output; |
| 94 | 94 | } |
@@ -116,19 +116,19 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | function _download() |
| 118 | 118 | { |
| 119 | - if($this->package->path == ".") |
|
| 119 | + if ($this->package->path == ".") |
|
| 120 | 120 | { |
| 121 | - $this->download_file = $this->temp_dir . "xe.tar"; |
|
| 121 | + $this->download_file = $this->temp_dir."xe.tar"; |
|
| 122 | 122 | $this->target_path = ""; |
| 123 | 123 | $this->download_path = $this->temp_dir; |
| 124 | 124 | } |
| 125 | 125 | else |
| 126 | 126 | { |
| 127 | 127 | $subpath = trim(substr($this->package->path, 2), '/'); |
| 128 | - $this->download_file = $this->temp_dir . $subpath . ".tar"; |
|
| 128 | + $this->download_file = $this->temp_dir.$subpath.".tar"; |
|
| 129 | 129 | $subpatharr = explode("/", $subpath); |
| 130 | 130 | array_pop($subpatharr); |
| 131 | - $this->download_path = $this->temp_dir . implode("/", $subpatharr); |
|
| 131 | + $this->download_path = $this->temp_dir.implode("/", $subpatharr); |
|
| 132 | 132 | $this->target_path = implode("/", $subpatharr); |
| 133 | 133 | } |
| 134 | 134 | |
@@ -152,17 +152,17 @@ discard block |
||
| 152 | 152 | $path_array = explode("/", $this->package->path); |
| 153 | 153 | $target_name = array_pop($path_array); |
| 154 | 154 | $oModule = getModule($target_name, "class"); |
| 155 | - if(!$oModule) |
|
| 155 | + if (!$oModule) |
|
| 156 | 156 | { |
| 157 | 157 | return new Object(-1, 'msg_invalid_request'); |
| 158 | 158 | } |
| 159 | - if(!method_exists($oModule, "moduleUninstall")) |
|
| 159 | + if (!method_exists($oModule, "moduleUninstall")) |
|
| 160 | 160 | { |
| 161 | 161 | return new Object(-1, 'msg_invalid_request'); |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | $output = $oModule->moduleUninstall(); |
| 165 | - if(is_subclass_of($output, 'Object') && !$output->toBool()) |
|
| 165 | + if (is_subclass_of($output, 'Object') && !$output->toBool()) |
|
| 166 | 166 | { |
| 167 | 167 | return $output; |
| 168 | 168 | } |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | $schema_dir = sprintf('%s/schemas/', $this->package->path); |
| 171 | 171 | $schema_files = FileHandler::readDir($schema_dir); |
| 172 | 172 | $oDB = DB::getInstance(); |
| 173 | - if(is_array($schema_files)) |
|
| 173 | + if (is_array($schema_files)) |
|
| 174 | 174 | { |
| 175 | - foreach($schema_files as $file) |
|
| 175 | + foreach ($schema_files as $file) |
|
| 176 | 176 | { |
| 177 | 177 | $filename_arr = explode(".", $file); |
| 178 | 178 | $filename = array_shift($filename_arr); |
@@ -192,26 +192,26 @@ discard block |
||
| 192 | 192 | function installModule() |
| 193 | 193 | { |
| 194 | 194 | $path = $this->package->path; |
| 195 | - if($path != ".") |
|
| 195 | + if ($path != ".") |
|
| 196 | 196 | { |
| 197 | 197 | $path_array = explode("/", $path); |
| 198 | 198 | $target_name = array_pop($path_array); |
| 199 | 199 | $type = substr(array_pop($path_array), 0, -1); |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - if($type == "module") |
|
| 202 | + if ($type == "module") |
|
| 203 | 203 | { |
| 204 | 204 | $oModuleModel = getModel('module'); |
| 205 | 205 | $oInstallController = getController('install'); |
| 206 | 206 | $module_path = ModuleHandler::getModulePath($target_name); |
| 207 | - if($oModuleModel->checkNeedInstall($target_name)) |
|
| 207 | + if ($oModuleModel->checkNeedInstall($target_name)) |
|
| 208 | 208 | { |
| 209 | 209 | $oInstallController->installModule($target_name, $module_path); |
| 210 | 210 | } |
| 211 | - if($oModuleModel->checkNeedUpdate($target_name)) |
|
| 211 | + if ($oModuleModel->checkNeedUpdate($target_name)) |
|
| 212 | 212 | { |
| 213 | 213 | $oModule = getModule($target_name, 'class'); |
| 214 | - if(method_exists($oModule, 'moduleUpdate')) |
|
| 214 | + if (method_exists($oModule, 'moduleUpdate')) |
|
| 215 | 215 | { |
| 216 | 216 | $oModule->moduleUpdate(); |
| 217 | 217 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $this->_download(); |
| 232 | 232 | $file_list = $this->_unPack(); |
| 233 | 233 | $output = $this->_copyDir($file_list); |
| 234 | - if(!$output->toBool()) |
|
| 234 | + if (!$output->toBool()) |
|
| 235 | 235 | { |
| 236 | 236 | FileHandler::removeDir($this->temp_dir); |
| 237 | 237 | return $output; |
@@ -249,18 +249,18 @@ discard block |
||
| 249 | 249 | */ |
| 250 | 250 | function _unPack() |
| 251 | 251 | { |
| 252 | - require_once(_XE_PATH_ . 'libs/tar.class.php'); |
|
| 252 | + require_once(_XE_PATH_.'libs/tar.class.php'); |
|
| 253 | 253 | |
| 254 | 254 | $oTar = new tar(); |
| 255 | 255 | $oTar->openTAR($this->download_file); |
| 256 | 256 | |
| 257 | 257 | $_files = $oTar->files; |
| 258 | 258 | $file_list = array(); |
| 259 | - if(is_array($_files)) |
|
| 259 | + if (is_array($_files)) |
|
| 260 | 260 | { |
| 261 | - foreach($_files as $key => $info) |
|
| 261 | + foreach ($_files as $key => $info) |
|
| 262 | 262 | { |
| 263 | - FileHandler::writeFile($this->download_path . "/" . $info['name'], $info['file']); |
|
| 263 | + FileHandler::writeFile($this->download_path."/".$info['name'], $info['file']); |
|
| 264 | 264 | $file_list[] = $info['name']; |
| 265 | 265 | } |
| 266 | 266 | } |
@@ -278,22 +278,22 @@ discard block |
||
| 278 | 278 | $real_path = FileHandler::getRealPath($path); |
| 279 | 279 | $oDir = dir($path); |
| 280 | 280 | $files = array(); |
| 281 | - while($file = $oDir->read()) |
|
| 281 | + while ($file = $oDir->read()) |
|
| 282 | 282 | { |
| 283 | - if($file == "." || $file == "..") |
|
| 283 | + if ($file == "." || $file == "..") |
|
| 284 | 284 | { |
| 285 | 285 | continue; |
| 286 | 286 | } |
| 287 | 287 | $files[] = $file; |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - foreach($files as $file) |
|
| 290 | + foreach ($files as $file) |
|
| 291 | 291 | { |
| 292 | - $file_path = $path . "/" . $file; |
|
| 293 | - if(is_dir(FileHandler::getRealPath($file_path))) |
|
| 292 | + $file_path = $path."/".$file; |
|
| 293 | + if (is_dir(FileHandler::getRealPath($file_path))) |
|
| 294 | 294 | { |
| 295 | 295 | $output = $this->_removeDir($file_path); |
| 296 | - if(!$output->toBool()) |
|
| 296 | + if (!$output->toBool()) |
|
| 297 | 297 | { |
| 298 | 298 | return $output; |
| 299 | 299 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | else |
| 302 | 302 | { |
| 303 | 303 | $output = $this->_removeFile($file_path); |
| 304 | - if(!$output->toBool()) |
|
| 304 | + if (!$output->toBool()) |
|
| 305 | 305 | { |
| 306 | 306 | return $output; |
| 307 | 307 | } |
@@ -357,17 +357,17 @@ discard block |
||
| 357 | 357 | */ |
| 358 | 358 | function _connect() |
| 359 | 359 | { |
| 360 | - if(!function_exists('ssh2_connect')) |
|
| 360 | + if (!function_exists('ssh2_connect')) |
|
| 361 | 361 | { |
| 362 | 362 | return new Object(-1, 'msg_sftp_not_supported'); |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - if(!$this->ftp_info->ftp_user || !$this->ftp_info->sftp || $this->ftp_info->sftp != 'Y') |
|
| 365 | + if (!$this->ftp_info->ftp_user || !$this->ftp_info->sftp || $this->ftp_info->sftp != 'Y') |
|
| 366 | 366 | { |
| 367 | 367 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - if($this->ftp_info->ftp_host) |
|
| 370 | + if ($this->ftp_info->ftp_host) |
|
| 371 | 371 | { |
| 372 | 372 | $ftp_host = $this->ftp_info->ftp_host; |
| 373 | 373 | } |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | $ftp_host = "127.0.0.1"; |
| 377 | 377 | } |
| 378 | 378 | $this->connection = ssh2_connect($ftp_host, $this->ftp_info->ftp_port); |
| 379 | - if(!@ssh2_auth_password($this->connection, $this->ftp_info->ftp_user, $this->ftp_password)) |
|
| 379 | + if (!@ssh2_auth_password($this->connection, $this->ftp_info->ftp_user, $this->ftp_password)) |
|
| 380 | 380 | { |
| 381 | 381 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
| 382 | 382 | } |
@@ -403,13 +403,13 @@ discard block |
||
| 403 | 403 | */ |
| 404 | 404 | function _removeFile($path) |
| 405 | 405 | { |
| 406 | - if(substr($path, 0, 2) == "./") |
|
| 406 | + if (substr($path, 0, 2) == "./") |
|
| 407 | 407 | { |
| 408 | 408 | $path = substr($path, 2); |
| 409 | 409 | } |
| 410 | - $target_path = $this->ftp_info->ftp_root_path . $path; |
|
| 410 | + $target_path = $this->ftp_info->ftp_root_path.$path; |
|
| 411 | 411 | |
| 412 | - if(!@ssh2_sftp_unlink($this->sftp, $target_path)) |
|
| 412 | + if (!@ssh2_sftp_unlink($this->sftp, $target_path)) |
|
| 413 | 413 | { |
| 414 | 414 | return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path)); |
| 415 | 415 | } |
@@ -424,13 +424,13 @@ discard block |
||
| 424 | 424 | */ |
| 425 | 425 | function _removeDir_real($path) |
| 426 | 426 | { |
| 427 | - if(substr($path, 0, 2) == "./") |
|
| 427 | + if (substr($path, 0, 2) == "./") |
|
| 428 | 428 | { |
| 429 | 429 | $path = substr($path, 2); |
| 430 | 430 | } |
| 431 | - $target_path = $this->ftp_info->ftp_root_path . $path; |
|
| 431 | + $target_path = $this->ftp_info->ftp_root_path.$path; |
|
| 432 | 432 | |
| 433 | - if(!@ssh2_sftp_rmdir($this->sftp, $target_path)) |
|
| 433 | + if (!@ssh2_sftp_rmdir($this->sftp, $target_path)) |
|
| 434 | 434 | { |
| 435 | 435 | return new Object(-1, sprintf(Context::getLang('msg_delete_dir_failed'), $path)); |
| 436 | 436 | } |
@@ -445,36 +445,36 @@ discard block |
||
| 445 | 445 | */ |
| 446 | 446 | function _copyDir(&$file_list) |
| 447 | 447 | { |
| 448 | - if(!$this->ftp_password) |
|
| 448 | + if (!$this->ftp_password) |
|
| 449 | 449 | { |
| 450 | 450 | return new Object(-1, 'msg_ftp_password_input'); |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | $output = $this->_connect(); |
| 454 | - if(!$output->toBool()) |
|
| 454 | + if (!$output->toBool()) |
|
| 455 | 455 | { |
| 456 | 456 | return $output; |
| 457 | 457 | } |
| 458 | - $target_dir = $this->ftp_info->ftp_root_path . $this->target_path; |
|
| 458 | + $target_dir = $this->ftp_info->ftp_root_path.$this->target_path; |
|
| 459 | 459 | |
| 460 | - if(is_array($file_list)) |
|
| 460 | + if (is_array($file_list)) |
|
| 461 | 461 | { |
| 462 | - foreach($file_list as $k => $file) |
|
| 462 | + foreach ($file_list as $k => $file) |
|
| 463 | 463 | { |
| 464 | 464 | $org_file = $file; |
| 465 | - if($this->package->path == ".") |
|
| 465 | + if ($this->package->path == ".") |
|
| 466 | 466 | { |
| 467 | 467 | $file = substr($file, 3); |
| 468 | 468 | } |
| 469 | - $path = FileHandler::getRealPath("./" . $this->target_path . "/" . $file); |
|
| 470 | - $pathname = dirname($target_dir . "/" . $file); |
|
| 469 | + $path = FileHandler::getRealPath("./".$this->target_path."/".$file); |
|
| 470 | + $pathname = dirname($target_dir."/".$file); |
|
| 471 | 471 | |
| 472 | - if(!file_exists(FileHandler::getRealPath($real_path))) |
|
| 472 | + if (!file_exists(FileHandler::getRealPath($real_path))) |
|
| 473 | 473 | { |
| 474 | 474 | ssh2_sftp_mkdir($this->sftp, $pathname, 0755, TRUE); |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | - ssh2_scp_send($this->connection, FileHandler::getRealPath($this->download_path . "/" . $org_file), $target_dir . "/" . $file); |
|
| 477 | + ssh2_scp_send($this->connection, FileHandler::getRealPath($this->download_path."/".$org_file), $target_dir."/".$file); |
|
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | 480 | return new Object(); |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | */ |
| 521 | 521 | function _connect() |
| 522 | 522 | { |
| 523 | - if($this->ftp_info->ftp_host) |
|
| 523 | + if ($this->ftp_info->ftp_host) |
|
| 524 | 524 | { |
| 525 | 525 | $ftp_host = $this->ftp_info->ftp_host; |
| 526 | 526 | } |
@@ -530,20 +530,20 @@ discard block |
||
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | $this->connection = ftp_connect($ftp_host, $this->ftp_info->ftp_port); |
| 533 | - if(!$this->connection) |
|
| 533 | + if (!$this->connection) |
|
| 534 | 534 | { |
| 535 | 535 | return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_host)); |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | $login_result = @ftp_login($this->connection, $this->ftp_info->ftp_user, $this->ftp_password); |
| 539 | - if(!$login_result) |
|
| 539 | + if (!$login_result) |
|
| 540 | 540 | { |
| 541 | 541 | $this->_close(); |
| 542 | 542 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | $_SESSION['ftp_password'] = $this->ftp_password; |
| 546 | - if($this->ftp_info->ftp_pasv != "N") |
|
| 546 | + if ($this->ftp_info->ftp_pasv != "N") |
|
| 547 | 547 | { |
| 548 | 548 | ftp_pasv($this->connection, TRUE); |
| 549 | 549 | } |
@@ -558,15 +558,15 @@ discard block |
||
| 558 | 558 | */ |
| 559 | 559 | function _removeFile($path) |
| 560 | 560 | { |
| 561 | - if(substr($path, 0, 2) == "./") |
|
| 561 | + if (substr($path, 0, 2) == "./") |
|
| 562 | 562 | { |
| 563 | 563 | $path = substr($path, 2); |
| 564 | 564 | } |
| 565 | - $target_path = $this->ftp_info->ftp_root_path . $path; |
|
| 565 | + $target_path = $this->ftp_info->ftp_root_path.$path; |
|
| 566 | 566 | |
| 567 | - if(!@ftp_delete($this->connection, $target_path)) |
|
| 567 | + if (!@ftp_delete($this->connection, $target_path)) |
|
| 568 | 568 | { |
| 569 | - return new Object(-1, "failed to delete file " . $path); |
|
| 569 | + return new Object(-1, "failed to delete file ".$path); |
|
| 570 | 570 | } |
| 571 | 571 | return new Object(); |
| 572 | 572 | } |
@@ -579,15 +579,15 @@ discard block |
||
| 579 | 579 | */ |
| 580 | 580 | function _removeDir_real($path) |
| 581 | 581 | { |
| 582 | - if(substr($path, 0, 2) == "./") |
|
| 582 | + if (substr($path, 0, 2) == "./") |
|
| 583 | 583 | { |
| 584 | 584 | $path = substr($path, 2); |
| 585 | 585 | } |
| 586 | - $target_path = $this->ftp_info->ftp_root_path . $path; |
|
| 586 | + $target_path = $this->ftp_info->ftp_root_path.$path; |
|
| 587 | 587 | |
| 588 | - if(!@ftp_rmdir($this->connection, $target_path)) |
|
| 588 | + if (!@ftp_rmdir($this->connection, $target_path)) |
|
| 589 | 589 | { |
| 590 | - return new Object(-1, "failed to delete directory " . $path); |
|
| 590 | + return new Object(-1, "failed to delete directory ".$path); |
|
| 591 | 591 | } |
| 592 | 592 | return new Object(); |
| 593 | 593 | } |
@@ -610,73 +610,73 @@ discard block |
||
| 610 | 610 | */ |
| 611 | 611 | function _copyDir(&$file_list) |
| 612 | 612 | { |
| 613 | - if(!$this->ftp_password) |
|
| 613 | + if (!$this->ftp_password) |
|
| 614 | 614 | { |
| 615 | 615 | return new Object(-1, 'msg_ftp_password_input'); |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | $output = $this->_connect(); |
| 619 | - if(!$output->toBool()) |
|
| 619 | + if (!$output->toBool()) |
|
| 620 | 620 | { |
| 621 | 621 | return $output; |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | - if(!$this->target_path) |
|
| 624 | + if (!$this->target_path) |
|
| 625 | 625 | { |
| 626 | 626 | $this->target_path = '.'; |
| 627 | 627 | } |
| 628 | - if(substr($this->download_path, -1) == '/') |
|
| 628 | + if (substr($this->download_path, -1) == '/') |
|
| 629 | 629 | { |
| 630 | 630 | $this->download_path = substr($this->download_path, 0, -1); |
| 631 | 631 | } |
| 632 | - $target_dir = $this->ftp_info->ftp_root_path . $this->target_path; |
|
| 632 | + $target_dir = $this->ftp_info->ftp_root_path.$this->target_path; |
|
| 633 | 633 | |
| 634 | - if(is_array($file_list)) |
|
| 634 | + if (is_array($file_list)) |
|
| 635 | 635 | { |
| 636 | - foreach($file_list as $k => $file) |
|
| 636 | + foreach ($file_list as $k => $file) |
|
| 637 | 637 | { |
| 638 | - if(!$file) |
|
| 638 | + if (!$file) |
|
| 639 | 639 | { |
| 640 | 640 | continue; |
| 641 | 641 | } |
| 642 | 642 | $org_file = $file; |
| 643 | - if($this->package->path == ".") |
|
| 643 | + if ($this->package->path == ".") |
|
| 644 | 644 | { |
| 645 | 645 | $file = substr($file, 3); |
| 646 | 646 | } |
| 647 | - $path = FileHandler::getRealPath("./" . $this->target_path . "/" . $file); |
|
| 648 | - $path_list = explode('/', dirname($this->target_path . "/" . $file)); |
|
| 647 | + $path = FileHandler::getRealPath("./".$this->target_path."/".$file); |
|
| 648 | + $path_list = explode('/', dirname($this->target_path."/".$file)); |
|
| 649 | 649 | |
| 650 | 650 | $real_path = "./"; |
| 651 | 651 | $ftp_path = $this->ftp_info->ftp_root_path; |
| 652 | 652 | |
| 653 | - for($i = 0; $i < count($path_list); $i++) |
|
| 653 | + for ($i = 0; $i < count($path_list); $i++) |
|
| 654 | 654 | { |
| 655 | - if($path_list == "") |
|
| 655 | + if ($path_list == "") |
|
| 656 | 656 | { |
| 657 | 657 | continue; |
| 658 | 658 | } |
| 659 | - $real_path .= $path_list[$i] . "/"; |
|
| 660 | - $ftp_path .= $path_list[$i] . "/"; |
|
| 661 | - if(!file_exists(FileHandler::getRealPath($real_path))) |
|
| 659 | + $real_path .= $path_list[$i]."/"; |
|
| 660 | + $ftp_path .= $path_list[$i]."/"; |
|
| 661 | + if (!file_exists(FileHandler::getRealPath($real_path))) |
|
| 662 | 662 | { |
| 663 | - if(!@ftp_mkdir($this->connection, $ftp_path)) |
|
| 663 | + if (!@ftp_mkdir($this->connection, $ftp_path)) |
|
| 664 | 664 | { |
| 665 | 665 | return new Object(-1, "msg_make_directory_failed"); |
| 666 | 666 | } |
| 667 | 667 | |
| 668 | - if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') |
|
| 668 | + if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') |
|
| 669 | 669 | { |
| 670 | - if(function_exists('ftp_chmod')) |
|
| 670 | + if (function_exists('ftp_chmod')) |
|
| 671 | 671 | { |
| 672 | - if(!ftp_chmod($this->connection, 0755, $ftp_path)) |
|
| 672 | + if (!ftp_chmod($this->connection, 0755, $ftp_path)) |
|
| 673 | 673 | { |
| 674 | 674 | return new Object(-1, "msg_permission_adjust_failed"); |
| 675 | 675 | } |
| 676 | 676 | } |
| 677 | 677 | else |
| 678 | 678 | { |
| 679 | - if(!ftp_site($this->connection, "CHMOD 755 " . $ftp_path)) |
|
| 679 | + if (!ftp_site($this->connection, "CHMOD 755 ".$ftp_path)) |
|
| 680 | 680 | { |
| 681 | 681 | return new Object(-1, "msg_permission_adjust_failed"); |
| 682 | 682 | } |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | } |
| 685 | 685 | } |
| 686 | 686 | } |
| 687 | - if(!ftp_put($this->connection, $target_dir . '/' . $file, FileHandler::getRealPath($this->download_path . "/" . $org_file), FTP_BINARY)) |
|
| 687 | + if (!ftp_put($this->connection, $target_dir.'/'.$file, FileHandler::getRealPath($this->download_path."/".$org_file), FTP_BINARY)) |
|
| 688 | 688 | { |
| 689 | 689 | return new Object(-1, "msg_ftp_upload_failed"); |
| 690 | 690 | } |
@@ -733,7 +733,7 @@ discard block |
||
| 733 | 733 | */ |
| 734 | 734 | function _connect() |
| 735 | 735 | { |
| 736 | - if($this->ftp_info->ftp_host) |
|
| 736 | + if ($this->ftp_info->ftp_host) |
|
| 737 | 737 | { |
| 738 | 738 | $ftp_host = $this->ftp_info->ftp_host; |
| 739 | 739 | } |
@@ -743,11 +743,11 @@ discard block |
||
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | $this->oFtp = new ftp(); |
| 746 | - if(!$this->oFtp->ftp_connect($ftp_host, $this->ftp_info->ftp_port)) |
|
| 746 | + if (!$this->oFtp->ftp_connect($ftp_host, $this->ftp_info->ftp_port)) |
|
| 747 | 747 | { |
| 748 | 748 | return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_host)); |
| 749 | 749 | } |
| 750 | - if(!$this->oFtp->ftp_login($this->ftp_info->ftp_user, $this->ftp_password)) |
|
| 750 | + if (!$this->oFtp->ftp_login($this->ftp_info->ftp_user, $this->ftp_password)) |
|
| 751 | 751 | { |
| 752 | 752 | $this->_close(); |
| 753 | 753 | return new Object(-1, 'msg_ftp_invalid_auth_info'); |
@@ -764,13 +764,13 @@ discard block |
||
| 764 | 764 | */ |
| 765 | 765 | function _removeFile($path) |
| 766 | 766 | { |
| 767 | - if(substr($path, 0, 2) == "./") |
|
| 767 | + if (substr($path, 0, 2) == "./") |
|
| 768 | 768 | { |
| 769 | 769 | $path = substr($path, 2); |
| 770 | 770 | } |
| 771 | - $target_path = $this->ftp_info->ftp_root_path . $path; |
|
| 771 | + $target_path = $this->ftp_info->ftp_root_path.$path; |
|
| 772 | 772 | |
| 773 | - if(!$this->oFtp->ftp_delete($target_path)) |
|
| 773 | + if (!$this->oFtp->ftp_delete($target_path)) |
|
| 774 | 774 | { |
| 775 | 775 | return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path)); |
| 776 | 776 | } |
@@ -784,13 +784,13 @@ discard block |
||
| 784 | 784 | */ |
| 785 | 785 | function _removeDir_real($path) |
| 786 | 786 | { |
| 787 | - if(substr($path, 0, 2) == "./") |
|
| 787 | + if (substr($path, 0, 2) == "./") |
|
| 788 | 788 | { |
| 789 | 789 | $path = substr($path, 2); |
| 790 | 790 | } |
| 791 | - $target_path = $this->ftp_info->ftp_root_path . $path; |
|
| 791 | + $target_path = $this->ftp_info->ftp_root_path.$path; |
|
| 792 | 792 | |
| 793 | - if(!$this->oFtp->ftp_rmdir($target_path)) |
|
| 793 | + if (!$this->oFtp->ftp_rmdir($target_path)) |
|
| 794 | 794 | { |
| 795 | 795 | return new Object(-1, sprintf(Context::getLang('msg_delete_dir_failed'), $path)); |
| 796 | 796 | } |
@@ -815,50 +815,50 @@ discard block |
||
| 815 | 815 | */ |
| 816 | 816 | function _copyDir(&$file_list) |
| 817 | 817 | { |
| 818 | - if(!$this->ftp_password) |
|
| 818 | + if (!$this->ftp_password) |
|
| 819 | 819 | { |
| 820 | 820 | return new Object(-1, 'msg_ftp_password_input'); |
| 821 | 821 | } |
| 822 | 822 | |
| 823 | 823 | $output = $this->_connect(); |
| 824 | - if(!$output->toBool()) |
|
| 824 | + if (!$output->toBool()) |
|
| 825 | 825 | { |
| 826 | 826 | return $output; |
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | $oFtp = &$this->oFtp; |
| 830 | - $target_dir = $this->ftp_info->ftp_root_path . $this->target_path; |
|
| 830 | + $target_dir = $this->ftp_info->ftp_root_path.$this->target_path; |
|
| 831 | 831 | |
| 832 | - if(is_array($file_list)) |
|
| 832 | + if (is_array($file_list)) |
|
| 833 | 833 | { |
| 834 | - foreach($file_list as $k => $file) |
|
| 834 | + foreach ($file_list as $k => $file) |
|
| 835 | 835 | { |
| 836 | 836 | $org_file = $file; |
| 837 | - if($this->package->path == ".") |
|
| 837 | + if ($this->package->path == ".") |
|
| 838 | 838 | { |
| 839 | 839 | $file = substr($file, 3); |
| 840 | 840 | } |
| 841 | - $path = FileHandler::getRealPath("./" . $this->target_path . "/" . $file); |
|
| 842 | - $path_list = explode('/', dirname($this->target_path . "/" . $file)); |
|
| 841 | + $path = FileHandler::getRealPath("./".$this->target_path."/".$file); |
|
| 842 | + $path_list = explode('/', dirname($this->target_path."/".$file)); |
|
| 843 | 843 | |
| 844 | 844 | $real_path = "./"; |
| 845 | 845 | $ftp_path = $this->ftp_info->ftp_root_path; |
| 846 | 846 | |
| 847 | - for($i = 0; $i < count($path_list); $i++) |
|
| 847 | + for ($i = 0; $i < count($path_list); $i++) |
|
| 848 | 848 | { |
| 849 | - if($path_list == "") |
|
| 849 | + if ($path_list == "") |
|
| 850 | 850 | { |
| 851 | 851 | continue; |
| 852 | 852 | } |
| 853 | - $real_path .= $path_list[$i] . "/"; |
|
| 854 | - $ftp_path .= $path_list[$i] . "/"; |
|
| 855 | - if(!file_exists(FileHandler::getRealPath($real_path))) |
|
| 853 | + $real_path .= $path_list[$i]."/"; |
|
| 854 | + $ftp_path .= $path_list[$i]."/"; |
|
| 855 | + if (!file_exists(FileHandler::getRealPath($real_path))) |
|
| 856 | 856 | { |
| 857 | 857 | $oFtp->ftp_mkdir($ftp_path); |
| 858 | - $oFtp->ftp_site("CHMOD 755 " . $ftp_path); |
|
| 858 | + $oFtp->ftp_site("CHMOD 755 ".$ftp_path); |
|
| 859 | 859 | } |
| 860 | 860 | } |
| 861 | - $oFtp->ftp_put($target_dir . '/' . $file, FileHandler::getRealPath($this->download_path . "/" . $org_file)); |
|
| 861 | + $oFtp->ftp_put($target_dir.'/'.$file, FileHandler::getRealPath($this->download_path."/".$org_file)); |
|
| 862 | 862 | } |
| 863 | 863 | } |
| 864 | 864 | |
@@ -903,13 +903,13 @@ discard block |
||
| 903 | 903 | */ |
| 904 | 904 | function _removeFile($path) |
| 905 | 905 | { |
| 906 | - if(substr($path, 0, 2) == "./") |
|
| 906 | + if (substr($path, 0, 2) == "./") |
|
| 907 | 907 | { |
| 908 | 908 | $path = substr($path, 2); |
| 909 | 909 | } |
| 910 | 910 | $target_path = FileHandler::getRealPath($path); |
| 911 | 911 | |
| 912 | - if(!FileHandler::removeFile($target_path)) |
|
| 912 | + if (!FileHandler::removeFile($target_path)) |
|
| 913 | 913 | { |
| 914 | 914 | return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path)); |
| 915 | 915 | } |
@@ -923,7 +923,7 @@ discard block |
||
| 923 | 923 | */ |
| 924 | 924 | function _removeDir_real($path) |
| 925 | 925 | { |
| 926 | - if(substr($path, 0, 2) == "./") |
|
| 926 | + if (substr($path, 0, 2) == "./") |
|
| 927 | 927 | { |
| 928 | 928 | $path = substr($path, 2); |
| 929 | 929 | } |
@@ -952,38 +952,38 @@ discard block |
||
| 952 | 952 | function _copyDir(&$file_list) |
| 953 | 953 | { |
| 954 | 954 | $output = $this->_connect(); |
| 955 | - if(!$output->toBool()) |
|
| 955 | + if (!$output->toBool()) |
|
| 956 | 956 | { |
| 957 | 957 | return $output; |
| 958 | 958 | } |
| 959 | 959 | $target_dir = $this->target_path; |
| 960 | 960 | |
| 961 | - if(is_array($file_list)) |
|
| 961 | + if (is_array($file_list)) |
|
| 962 | 962 | { |
| 963 | - foreach($file_list as $k => $file) |
|
| 963 | + foreach ($file_list as $k => $file) |
|
| 964 | 964 | { |
| 965 | 965 | $org_file = $file; |
| 966 | - if($this->package->path == ".") |
|
| 966 | + if ($this->package->path == ".") |
|
| 967 | 967 | { |
| 968 | 968 | $file = substr($file, 3); |
| 969 | 969 | } |
| 970 | - $path = FileHandler::getRealPath("./" . $this->target_path . "/" . $file); |
|
| 971 | - $path_list = explode('/', dirname($this->target_path . "/" . $file)); |
|
| 970 | + $path = FileHandler::getRealPath("./".$this->target_path."/".$file); |
|
| 971 | + $path_list = explode('/', dirname($this->target_path."/".$file)); |
|
| 972 | 972 | $real_path = "./"; |
| 973 | 973 | |
| 974 | - for($i = 0; $i < count($path_list); $i++) |
|
| 974 | + for ($i = 0; $i < count($path_list); $i++) |
|
| 975 | 975 | { |
| 976 | - if($path_list == "") |
|
| 976 | + if ($path_list == "") |
|
| 977 | 977 | { |
| 978 | 978 | continue; |
| 979 | 979 | } |
| 980 | - $real_path .= $path_list[$i] . "/"; |
|
| 981 | - if(!file_exists(FileHandler::getRealPath($real_path))) |
|
| 980 | + $real_path .= $path_list[$i]."/"; |
|
| 981 | + if (!file_exists(FileHandler::getRealPath($real_path))) |
|
| 982 | 982 | { |
| 983 | 983 | FileHandler::makeDir($real_path); |
| 984 | 984 | } |
| 985 | 985 | } |
| 986 | - FileHandler::copyFile( FileHandler::getRealPath($this->download_path . "/" . $org_file), FileHandler::getRealPath("./" . $target_dir . '/' . $file)); |
|
| 986 | + FileHandler::copyFile(FileHandler::getRealPath($this->download_path."/".$org_file), FileHandler::getRealPath("./".$target_dir.'/'.$file)); |
|
| 987 | 987 | } |
| 988 | 988 | } |
| 989 | 989 | |
@@ -103,8 +103,7 @@ discard block |
||
| 103 | 103 | if($category->parent_srl) |
| 104 | 104 | { |
| 105 | 105 | $categoryList[$category->parent_srl]->children[] = & $categoryList[$key]; |
| 106 | - } |
|
| 107 | - else |
|
| 106 | + } else |
|
| 108 | 107 | { |
| 109 | 108 | $depth0[] = $key; |
| 110 | 109 | } |
@@ -324,8 +323,7 @@ discard block |
||
| 324 | 323 | if(method_exists($oModule, "moduleUninstall")) |
| 325 | 324 | { |
| 326 | 325 | return TRUE; |
| 327 | - } |
|
| 328 | - else |
|
| 326 | + } else |
|
| 329 | 327 | { |
| 330 | 328 | return FALSE; |
| 331 | 329 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $args = new stdClass(); |
| 20 | 20 | $args->category_srl = $category_srl; |
| 21 | 21 | $output = executeQueryArray("autoinstall.getCategory", $args); |
| 22 | - if(!$output->data) |
|
| 22 | + if (!$output->data) |
|
| 23 | 23 | { |
| 24 | 24 | return null; |
| 25 | 25 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | function getPackages() |
| 35 | 35 | { |
| 36 | 36 | $output = executeQueryArray("autoinstall.getPackages"); |
| 37 | - if(!$output->data) |
|
| 37 | + if (!$output->data) |
|
| 38 | 38 | { |
| 39 | 39 | return array(); |
| 40 | 40 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $args = new stdClass(); |
| 53 | 53 | $args->package_srl = $package_srl; |
| 54 | 54 | $output = executeQueryArray("autoinstall.getInstalledPackage", $args); |
| 55 | - if(!$output->data) |
|
| 55 | + if (!$output->data) |
|
| 56 | 56 | { |
| 57 | 57 | return null; |
| 58 | 58 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $args = new stdClass(); |
| 71 | 71 | $args->package_srl = $package_srl; |
| 72 | 72 | $output = executeQueryArray("autoinstall.getPackage", $args); |
| 73 | - if(!$output->data) |
|
| 73 | + if (!$output->data) |
|
| 74 | 74 | { |
| 75 | 75 | return null; |
| 76 | 76 | } |
@@ -85,22 +85,22 @@ discard block |
||
| 85 | 85 | function getCategoryList() |
| 86 | 86 | { |
| 87 | 87 | $output = executeQueryArray("autoinstall.getCategories"); |
| 88 | - if(!$output->toBool() || !$output->data) |
|
| 88 | + if (!$output->toBool() || !$output->data) |
|
| 89 | 89 | { |
| 90 | 90 | return array(); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $categoryList = array(); |
| 94 | - foreach($output->data as $category) |
|
| 94 | + foreach ($output->data as $category) |
|
| 95 | 95 | { |
| 96 | 96 | $category->children = array(); |
| 97 | 97 | $categoryList[$category->category_srl] = $category; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | $depth0 = array(); |
| 101 | - foreach($categoryList as $key => $category) |
|
| 101 | + foreach ($categoryList as $key => $category) |
|
| 102 | 102 | { |
| 103 | - if($category->parent_srl) |
|
| 103 | + if ($category->parent_srl) |
|
| 104 | 104 | { |
| 105 | 105 | $categoryList[$category->parent_srl]->children[] = & $categoryList[$key]; |
| 106 | 106 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | $resultList = array(); |
| 113 | - foreach($depth0 as $category_srl) |
|
| 113 | + foreach ($depth0 as $category_srl) |
|
| 114 | 114 | { |
| 115 | 115 | $this->setDepth($categoryList[$category_srl], 0, $categoryList, $resultList); |
| 116 | 116 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $args = new stdClass(); |
| 129 | 129 | $args->category_srl = $category_srl; |
| 130 | 130 | $output = executeQuery("autoinstall.getPackageCount", $args); |
| 131 | - if(!$output->data) |
|
| 131 | + if (!$output->data) |
|
| 132 | 132 | { |
| 133 | 133 | return 0; |
| 134 | 134 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | function getInstalledPackageCount() |
| 144 | 144 | { |
| 145 | 145 | $output = executeQuery("autoinstall.getInstalledPackageCount"); |
| 146 | - if(!$output->data) |
|
| 146 | + if (!$output->data) |
|
| 147 | 147 | { |
| 148 | 148 | return 0; |
| 149 | 149 | } |
@@ -164,11 +164,11 @@ discard block |
||
| 164 | 164 | $resultList[$item->category_srl] = &$item; |
| 165 | 165 | $item->depth = $depth; |
| 166 | 166 | $siblingList = $item->category_srl; |
| 167 | - foreach($item->children as $child) |
|
| 167 | + foreach ($item->children as $child) |
|
| 168 | 168 | { |
| 169 | - $siblingList .= "," . $this->setDepth($list[$child->category_srl], $depth + 1, $list, $resultList); |
|
| 169 | + $siblingList .= ",".$this->setDepth($list[$child->category_srl], $depth + 1, $list, $resultList); |
|
| 170 | 170 | } |
| 171 | - if(count($item->children) < 1) |
|
| 171 | + if (count($item->children) < 1) |
|
| 172 | 172 | { |
| 173 | 173 | $item->nPackages = $this->getPackageCount($item->category_srl); |
| 174 | 174 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | function getLatestPackage() |
| 185 | 185 | { |
| 186 | 186 | $output = executeQueryArray("autoinstall.getLatestPackage"); |
| 187 | - if(!$output->data) |
|
| 187 | + if (!$output->data) |
|
| 188 | 188 | { |
| 189 | 189 | return null; |
| 190 | 190 | } |
@@ -203,11 +203,11 @@ discard block |
||
| 203 | 203 | $args->package_list = $package_list; |
| 204 | 204 | $output = executeQueryArray("autoinstall.getInstalledPackages", $args); |
| 205 | 205 | $result = array(); |
| 206 | - if(!$output->data) |
|
| 206 | + if (!$output->data) |
|
| 207 | 207 | { |
| 208 | 208 | return $result; |
| 209 | 209 | } |
| 210 | - foreach($output->data as $value) |
|
| 210 | + foreach ($output->data as $value) |
|
| 211 | 211 | { |
| 212 | 212 | $result[$value->package_srl] = $value; |
| 213 | 213 | } |
@@ -226,15 +226,15 @@ discard block |
||
| 226 | 226 | $args->page = $page; |
| 227 | 227 | $args->list_count = 10; |
| 228 | 228 | $args->page_count = 5; |
| 229 | - if(Context::getDBType() == 'mssql') |
|
| 229 | + if (Context::getDBType() == 'mssql') |
|
| 230 | 230 | { |
| 231 | 231 | $args->sort_index = 'package_srl'; |
| 232 | 232 | } |
| 233 | 233 | $output = executeQueryArray("autoinstall.getInstalledPackageList", $args); |
| 234 | 234 | $res = array(); |
| 235 | - if($output->data) |
|
| 235 | + if ($output->data) |
|
| 236 | 236 | { |
| 237 | - foreach($output->data as $val) |
|
| 237 | + foreach ($output->data as $val) |
|
| 238 | 238 | { |
| 239 | 239 | $res[$val->package_srl] = $val; |
| 240 | 240 | } |
@@ -251,19 +251,19 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | function getTypeFromPath($path) |
| 253 | 253 | { |
| 254 | - if(!$path) |
|
| 254 | + if (!$path) |
|
| 255 | 255 | { |
| 256 | 256 | return NULL; |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - if($path == ".") |
|
| 259 | + if ($path == ".") |
|
| 260 | 260 | { |
| 261 | 261 | return "core"; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | $path_array = explode("/", $path); |
| 265 | 265 | $target_name = array_pop($path_array); |
| 266 | - if(!$target_name) |
|
| 266 | + if (!$target_name) |
|
| 267 | 267 | { |
| 268 | 268 | $target_name = array_pop($path_array); |
| 269 | 269 | } |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | function getConfigFilePath($type) |
| 281 | 281 | { |
| 282 | 282 | $config_file = NULL; |
| 283 | - switch($type) |
|
| 283 | + switch ($type) |
|
| 284 | 284 | { |
| 285 | 285 | case "m.layout": |
| 286 | 286 | case "module": |
@@ -317,11 +317,11 @@ discard block |
||
| 317 | 317 | $path_array = explode("/", $path); |
| 318 | 318 | $target_name = array_pop($path_array); |
| 319 | 319 | $oModule = getModule($target_name, "class"); |
| 320 | - if(!$oModule) |
|
| 320 | + if (!$oModule) |
|
| 321 | 321 | { |
| 322 | 322 | return FALSE; |
| 323 | 323 | } |
| 324 | - if(method_exists($oModule, "moduleUninstall")) |
|
| 324 | + if (method_exists($oModule, "moduleUninstall")) |
|
| 325 | 325 | { |
| 326 | 326 | return TRUE; |
| 327 | 327 | } |
@@ -339,17 +339,17 @@ discard block |
||
| 339 | 339 | */ |
| 340 | 340 | function getPackageSrlByPath($path) |
| 341 | 341 | { |
| 342 | - if(!$path) |
|
| 342 | + if (!$path) |
|
| 343 | 343 | { |
| 344 | 344 | return; |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | - if(substr($path, -1) == '/') |
|
| 347 | + if (substr($path, -1) == '/') |
|
| 348 | 348 | { |
| 349 | 349 | $path = substr($path, 0, strlen($path) - 1); |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | - if(!$GLOBLAS['XE_AUTOINSTALL_PACKAGE_SRL_BY_PATH'][$path]) |
|
| 352 | + if (!$GLOBLAS['XE_AUTOINSTALL_PACKAGE_SRL_BY_PATH'][$path]) |
|
| 353 | 353 | { |
| 354 | 354 | $args = new stdClass(); |
| 355 | 355 | $args->path = $path; |
@@ -370,12 +370,12 @@ discard block |
||
| 370 | 370 | function getRemoveUrlByPackageSrl($packageSrl) |
| 371 | 371 | { |
| 372 | 372 | $ftp_info = Context::getFTPInfo(); |
| 373 | - if(!$ftp_info->ftp_root_path) |
|
| 373 | + if (!$ftp_info->ftp_root_path) |
|
| 374 | 374 | { |
| 375 | 375 | return; |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | - if(!$packageSrl) |
|
| 378 | + if (!$packageSrl) |
|
| 379 | 379 | { |
| 380 | 380 | return; |
| 381 | 381 | } |
@@ -391,19 +391,19 @@ discard block |
||
| 391 | 391 | */ |
| 392 | 392 | function getRemoveUrlByPath($path) |
| 393 | 393 | { |
| 394 | - if(!$path) |
|
| 394 | + if (!$path) |
|
| 395 | 395 | { |
| 396 | 396 | return; |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | $ftp_info = Context::getFTPInfo(); |
| 400 | - if(!$ftp_info->ftp_root_path) |
|
| 400 | + if (!$ftp_info->ftp_root_path) |
|
| 401 | 401 | { |
| 402 | 402 | return; |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | $packageSrl = $this->getPackageSrlByPath($path); |
| 406 | - if(!$packageSrl) |
|
| 406 | + if (!$packageSrl) |
|
| 407 | 407 | { |
| 408 | 408 | return; |
| 409 | 409 | } |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | */ |
| 420 | 420 | function getUpdateUrlByPackageSrl($packageSrl) |
| 421 | 421 | { |
| 422 | - if(!$packageSrl) |
|
| 422 | + if (!$packageSrl) |
|
| 423 | 423 | { |
| 424 | 424 | return; |
| 425 | 425 | } |
@@ -435,13 +435,13 @@ discard block |
||
| 435 | 435 | */ |
| 436 | 436 | function getUpdateUrlByPath($path) |
| 437 | 437 | { |
| 438 | - if(!$path) |
|
| 438 | + if (!$path) |
|
| 439 | 439 | { |
| 440 | 440 | return; |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | $packageSrl = $this->getPackageSrlByPath($path); |
| 444 | - if(!$packageSrl) |
|
| 444 | + if (!$packageSrl) |
|
| 445 | 445 | { |
| 446 | 446 | return; |
| 447 | 447 | } |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | function getHaveInstance($columnList = array()) |
| 453 | 453 | { |
| 454 | 454 | $output = executeQueryArray('autoinstall.getHaveInstance', NULL, $columnList); |
| 455 | - if(!$output->data) |
|
| 455 | + if (!$output->data) |
|
| 456 | 456 | { |
| 457 | 457 | return array(); |
| 458 | 458 | } |
@@ -27,37 +27,37 @@ discard block |
||
| 27 | 27 | $args = Context::getRequestVars(); |
| 28 | 28 | $args->module = 'board'; |
| 29 | 29 | $args->mid = $args->board_name; |
| 30 | - if(is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status); |
|
| 30 | + if (is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status); |
|
| 31 | 31 | unset($args->board_name); |
| 32 | 32 | |
| 33 | 33 | // setup extra_order_target |
| 34 | 34 | $extra_order_target = array(); |
| 35 | - if($args->module_srl) |
|
| 35 | + if ($args->module_srl) |
|
| 36 | 36 | { |
| 37 | 37 | $oDocumentModel = getModel('document'); |
| 38 | 38 | $module_extra_vars = $oDocumentModel->getExtraKeys($args->module_srl); |
| 39 | - foreach($module_extra_vars as $oExtraItem) |
|
| 39 | + foreach ($module_extra_vars as $oExtraItem) |
|
| 40 | 40 | { |
| 41 | 41 | $extra_order_target[$oExtraItem->eid] = $oExtraItem->name; |
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // setup other variables |
| 46 | - if($args->except_notice != 'Y') $args->except_notice = 'N'; |
|
| 47 | - if($args->use_anonymous != 'Y') $args->use_anonymous = 'N'; |
|
| 48 | - if($args->consultation != 'Y') $args->consultation = 'N'; |
|
| 49 | - if($args->protect_content!= 'Y') $args->protect_content = 'N'; |
|
| 50 | - if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order'; |
|
| 51 | - if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
| 46 | + if ($args->except_notice != 'Y') $args->except_notice = 'N'; |
|
| 47 | + if ($args->use_anonymous != 'Y') $args->use_anonymous = 'N'; |
|
| 48 | + if ($args->consultation != 'Y') $args->consultation = 'N'; |
|
| 49 | + if ($args->protect_content != 'Y') $args->protect_content = 'N'; |
|
| 50 | + if (!in_array($args->order_target, $this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order'; |
|
| 51 | + if (!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
| 52 | 52 | |
| 53 | 53 | // if there is an existed module |
| 54 | - if($args->module_srl) { |
|
| 54 | + if ($args->module_srl) { |
|
| 55 | 55 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl); |
| 56 | - if($module_info->module_srl != $args->module_srl) unset($args->module_srl); |
|
| 56 | + if ($module_info->module_srl != $args->module_srl) unset($args->module_srl); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // insert/update the board module based on module_srl |
| 60 | - if(!$args->module_srl) { |
|
| 60 | + if (!$args->module_srl) { |
|
| 61 | 61 | $args->hide_category = 'N'; |
| 62 | 62 | $output = $oModuleController->insertModule($args); |
| 63 | 63 | $msg_code = 'success_registed'; |
@@ -67,18 +67,18 @@ discard block |
||
| 67 | 67 | $msg_code = 'success_updated'; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if(!$output->toBool()) return $output; |
|
| 70 | + if (!$output->toBool()) return $output; |
|
| 71 | 71 | |
| 72 | 72 | // setup list config |
| 73 | - $list = explode(',',Context::get('list')); |
|
| 74 | - if(count($list)) |
|
| 73 | + $list = explode(',', Context::get('list')); |
|
| 74 | + if (count($list)) |
|
| 75 | 75 | { |
| 76 | 76 | $list_arr = array(); |
| 77 | - foreach($list as $val) |
|
| 77 | + foreach ($list as $val) |
|
| 78 | 78 | { |
| 79 | 79 | $val = trim($val); |
| 80 | - if(!$val) continue; |
|
| 81 | - if(substr($val,0,10)=='extra_vars') $val = substr($val,10); |
|
| 80 | + if (!$val) continue; |
|
| 81 | + if (substr($val, 0, 10) == 'extra_vars') $val = substr($val, 10); |
|
| 82 | 82 | $list_arr[] = $val; |
| 83 | 83 | } |
| 84 | 84 | $oModuleController = getController('module'); |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $this->setMessage($msg_code); |
| 89 | - if (Context::get('success_return_url')){ |
|
| 89 | + if (Context::get('success_return_url')) { |
|
| 90 | 90 | changeValueInUrl('mid', $args->mid, $module_info->mid); |
| 91 | 91 | $this->setRedirectUrl(Context::get('success_return_url')); |
| 92 | - }else{ |
|
| 92 | + } else { |
|
| 93 | 93 | $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminBoardInfo', 'module_srl', $output->get('module_srl'))); |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -105,17 +105,17 @@ discard block |
||
| 105 | 105 | // for board info |
| 106 | 106 | $args->module = 'board'; |
| 107 | 107 | $args->mid = $args->board_name; |
| 108 | - if(is_array($args->use_status)) |
|
| 108 | + if (is_array($args->use_status)) |
|
| 109 | 109 | { |
| 110 | 110 | $args->use_status = implode('|@|', $args->use_status); |
| 111 | 111 | } |
| 112 | 112 | unset($args->board_name); |
| 113 | 113 | |
| 114 | - if(!in_array($args->order_target, $this->order_target)) |
|
| 114 | + if (!in_array($args->order_target, $this->order_target)) |
|
| 115 | 115 | { |
| 116 | 116 | $args->order_target = 'list_order'; |
| 117 | 117 | } |
| 118 | - if(!in_array($args->order_type, array('asc', 'desc'))) |
|
| 118 | + if (!in_array($args->order_type, array('asc', 'desc'))) |
|
| 119 | 119 | { |
| 120 | 120 | $args->order_type = 'asc'; |
| 121 | 121 | } |
@@ -125,13 +125,13 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | // for grant info, Register Admin ID |
| 127 | 127 | $oModuleController->deleteAdminId($args->module_srl); |
| 128 | - if($args->admin_member) |
|
| 128 | + if ($args->admin_member) |
|
| 129 | 129 | { |
| 130 | - $admin_members = explode(',',$args->admin_member); |
|
| 131 | - for($i=0;$i<count($admin_members);$i++) |
|
| 130 | + $admin_members = explode(',', $args->admin_member); |
|
| 131 | + for ($i = 0; $i < count($admin_members); $i++) |
|
| 132 | 132 | { |
| 133 | 133 | $admin_id = trim($admin_members[$i]); |
| 134 | - if(!$admin_id) continue; |
|
| 134 | + if (!$admin_id) continue; |
|
| 135 | 135 | $oModuleController->insertAdminId($args->module_srl, $admin_id); |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -146,10 +146,10 @@ discard block |
||
| 146 | 146 | // get the current module |
| 147 | 147 | $oModuleController = getController('module'); |
| 148 | 148 | $output = $oModuleController->deleteModule($module_srl); |
| 149 | - if(!$output->toBool()) return $output; |
|
| 149 | + if (!$output->toBool()) return $output; |
|
| 150 | 150 | |
| 151 | - $this->add('module','board'); |
|
| 152 | - $this->add('page',Context::get('page')); |
|
| 151 | + $this->add('module', 'board'); |
|
| 152 | + $this->add('page', Context::get('page')); |
|
| 153 | 153 | $this->setMessage('success_deleted'); |
| 154 | 154 | } |
| 155 | 155 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | $oModuleModel = getModel('module'); |
| 162 | 162 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
| 163 | - if($module_info->mid != $mid) |
|
| 163 | + if ($module_info->mid != $mid) |
|
| 164 | 164 | { |
| 165 | 165 | return new Object(-1, 'msg_invalid_request'); |
| 166 | 166 | } |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $module_info->hide_category = Context::get('hide_category') == 'Y' ? 'Y' : 'N'; |
| 169 | 169 | $oModuleController = getController('module'); /* @var $oModuleController moduleController */ |
| 170 | 170 | $output = $oModuleController->updateModule($module_info); |
| 171 | - if(!$output->toBool()) |
|
| 171 | + if (!$output->toBool()) |
|
| 172 | 172 | { |
| 173 | 173 | return $output; |
| 174 | 174 | } |
@@ -27,7 +27,9 @@ discard block |
||
| 27 | 27 | $args = Context::getRequestVars(); |
| 28 | 28 | $args->module = 'board'; |
| 29 | 29 | $args->mid = $args->board_name; |
| 30 | - if(is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status); |
|
| 30 | + if(is_array($args->use_status)) { |
|
| 31 | + $args->use_status = implode('|@|', $args->use_status); |
|
| 32 | + } |
|
| 31 | 33 | unset($args->board_name); |
| 32 | 34 | |
| 33 | 35 | // setup extra_order_target |
@@ -43,17 +45,31 @@ discard block |
||
| 43 | 45 | } |
| 44 | 46 | |
| 45 | 47 | // setup other variables |
| 46 | - if($args->except_notice != 'Y') $args->except_notice = 'N'; |
|
| 47 | - if($args->use_anonymous != 'Y') $args->use_anonymous = 'N'; |
|
| 48 | - if($args->consultation != 'Y') $args->consultation = 'N'; |
|
| 49 | - if($args->protect_content!= 'Y') $args->protect_content = 'N'; |
|
| 50 | - if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order'; |
|
| 51 | - if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
| 48 | + if($args->except_notice != 'Y') { |
|
| 49 | + $args->except_notice = 'N'; |
|
| 50 | + } |
|
| 51 | + if($args->use_anonymous != 'Y') { |
|
| 52 | + $args->use_anonymous = 'N'; |
|
| 53 | + } |
|
| 54 | + if($args->consultation != 'Y') { |
|
| 55 | + $args->consultation = 'N'; |
|
| 56 | + } |
|
| 57 | + if($args->protect_content!= 'Y') { |
|
| 58 | + $args->protect_content = 'N'; |
|
| 59 | + } |
|
| 60 | + if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) { |
|
| 61 | + $args->order_target = 'list_order'; |
|
| 62 | + } |
|
| 63 | + if(!in_array($args->order_type, array('asc', 'desc'))) { |
|
| 64 | + $args->order_type = 'asc'; |
|
| 65 | + } |
|
| 52 | 66 | |
| 53 | 67 | // if there is an existed module |
| 54 | 68 | if($args->module_srl) { |
| 55 | 69 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl); |
| 56 | - if($module_info->module_srl != $args->module_srl) unset($args->module_srl); |
|
| 70 | + if($module_info->module_srl != $args->module_srl) { |
|
| 71 | + unset($args->module_srl); |
|
| 72 | + } |
|
| 57 | 73 | } |
| 58 | 74 | |
| 59 | 75 | // insert/update the board module based on module_srl |
@@ -67,7 +83,9 @@ discard block |
||
| 67 | 83 | $msg_code = 'success_updated'; |
| 68 | 84 | } |
| 69 | 85 | |
| 70 | - if(!$output->toBool()) return $output; |
|
| 86 | + if(!$output->toBool()) { |
|
| 87 | + return $output; |
|
| 88 | + } |
|
| 71 | 89 | |
| 72 | 90 | // setup list config |
| 73 | 91 | $list = explode(',',Context::get('list')); |
@@ -77,8 +95,12 @@ discard block |
||
| 77 | 95 | foreach($list as $val) |
| 78 | 96 | { |
| 79 | 97 | $val = trim($val); |
| 80 | - if(!$val) continue; |
|
| 81 | - if(substr($val,0,10)=='extra_vars') $val = substr($val,10); |
|
| 98 | + if(!$val) { |
|
| 99 | + continue; |
|
| 100 | + } |
|
| 101 | + if(substr($val,0,10)=='extra_vars') { |
|
| 102 | + $val = substr($val,10); |
|
| 103 | + } |
|
| 82 | 104 | $list_arr[] = $val; |
| 83 | 105 | } |
| 84 | 106 | $oModuleController = getController('module'); |
@@ -89,7 +111,7 @@ discard block |
||
| 89 | 111 | if (Context::get('success_return_url')){ |
| 90 | 112 | changeValueInUrl('mid', $args->mid, $module_info->mid); |
| 91 | 113 | $this->setRedirectUrl(Context::get('success_return_url')); |
| 92 | - }else{ |
|
| 114 | + } else{ |
|
| 93 | 115 | $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminBoardInfo', 'module_srl', $output->get('module_srl'))); |
| 94 | 116 | } |
| 95 | 117 | } |
@@ -131,7 +153,9 @@ discard block |
||
| 131 | 153 | for($i=0;$i<count($admin_members);$i++) |
| 132 | 154 | { |
| 133 | 155 | $admin_id = trim($admin_members[$i]); |
| 134 | - if(!$admin_id) continue; |
|
| 156 | + if(!$admin_id) { |
|
| 157 | + continue; |
|
| 158 | + } |
|
| 135 | 159 | $oModuleController->insertAdminId($args->module_srl, $admin_id); |
| 136 | 160 | } |
| 137 | 161 | } |
@@ -146,7 +170,9 @@ discard block |
||
| 146 | 170 | // get the current module |
| 147 | 171 | $oModuleController = getController('module'); |
| 148 | 172 | $output = $oModuleController->deleteModule($module_srl); |
| 149 | - if(!$output->toBool()) return $output; |
|
| 173 | + if(!$output->toBool()) { |
|
| 174 | + return $output; |
|
| 175 | + } |
|
| 150 | 176 | |
| 151 | 177 | $this->add('module','board'); |
| 152 | 178 | $this->add('page',Context::get('page')); |
@@ -177,8 +203,7 @@ discard block |
||
| 177 | 203 | if (Context::get('success_return_url')) |
| 178 | 204 | { |
| 179 | 205 | $this->setRedirectUrl(Context::get('success_return_url')); |
| 180 | - } |
|
| 181 | - else |
|
| 206 | + } else |
|
| 182 | 207 | { |
| 183 | 208 | $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminCategoryInfo', 'module_srl', $output->get('module_srl'))); |
| 184 | 209 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | function init() { |
| 18 | 18 | // check module_srl is existed or not |
| 19 | 19 | $module_srl = Context::get('module_srl'); |
| 20 | - if(!$module_srl && $this->module_srl) { |
|
| 20 | + if (!$module_srl && $this->module_srl) { |
|
| 21 | 21 | $module_srl = $this->module_srl; |
| 22 | 22 | Context::set('module_srl', $module_srl); |
| 23 | 23 | } |
@@ -26,20 +26,20 @@ discard block |
||
| 26 | 26 | $oModuleModel = getModel('module'); |
| 27 | 27 | |
| 28 | 28 | // get the module infomation based on the module_srl |
| 29 | - if($module_srl) { |
|
| 29 | + if ($module_srl) { |
|
| 30 | 30 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
| 31 | - if(!$module_info) { |
|
| 32 | - Context::set('module_srl',''); |
|
| 31 | + if (!$module_info) { |
|
| 32 | + Context::set('module_srl', ''); |
|
| 33 | 33 | $this->act = 'list'; |
| 34 | 34 | } else { |
| 35 | 35 | ModuleModel::syncModuleToSite($module_info); |
| 36 | 36 | $this->module_info = $module_info; |
| 37 | 37 | $this->module_info->use_status = explode('|@|', $module_info->use_status); |
| 38 | - Context::set('module_info',$module_info); |
|
| 38 | + Context::set('module_info', $module_info); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request"); |
|
| 42 | + if ($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request"); |
|
| 43 | 43 | |
| 44 | 44 | // get the module category list |
| 45 | 45 | $module_category = $oModuleModel->getModuleCategories(); |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | $security->encodeHTML('module_category..'); |
| 51 | 51 | |
| 52 | 52 | // setup template path (board admin panel templates is resided in the tpl folder) |
| 53 | - $template_path = sprintf("%stpl/",$this->module_path); |
|
| 53 | + $template_path = sprintf("%stpl/", $this->module_path); |
|
| 54 | 54 | $this->setTemplatePath($template_path); |
| 55 | 55 | |
| 56 | 56 | // install order (sorting) options |
| 57 | - foreach($this->order_target as $key) $order_target[$key] = Context::getLang($key); |
|
| 57 | + foreach ($this->order_target as $key) $order_target[$key] = Context::getLang($key); |
|
| 58 | 58 | $order_target['list_order'] = Context::getLang('document_srl'); |
| 59 | 59 | $order_target['update_order'] = Context::getLang('last_update'); |
| 60 | 60 | Context::set('order_target', $order_target); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $search_target = Context::get('search_target'); |
| 76 | 76 | $search_keyword = Context::get('search_keyword'); |
| 77 | 77 | |
| 78 | - switch ($search_target){ |
|
| 78 | + switch ($search_target) { |
|
| 79 | 79 | case 'mid': |
| 80 | 80 | $args->s_mid = $search_keyword; |
| 81 | 81 | break; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | // get the skins path |
| 91 | 91 | $oModuleModel = getModel('module'); |
| 92 | 92 | $skin_list = $oModuleModel->getSkins($this->module_path); |
| 93 | - Context::set('skin_list',$skin_list); |
|
| 93 | + Context::set('skin_list', $skin_list); |
|
| 94 | 94 | |
| 95 | 95 | $mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins"); |
| 96 | 96 | Context::set('mskin_list', $mskin_list); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $layout_list = $oLayoutModel->getLayoutList(); |
| 101 | 101 | Context::set('layout_list', $layout_list); |
| 102 | 102 | |
| 103 | - $mobile_layout_list = $oLayoutModel->getLayoutList(0,"M"); |
|
| 103 | + $mobile_layout_list = $oLayoutModel->getLayoutList(0, "M"); |
|
| 104 | 104 | Context::set('mlayout_list', $mobile_layout_list); |
| 105 | 105 | |
| 106 | 106 | $oModuleAdminModel = getAdminModel('module'); |
@@ -115,10 +115,10 @@ discard block |
||
| 115 | 115 | Context::set('page_navigation', $output->page_navigation); |
| 116 | 116 | |
| 117 | 117 | $security = new Security(); |
| 118 | - $security->encodeHTML('board_list..browser_title','board_list..mid'); |
|
| 119 | - $security->encodeHTML('skin_list..title','mskin_list..title'); |
|
| 120 | - $security->encodeHTML('layout_list..title','layout_list..layout'); |
|
| 121 | - $security->encodeHTML('mlayout_list..title','mlayout_list..layout'); |
|
| 118 | + $security->encodeHTML('board_list..browser_title', 'board_list..mid'); |
|
| 119 | + $security->encodeHTML('skin_list..title', 'mskin_list..title'); |
|
| 120 | + $security->encodeHTML('layout_list..title', 'layout_list..layout'); |
|
| 121 | + $security->encodeHTML('mlayout_list..title', 'mlayout_list..layout'); |
|
| 122 | 122 | |
| 123 | 123 | // 템플릿 파일 지정 |
| 124 | 124 | $this->setTemplateFile('index'); |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | * @brief display the module insert form |
| 136 | 136 | **/ |
| 137 | 137 | function dispBoardAdminInsertBoard() { |
| 138 | - if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) { |
|
| 138 | + if (!in_array($this->module_info->module, array('admin', 'board', 'blog', 'guestbook'))) { |
|
| 139 | 139 | return $this->alertMessage('msg_invalid_request'); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | // get the skins list |
| 143 | 143 | $oModuleModel = getModel('module'); |
| 144 | 144 | $skin_list = $oModuleModel->getSkins($this->module_path); |
| 145 | - Context::set('skin_list',$skin_list); |
|
| 145 | + Context::set('skin_list', $skin_list); |
|
| 146 | 146 | |
| 147 | 147 | $mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins"); |
| 148 | 148 | Context::set('mskin_list', $mskin_list); |
@@ -152,13 +152,13 @@ discard block |
||
| 152 | 152 | $layout_list = $oLayoutModel->getLayoutList(); |
| 153 | 153 | Context::set('layout_list', $layout_list); |
| 154 | 154 | |
| 155 | - $mobile_layout_list = $oLayoutModel->getLayoutList(0,"M"); |
|
| 155 | + $mobile_layout_list = $oLayoutModel->getLayoutList(0, "M"); |
|
| 156 | 156 | Context::set('mlayout_list', $mobile_layout_list); |
| 157 | 157 | |
| 158 | 158 | $security = new Security(); |
| 159 | - $security->encodeHTML('skin_list..title','mskin_list..title'); |
|
| 160 | - $security->encodeHTML('layout_list..title','layout_list..layout'); |
|
| 161 | - $security->encodeHTML('mlayout_list..title','mlayout_list..layout'); |
|
| 159 | + $security->encodeHTML('skin_list..title', 'mskin_list..title'); |
|
| 160 | + $security->encodeHTML('layout_list..title', 'layout_list..layout'); |
|
| 161 | + $security->encodeHTML('mlayout_list..title', 'mlayout_list..layout'); |
|
| 162 | 162 | |
| 163 | 163 | // get document status list |
| 164 | 164 | $oDocumentModel = getModel('document'); |
@@ -177,14 +177,14 @@ discard block |
||
| 177 | 177 | // setup extra_order_target |
| 178 | 178 | $module_extra_vars = $oDocumentModel->getExtraKeys($this->module_info->module_srl); |
| 179 | 179 | $extra_order_target = array(); |
| 180 | - foreach($module_extra_vars as $oExtraItem) |
|
| 180 | + foreach ($module_extra_vars as $oExtraItem) |
|
| 181 | 181 | { |
| 182 | 182 | $extra_order_target[$oExtraItem->eid] = $oExtraItem->name; |
| 183 | 183 | } |
| 184 | 184 | Context::set('extra_order_target', $extra_order_target); |
| 185 | 185 | |
| 186 | 186 | $security = new Security(); |
| 187 | - $security->encodeHTML('extra_vars..name','list_config..name'); |
|
| 187 | + $security->encodeHTML('extra_vars..name', 'list_config..name'); |
|
| 188 | 188 | |
| 189 | 189 | // set the template file |
| 190 | 190 | $this->setTemplateFile('board_insert'); |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | * @brief display the board mdoule delete page |
| 213 | 213 | **/ |
| 214 | 214 | function dispBoardAdminDeleteBoard() { |
| 215 | - if(!Context::get('module_srl')) return $this->dispBoardAdminContent(); |
|
| 216 | - if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) { |
|
| 215 | + if (!Context::get('module_srl')) return $this->dispBoardAdminContent(); |
|
| 216 | + if (!in_array($this->module_info->module, array('admin', 'board', 'blog', 'guestbook'))) { |
|
| 217 | 217 | return $this->alertMessage('msg_invalid_request'); |
| 218 | 218 | } |
| 219 | 219 | |
@@ -223,10 +223,10 @@ discard block |
||
| 223 | 223 | $document_count = $oDocumentModel->getDocumentCount($module_info->module_srl); |
| 224 | 224 | $module_info->document_count = $document_count; |
| 225 | 225 | |
| 226 | - Context::set('module_info',$module_info); |
|
| 226 | + Context::set('module_info', $module_info); |
|
| 227 | 227 | |
| 228 | 228 | $security = new Security(); |
| 229 | - $security->encodeHTML('module_info..mid','module_info..module','module_info..document_count'); |
|
| 229 | + $security->encodeHTML('module_info..mid', 'module_info..module', 'module_info..document_count'); |
|
| 230 | 230 | |
| 231 | 231 | // setup the template file |
| 232 | 232 | $this->setTemplateFile('board_delete'); |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | * @brief board module message |
| 296 | 296 | **/ |
| 297 | 297 | function alertMessage($message) { |
| 298 | - $script = sprintf('<script> xAddEventListener(window,"load", function() { alert("%s"); } );</script>', Context::getLang($message)); |
|
| 299 | - Context::addHtmlHeader( $script ); |
|
| 298 | + $script = sprintf('<script> xAddEventListener(window,"load", function() { alert("%s"); } );</script>', Context::getLang($message)); |
|
| 299 | + Context::addHtmlHeader($script); |
|
| 300 | 300 | } |
| 301 | 301 | } |
@@ -39,7 +39,9 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request"); |
|
| 42 | + if($module_info && $module_info->module != 'board') { |
|
| 43 | + return $this->stop("msg_invalid_request"); |
|
| 44 | + } |
|
| 43 | 45 | |
| 44 | 46 | // get the module category list |
| 45 | 47 | $module_category = $oModuleModel->getModuleCategories(); |
@@ -54,7 +56,9 @@ discard block |
||
| 54 | 56 | $this->setTemplatePath($template_path); |
| 55 | 57 | |
| 56 | 58 | // install order (sorting) options |
| 57 | - foreach($this->order_target as $key) $order_target[$key] = Context::getLang($key); |
|
| 59 | + foreach($this->order_target as $key) { |
|
| 60 | + $order_target[$key] = Context::getLang($key); |
|
| 61 | + } |
|
| 58 | 62 | $order_target['list_order'] = Context::getLang('document_srl'); |
| 59 | 63 | $order_target['update_order'] = Context::getLang('last_update'); |
| 60 | 64 | Context::set('order_target', $order_target); |
@@ -212,7 +216,9 @@ discard block |
||
| 212 | 216 | * @brief display the board mdoule delete page |
| 213 | 217 | **/ |
| 214 | 218 | function dispBoardAdminDeleteBoard() { |
| 215 | - if(!Context::get('module_srl')) return $this->dispBoardAdminContent(); |
|
| 219 | + if(!Context::get('module_srl')) { |
|
| 220 | + return $this->dispBoardAdminContent(); |
|
| 221 | + } |
|
| 216 | 222 | if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) { |
| 217 | 223 | return $this->alertMessage('msg_invalid_request'); |
| 218 | 224 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | class board extends ModuleObject |
| 11 | 11 | { |
| 12 | - var $search_option = array('title_content','title','content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션 |
|
| 12 | + var $search_option = array('title_content', 'title', 'content', 'comment', 'user_name', 'nick_name', 'user_id', 'tag'); ///< 검색 옵션 |
|
| 13 | 13 | |
| 14 | 14 | var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'blamed_count', 'readed_count', 'comment_count', 'title', 'nick_name', 'user_name', 'user_id'); // 정렬 옵션 |
| 15 | 15 | |
@@ -25,9 +25,9 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | function board() |
| 27 | 27 | { |
| 28 | - if(!Context::isInstalled()) return; |
|
| 28 | + if (!Context::isInstalled()) return; |
|
| 29 | 29 | |
| 30 | - if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
|
| 30 | + if (!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
|
| 31 | 31 | { |
| 32 | 32 | $ssl_actions = array('dispBoardWrite', 'dispBoardWriteComment', 'dispBoardReplyComment', 'dispBoardModifyComment', 'dispBoardDelete', 'dispBoardDeleteComment', 'procBoardInsertDocument', 'procBoardDeleteDocument', 'procBoardInsertComment', 'procBoardDeleteComment', 'procBoardVerificationPassword'); |
| 33 | 33 | Context::addSSLActions($ssl_actions); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $args = new stdClass; |
| 51 | 51 | $args->site_srl = 0; |
| 52 | 52 | $output = executeQuery('module.getSite', $args); |
| 53 | - if(!$output->data->index_module_srl) |
|
| 53 | + if (!$output->data->index_module_srl) |
|
| 54 | 54 | { |
| 55 | 55 | $args->mid = 'board'; |
| 56 | 56 | $args->module = 'board'; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $args->site_srl = 0; |
| 60 | 60 | $output = $oModuleController->insertModule($args); |
| 61 | 61 | |
| 62 | - if($output->toBool()) |
|
| 62 | + if ($output->toBool()) |
|
| 63 | 63 | { |
| 64 | 64 | $module_srl = $output->get('module_srl'); |
| 65 | 65 | |
@@ -83,10 +83,10 @@ discard block |
||
| 83 | 83 | $oModuleModel = getModel('module'); |
| 84 | 84 | |
| 85 | 85 | // 2007. 10. 17 get the member menu trigger |
| 86 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
| 86 | + if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
| 87 | 87 | |
| 88 | 88 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
| 89 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
| 89 | + if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
| 90 | 90 | return false; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -99,13 +99,13 @@ discard block |
||
| 99 | 99 | $oModuleController = getController('module'); |
| 100 | 100 | |
| 101 | 101 | // 2007. 10. 17 check the member menu trigger, if it is not existed then insert |
| 102 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) |
|
| 102 | + if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) |
|
| 103 | 103 | { |
| 104 | 104 | $oModuleController->insertTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
| 108 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) |
|
| 108 | + if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) |
|
| 109 | 109 | { |
| 110 | 110 | $oModuleController->insertTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'); |
| 111 | 111 | } |
@@ -116,12 +116,12 @@ discard block |
||
| 116 | 116 | function moduleUninstall() |
| 117 | 117 | { |
| 118 | 118 | $output = executeQueryArray("board.getAllBoard"); |
| 119 | - if(!$output->data) return new Object(); |
|
| 119 | + if (!$output->data) return new Object(); |
|
| 120 | 120 | @set_time_limit(0); |
| 121 | 121 | |
| 122 | 122 | $oModuleController = getController('module'); |
| 123 | 123 | |
| 124 | - foreach($output->data as $board) |
|
| 124 | + foreach ($output->data as $board) |
|
| 125 | 125 | { |
| 126 | 126 | $oModuleController->deleteModule($board->module_srl); |
| 127 | 127 | } |
@@ -25,7 +25,9 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | function board() |
| 27 | 27 | { |
| 28 | - if(!Context::isInstalled()) return; |
|
| 28 | + if(!Context::isInstalled()) { |
|
| 29 | + return; |
|
| 30 | + } |
|
| 29 | 31 | |
| 30 | 32 | if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
| 31 | 33 | { |
@@ -83,10 +85,14 @@ discard block |
||
| 83 | 85 | $oModuleModel = getModel('module'); |
| 84 | 86 | |
| 85 | 87 | // 2007. 10. 17 get the member menu trigger |
| 86 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
| 88 | + if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) { |
|
| 89 | + return true; |
|
| 90 | + } |
|
| 87 | 91 | |
| 88 | 92 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
| 89 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
| 93 | + if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) { |
|
| 94 | + return true; |
|
| 95 | + } |
|
| 90 | 96 | return false; |
| 91 | 97 | } |
| 92 | 98 | |
@@ -116,7 +122,9 @@ discard block |
||
| 116 | 122 | function moduleUninstall() |
| 117 | 123 | { |
| 118 | 124 | $output = executeQueryArray("board.getAllBoard"); |
| 119 | - if(!$output->data) return new Object(); |
|
| 125 | + if(!$output->data) { |
|
| 126 | + return new Object(); |
|
| 127 | + } |
|
| 120 | 128 | @set_time_limit(0); |
| 121 | 129 | |
| 122 | 130 | $oModuleController = getController('module'); |
@@ -36,13 +36,19 @@ discard block |
||
| 36 | 36 | // setup variables |
| 37 | 37 | $obj = Context::getRequestVars(); |
| 38 | 38 | $obj->module_srl = $this->module_srl; |
| 39 | - if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N'; |
|
| 39 | + if($obj->is_notice!='Y'||!$this->grant->manager) { |
|
| 40 | + $obj->is_notice = 'N'; |
|
| 41 | + } |
|
| 40 | 42 | $obj->commentStatus = $obj->comment_status; |
| 41 | 43 | |
| 42 | 44 | settype($obj->title, "string"); |
| 43 | - if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
| 45 | + if($obj->title == '') { |
|
| 46 | + $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
| 47 | + } |
|
| 44 | 48 | //setup dpcument title tp 'Untitled' |
| 45 | - if($obj->title == '') $obj->title = 'Untitled'; |
|
| 49 | + if($obj->title == '') { |
|
| 50 | + $obj->title = 'Untitled'; |
|
| 51 | + } |
|
| 46 | 52 | |
| 47 | 53 | // unset document style if the user is not the document manager |
| 48 | 54 | if(!$this->grant->manager) |
@@ -83,8 +89,7 @@ discard block |
||
| 83 | 89 | { |
| 84 | 90 | $oDocument->add('member_srl', $obj->member_srl); |
| 85 | 91 | } |
| 86 | - } |
|
| 87 | - else |
|
| 92 | + } else |
|
| 88 | 93 | { |
| 89 | 94 | $bAnonymous = false; |
| 90 | 95 | } |
@@ -148,7 +153,9 @@ discard block |
||
| 148 | 153 | for($i=0;$i<count($target_mail);$i++) |
| 149 | 154 | { |
| 150 | 155 | $email_address = trim($target_mail[$i]); |
| 151 | - if(!$email_address) continue; |
|
| 156 | + if(!$email_address) { |
|
| 157 | + continue; |
|
| 158 | + } |
|
| 152 | 159 | $oMail->setReceiptor($email_address, $email_address); |
| 153 | 160 | $oMail->send(); |
| 154 | 161 | } |
@@ -236,7 +243,9 @@ discard block |
||
| 236 | 243 | $obj = Context::getRequestVars(); |
| 237 | 244 | $obj->module_srl = $this->module_srl; |
| 238 | 245 | |
| 239 | - if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
| 246 | + if(!$this->module_info->use_status) { |
|
| 247 | + $this->module_info->use_status = 'PUBLIC'; |
|
| 248 | + } |
|
| 240 | 249 | if(!is_array($this->module_info->use_status)) |
| 241 | 250 | { |
| 242 | 251 | $this->module_info->use_status = explode('|@|', $this->module_info->use_status); |
@@ -245,8 +254,7 @@ discard block |
||
| 245 | 254 | if(in_array('SECRET', $this->module_info->use_status)) |
| 246 | 255 | { |
| 247 | 256 | $this->module_info->secret = 'Y'; |
| 248 | - } |
|
| 249 | - else |
|
| 257 | + } else |
|
| 250 | 258 | { |
| 251 | 259 | unset($obj->is_secret); |
| 252 | 260 | $this->module_info->secret = 'N'; |
@@ -269,8 +277,7 @@ discard block |
||
| 269 | 277 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
| 270 | 278 | $obj->user_name = $obj->nick_name = 'anonymous'; |
| 271 | 279 | $bAnonymous = true; |
| 272 | - } |
|
| 273 | - else |
|
| 280 | + } else |
|
| 274 | 281 | { |
| 275 | 282 | $bAnonymous = false; |
| 276 | 283 | } |
@@ -370,7 +377,9 @@ discard block |
||
| 370 | 377 | // generate trackback module controller object |
| 371 | 378 | $oTrackbackController = getController('trackback'); |
| 372 | 379 | |
| 373 | - if(!$oTrackbackController) return; |
|
| 380 | + if(!$oTrackbackController) { |
|
| 381 | + return; |
|
| 382 | + } |
|
| 374 | 383 | |
| 375 | 384 | $output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager); |
| 376 | 385 | if(!$output->toBool()) |
@@ -23,11 +23,11 @@ discard block |
||
| 23 | 23 | function procBoardInsertDocument() |
| 24 | 24 | { |
| 25 | 25 | // check grant |
| 26 | - if($this->module_info->module != "board") |
|
| 26 | + if ($this->module_info->module != "board") |
|
| 27 | 27 | { |
| 28 | 28 | return new Object(-1, "msg_invalid_request"); |
| 29 | 29 | } |
| 30 | - if(!$this->grant->write_document) |
|
| 30 | + if (!$this->grant->write_document) |
|
| 31 | 31 | { |
| 32 | 32 | return new Object(-1, 'msg_not_permitted'); |
| 33 | 33 | } |
@@ -36,16 +36,16 @@ discard block |
||
| 36 | 36 | // setup variables |
| 37 | 37 | $obj = Context::getRequestVars(); |
| 38 | 38 | $obj->module_srl = $this->module_srl; |
| 39 | - if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N'; |
|
| 39 | + if ($obj->is_notice != 'Y' || !$this->grant->manager) $obj->is_notice = 'N'; |
|
| 40 | 40 | $obj->commentStatus = $obj->comment_status; |
| 41 | 41 | |
| 42 | 42 | settype($obj->title, "string"); |
| 43 | - if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
| 43 | + if ($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))), 20, '...'); |
|
| 44 | 44 | //setup dpcument title tp 'Untitled' |
| 45 | - if($obj->title == '') $obj->title = 'Untitled'; |
|
| 45 | + if ($obj->title == '') $obj->title = 'Untitled'; |
|
| 46 | 46 | |
| 47 | 47 | // unset document style if the user is not the document manager |
| 48 | - if(!$this->grant->manager) |
|
| 48 | + if (!$this->grant->manager) |
|
| 49 | 49 | { |
| 50 | 50 | unset($obj->title_color); |
| 51 | 51 | unset($obj->title_bold); |
@@ -62,24 +62,24 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // update the document if it is existed |
| 64 | 64 | $is_update = false; |
| 65 | - if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
| 65 | + if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
| 66 | 66 | { |
| 67 | 67 | $is_update = true; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // if use anonymous is true |
| 71 | - if($this->module_info->use_anonymous == 'Y') |
|
| 71 | + if ($this->module_info->use_anonymous == 'Y') |
|
| 72 | 72 | { |
| 73 | 73 | $this->module_info->admin_mail = ''; |
| 74 | 74 | $obj->notify_message = 'N'; |
| 75 | - if($is_update===false) |
|
| 75 | + if ($is_update === false) |
|
| 76 | 76 | { |
| 77 | - $obj->member_srl = -1*$logged_info->member_srl; |
|
| 77 | + $obj->member_srl = -1 * $logged_info->member_srl; |
|
| 78 | 78 | } |
| 79 | 79 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
| 80 | 80 | $obj->user_name = $obj->nick_name = 'anonymous'; |
| 81 | 81 | $bAnonymous = true; |
| 82 | - if($is_update===false) |
|
| 82 | + if ($is_update === false) |
|
| 83 | 83 | { |
| 84 | 84 | $oDocument->add('member_srl', $obj->member_srl); |
| 85 | 85 | } |
@@ -89,10 +89,10 @@ discard block |
||
| 89 | 89 | $bAnonymous = false; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - if($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET')) |
|
| 92 | + if ($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET')) |
|
| 93 | 93 | { |
| 94 | 94 | $use_status = explode('|@|', $this->module_info->use_status); |
| 95 | - if(!is_array($use_status) || !in_array('SECRET', $use_status)) |
|
| 95 | + if (!is_array($use_status) || !in_array('SECRET', $use_status)) |
|
| 96 | 96 | { |
| 97 | 97 | unset($obj->is_secret); |
| 98 | 98 | $obj->status = 'PUBLIC'; |
@@ -100,24 +100,24 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | // update the document if it is existed |
| 103 | - if($is_update) |
|
| 103 | + if ($is_update) |
|
| 104 | 104 | { |
| 105 | - if(!$oDocument->isGranted()) |
|
| 105 | + if (!$oDocument->isGranted()) |
|
| 106 | 106 | { |
| 107 | - return new Object(-1,'msg_not_permitted'); |
|
| 107 | + return new Object(-1, 'msg_not_permitted'); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - if($this->module_info->use_anonymous == 'Y') { |
|
| 110 | + if ($this->module_info->use_anonymous == 'Y') { |
|
| 111 | 111 | $obj->member_srl = abs($oDocument->get('member_srl')) * -1; |
| 112 | 112 | $oDocument->add('member_srl', $obj->member_srl); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
| 115 | + if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
| 116 | 116 | { |
| 117 | - return new Object(-1,'msg_protect_content'); |
|
| 117 | + return new Object(-1, 'msg_protect_content'); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - if(!$this->grant->manager) |
|
| 120 | + if (!$this->grant->manager) |
|
| 121 | 121 | { |
| 122 | 122 | // notice & document style same as before if not manager |
| 123 | 123 | $obj->is_notice = $oDocument->get('is_notice'); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | // modify list_order if document status is temp |
| 129 | - if($oDocument->get('status') == 'TEMP') |
|
| 129 | + if ($oDocument->get('status') == 'TEMP') |
|
| 130 | 130 | { |
| 131 | 131 | $obj->last_update = $obj->regdate = date('YmdHis'); |
| 132 | 132 | $obj->update_order = $obj->list_order = (getNextSequence() * -1); |
@@ -142,18 +142,18 @@ discard block |
||
| 142 | 142 | $obj->document_srl = $output->get('document_srl'); |
| 143 | 143 | |
| 144 | 144 | // send an email to admin user |
| 145 | - if($output->toBool() && $this->module_info->admin_mail) |
|
| 145 | + if ($output->toBool() && $this->module_info->admin_mail) |
|
| 146 | 146 | { |
| 147 | 147 | $oMail = new Mail(); |
| 148 | 148 | $oMail->setTitle($obj->title); |
| 149 | - $oMail->setContent( sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content)); |
|
| 149 | + $oMail->setContent(sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('', 'document_srl', $obj->document_srl), getFullUrl('', 'document_srl', $obj->document_srl), $obj->content)); |
|
| 150 | 150 | $oMail->setSender($obj->user_name, $obj->email_address); |
| 151 | 151 | |
| 152 | - $target_mail = explode(',',$this->module_info->admin_mail); |
|
| 153 | - for($i=0;$i<count($target_mail);$i++) |
|
| 152 | + $target_mail = explode(',', $this->module_info->admin_mail); |
|
| 153 | + for ($i = 0; $i < count($target_mail); $i++) |
|
| 154 | 154 | { |
| 155 | 155 | $email_address = trim($target_mail[$i]); |
| 156 | - if(!$email_address) continue; |
|
| 156 | + if (!$email_address) continue; |
|
| 157 | 157 | $oMail->setReceiptor($email_address, $email_address); |
| 158 | 158 | $oMail->send(); |
| 159 | 159 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | // if there is an error |
| 164 | - if(!$output->toBool()) |
|
| 164 | + if (!$output->toBool()) |
|
| 165 | 165 | { |
| 166 | 166 | return $output; |
| 167 | 167 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $this->add('document_srl', $output->get('document_srl')); |
| 172 | 172 | |
| 173 | 173 | // alert a message |
| 174 | - if(Context::get('xeVirtualRequestMethod') !== 'xml') |
|
| 174 | + if (Context::get('xeVirtualRequestMethod') !== 'xml') |
|
| 175 | 175 | { |
| 176 | 176 | $this->setMessage($msg_code); |
| 177 | 177 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $document_srl = Context::get('document_srl'); |
| 187 | 187 | |
| 188 | 188 | // if the document is not existed |
| 189 | - if(!$document_srl) |
|
| 189 | + if (!$document_srl) |
|
| 190 | 190 | { |
| 191 | 191 | return $this->doError('msg_invalid_document'); |
| 192 | 192 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $oDocumentModel = &getModel('document'); |
| 195 | 195 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 196 | 196 | // check protect content |
| 197 | - if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
| 197 | + if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
| 198 | 198 | { |
| 199 | 199 | return new Object(-1, 'msg_protect_content'); |
| 200 | 200 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | |
| 205 | 205 | // delete the document |
| 206 | 206 | $output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager); |
| 207 | - if(!$output->toBool()) |
|
| 207 | + if (!$output->toBool()) |
|
| 208 | 208 | { |
| 209 | 209 | return $output; |
| 210 | 210 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '', 'page', Context::get('page'), 'document_srl', '')); |
| 214 | 214 | $this->add('mid', Context::get('mid')); |
| 215 | 215 | $this->add('page', Context::get('page')); |
| 216 | - if(Context::get('xeVirtualRequestMethod') !== 'xml') |
|
| 216 | + if (Context::get('xeVirtualRequestMethod') !== 'xml') |
|
| 217 | 217 | { |
| 218 | 218 | $this->setMessage('success_deleted'); |
| 219 | 219 | } |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | function procBoardInsertComment() |
| 238 | 238 | { |
| 239 | 239 | // check grant |
| 240 | - if(!$this->grant->write_comment) |
|
| 240 | + if (!$this->grant->write_comment) |
|
| 241 | 241 | { |
| 242 | 242 | return new Object(-1, 'msg_not_permitted'); |
| 243 | 243 | } |
@@ -247,13 +247,13 @@ discard block |
||
| 247 | 247 | $obj = Context::getRequestVars(); |
| 248 | 248 | $obj->module_srl = $this->module_srl; |
| 249 | 249 | |
| 250 | - if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
| 251 | - if(!is_array($this->module_info->use_status)) |
|
| 250 | + if (!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
| 251 | + if (!is_array($this->module_info->use_status)) |
|
| 252 | 252 | { |
| 253 | 253 | $this->module_info->use_status = explode('|@|', $this->module_info->use_status); |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - if(in_array('SECRET', $this->module_info->use_status)) |
|
| 256 | + if (in_array('SECRET', $this->module_info->use_status)) |
|
| 257 | 257 | { |
| 258 | 258 | $this->module_info->secret = 'Y'; |
| 259 | 259 | } |
@@ -266,17 +266,17 @@ discard block |
||
| 266 | 266 | // check if the doument is existed |
| 267 | 267 | $oDocumentModel = getModel('document'); |
| 268 | 268 | $oDocument = $oDocumentModel->getDocument($obj->document_srl); |
| 269 | - if(!$oDocument->isExists()) |
|
| 269 | + if (!$oDocument->isExists()) |
|
| 270 | 270 | { |
| 271 | - return new Object(-1,'msg_not_founded'); |
|
| 271 | + return new Object(-1, 'msg_not_founded'); |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | // For anonymous use, remove writer's information and notifying information |
| 275 | - if($this->module_info->use_anonymous == 'Y') |
|
| 275 | + if ($this->module_info->use_anonymous == 'Y') |
|
| 276 | 276 | { |
| 277 | 277 | $this->module_info->admin_mail = ''; |
| 278 | 278 | $obj->notify_message = 'N'; |
| 279 | - $obj->member_srl = -1*$logged_info->member_srl; |
|
| 279 | + $obj->member_srl = -1 * $logged_info->member_srl; |
|
| 280 | 280 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
| 281 | 281 | $obj->user_name = $obj->nick_name = 'anonymous'; |
| 282 | 282 | $bAnonymous = true; |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | |
| 295 | 295 | // check the comment is existed |
| 296 | 296 | // if the comment is not existed, then generate a new sequence |
| 297 | - if(!$obj->comment_srl) |
|
| 297 | + if (!$obj->comment_srl) |
|
| 298 | 298 | { |
| 299 | 299 | $obj->comment_srl = getNextSequence(); |
| 300 | 300 | } else { |
@@ -302,14 +302,14 @@ discard block |
||
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | // if comment_srl is not existed, then insert the comment |
| 305 | - if($comment->comment_srl != $obj->comment_srl) |
|
| 305 | + if ($comment->comment_srl != $obj->comment_srl) |
|
| 306 | 306 | { |
| 307 | 307 | |
| 308 | 308 | // parent_srl is existed |
| 309 | - if($obj->parent_srl) |
|
| 309 | + if ($obj->parent_srl) |
|
| 310 | 310 | { |
| 311 | 311 | $parent_comment = $oCommentModel->getComment($obj->parent_srl); |
| 312 | - if(!$parent_comment->comment_srl) |
|
| 312 | + if (!$parent_comment->comment_srl) |
|
| 313 | 313 | { |
| 314 | 314 | return new Object(-1, 'msg_invalid_request'); |
| 315 | 315 | } |
@@ -323,9 +323,9 @@ discard block |
||
| 323 | 323 | // update the comment if it is not existed |
| 324 | 324 | } else { |
| 325 | 325 | // check the grant |
| 326 | - if(!$comment->isGranted()) |
|
| 326 | + if (!$comment->isGranted()) |
|
| 327 | 327 | { |
| 328 | - return new Object(-1,'msg_not_permitted'); |
|
| 328 | + return new Object(-1, 'msg_not_permitted'); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | $obj->parent_srl = $comment->parent_srl; |
@@ -333,12 +333,12 @@ discard block |
||
| 333 | 333 | $comment_srl = $obj->comment_srl; |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | - if(!$output->toBool()) |
|
| 336 | + if (!$output->toBool()) |
|
| 337 | 337 | { |
| 338 | 338 | return $output; |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - if(Context::get('xeVirtualRequestMethod') !== 'xml') |
|
| 341 | + if (Context::get('xeVirtualRequestMethod') !== 'xml') |
|
| 342 | 342 | { |
| 343 | 343 | $this->setMessage('success_registed'); |
| 344 | 344 | } |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | { |
| 355 | 355 | // get the comment_srl |
| 356 | 356 | $comment_srl = Context::get('comment_srl'); |
| 357 | - if(!$comment_srl) |
|
| 357 | + if (!$comment_srl) |
|
| 358 | 358 | { |
| 359 | 359 | return $this->doError('msg_invalid_request'); |
| 360 | 360 | } |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | $oCommentController = getController('comment'); |
| 364 | 364 | |
| 365 | 365 | $output = $oCommentController->deleteComment($comment_srl, $this->grant->manager); |
| 366 | - if(!$output->toBool()) |
|
| 366 | + if (!$output->toBool()) |
|
| 367 | 367 | { |
| 368 | 368 | return $output; |
| 369 | 369 | } |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $this->add('mid', Context::get('mid')); |
| 372 | 372 | $this->add('page', Context::get('page')); |
| 373 | 373 | $this->add('document_srl', $output->get('document_srl')); |
| 374 | - if(Context::get('xeVirtualRequestMethod') !== 'xml') |
|
| 374 | + if (Context::get('xeVirtualRequestMethod') !== 'xml') |
|
| 375 | 375 | { |
| 376 | 376 | $this->setMessage('success_deleted'); |
| 377 | 377 | } |
@@ -387,10 +387,10 @@ discard block |
||
| 387 | 387 | // generate trackback module controller object |
| 388 | 388 | $oTrackbackController = getController('trackback'); |
| 389 | 389 | |
| 390 | - if(!$oTrackbackController) return; |
|
| 390 | + if (!$oTrackbackController) return; |
|
| 391 | 391 | |
| 392 | 392 | $output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager); |
| 393 | - if(!$output->toBool()) |
|
| 393 | + if (!$output->toBool()) |
|
| 394 | 394 | { |
| 395 | 395 | return $output; |
| 396 | 396 | } |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | $this->add('mid', Context::get('mid')); |
| 399 | 399 | $this->add('page', Context::get('page')); |
| 400 | 400 | $this->add('document_srl', $output->get('document_srl')); |
| 401 | - if(Context::get('xeVirtualRequestMethod') !== 'xml') |
|
| 401 | + if (Context::get('xeVirtualRequestMethod') !== 'xml') |
|
| 402 | 402 | { |
| 403 | 403 | $this->setMessage('success_deleted'); |
| 404 | 404 | } |
@@ -417,18 +417,18 @@ discard block |
||
| 417 | 417 | $oMemberModel = getModel('member'); |
| 418 | 418 | |
| 419 | 419 | // if the comment exists |
| 420 | - if($comment_srl) |
|
| 420 | + if ($comment_srl) |
|
| 421 | 421 | { |
| 422 | 422 | // get the comment information |
| 423 | 423 | $oCommentModel = getModel('comment'); |
| 424 | 424 | $oComment = $oCommentModel->getComment($comment_srl); |
| 425 | - if(!$oComment->isExists()) |
|
| 425 | + if (!$oComment->isExists()) |
|
| 426 | 426 | { |
| 427 | 427 | return new Object(-1, 'msg_invalid_request'); |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | // compare the comment password and the user input password |
| 431 | - if(!$oMemberModel->isValidPassword($oComment->get('password'),$password)) |
|
| 431 | + if (!$oMemberModel->isValidPassword($oComment->get('password'), $password)) |
|
| 432 | 432 | { |
| 433 | 433 | return new Object(-1, 'msg_invalid_password'); |
| 434 | 434 | } |
@@ -438,13 +438,13 @@ discard block |
||
| 438 | 438 | // get the document information |
| 439 | 439 | $oDocumentModel = getModel('document'); |
| 440 | 440 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 441 | - if(!$oDocument->isExists()) |
|
| 441 | + if (!$oDocument->isExists()) |
|
| 442 | 442 | { |
| 443 | 443 | return new Object(-1, 'msg_invalid_request'); |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | // compare the document password and the user input password |
| 447 | - if(!$oMemberModel->isValidPassword($oDocument->get('password'),$password)) |
|
| 447 | + if (!$oMemberModel->isValidPassword($oDocument->get('password'), $password)) |
|
| 448 | 448 | { |
| 449 | 449 | return new Object(-1, 'msg_invalid_password'); |
| 450 | 450 | } |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | $member_srl = Context::get('target_srl'); |
| 462 | 462 | $mid = Context::get('cur_mid'); |
| 463 | 463 | |
| 464 | - if(!$member_srl || !$mid) |
|
| 464 | + if (!$member_srl || !$mid) |
|
| 465 | 465 | { |
| 466 | 466 | return new Object(); |
| 467 | 467 | } |
@@ -473,13 +473,13 @@ discard block |
||
| 473 | 473 | $columnList = array('module'); |
| 474 | 474 | $cur_module_info = $oModuleModel->getModuleInfoByMid($mid, 0, $columnList); |
| 475 | 475 | |
| 476 | - if($cur_module_info->module != 'board') |
|
| 476 | + if ($cur_module_info->module != 'board') |
|
| 477 | 477 | { |
| 478 | 478 | return new Object(); |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | // get the member information |
| 482 | - if($member_srl == $logged_info->member_srl) |
|
| 482 | + if ($member_srl == $logged_info->member_srl) |
|
| 483 | 483 | { |
| 484 | 484 | $member_info = $logged_info; |
| 485 | 485 | } else { |
@@ -487,13 +487,13 @@ discard block |
||
| 487 | 487 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | - if(!$member_info->user_id) |
|
| 490 | + if (!$member_info->user_id) |
|
| 491 | 491 | { |
| 492 | 492 | return new Object(); |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | //search |
| 496 | - $url = getUrl('','mid',$mid,'search_target','nick_name','search_keyword',$member_info->nick_name); |
|
| 496 | + $url = getUrl('', 'mid', $mid, 'search_target', 'nick_name', 'search_keyword', $member_info->nick_name); |
|
| 497 | 497 | $oMemberController = getController('member'); |
| 498 | 498 | $oMemberController->addMemberPopupMenu($url, 'cmd_view_own_document', ''); |
| 499 | 499 | |
@@ -10,12 +10,24 @@ discard block |
||
| 10 | 10 | $oSecurity = new Security(); |
| 11 | 11 | $oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl');
|
| 12 | 12 | |
| 13 | - if($this->module_info->list_count) $this->list_count = $this->module_info->list_count; |
|
| 14 | - if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count; |
|
| 15 | - if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count; |
|
| 16 | - if($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count; |
|
| 17 | - if($this->module_info->page_count) $this->page_count = $this->module_info->page_count; |
|
| 18 | - if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count; |
|
| 13 | + if($this->module_info->list_count) { |
|
| 14 | + $this->list_count = $this->module_info->list_count; |
|
| 15 | + } |
|
| 16 | + if($this->module_info->mobile_list_count) { |
|
| 17 | + $this->list_count = $this->module_info->mobile_list_count; |
|
| 18 | + } |
|
| 19 | + if($this->module_info->search_list_count) { |
|
| 20 | + $this->search_list_count = $this->module_info->search_list_count; |
|
| 21 | + } |
|
| 22 | + if($this->module_info->mobile_search_list_count) { |
|
| 23 | + $this->list_count = $this->module_info->mobile_search_list_count; |
|
| 24 | + } |
|
| 25 | + if($this->module_info->page_count) { |
|
| 26 | + $this->page_count = $this->module_info->page_count; |
|
| 27 | + } |
|
| 28 | + if($this->module_info->mobile_page_count) { |
|
| 29 | + $this->page_count = $this->module_info->mobile_page_count; |
|
| 30 | + } |
|
| 19 | 31 | $this->except_notice = $this->module_info->except_notice == 'N' ? false : true; |
| 20 | 32 | |
| 21 | 33 | // $this->_getStatusNameListecret option backward compatibility |
@@ -34,18 +46,15 @@ discard block |
||
| 34 | 46 | if($this->module_info->hide_category) |
| 35 | 47 | {
|
| 36 | 48 | $this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y'; |
| 37 | - } |
|
| 38 | - else if($this->module_info->use_category) |
|
| 49 | + } else if($this->module_info->use_category) |
|
| 39 | 50 | {
|
| 40 | 51 | $this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y'; |
| 41 | - } |
|
| 42 | - else |
|
| 52 | + } else |
|
| 43 | 53 | {
|
| 44 | 54 | $this->module_info->hide_category = 'N'; |
| 45 | 55 | $this->module_info->use_category = 'Y'; |
| 46 | 56 | } |
| 47 | - } |
|
| 48 | - else |
|
| 57 | + } else |
|
| 49 | 58 | {
|
| 50 | 59 | $this->module_info->hide_category = 'Y'; |
| 51 | 60 | $this->module_info->use_category = 'N'; |
@@ -58,7 +67,9 @@ discard block |
||
| 58 | 67 | if($this->module_info->consultation == 'Y' && !$this->grant->manager) |
| 59 | 68 | {
|
| 60 | 69 | $this->consultation = true; |
| 61 | - if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
|
|
| 70 | + if(!Context::get('is_logged')) { |
|
| 71 | + $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false; |
|
| 72 | + } |
|
| 62 | 73 | } else {
|
| 63 | 74 | $this->consultation = false; |
| 64 | 75 | } |
@@ -10,32 +10,32 @@ discard block |
||
| 10 | 10 | $oSecurity = new Security(); |
| 11 | 11 | $oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl');
|
| 12 | 12 | |
| 13 | - if($this->module_info->list_count) $this->list_count = $this->module_info->list_count; |
|
| 14 | - if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count; |
|
| 15 | - if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count; |
|
| 16 | - if($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count; |
|
| 17 | - if($this->module_info->page_count) $this->page_count = $this->module_info->page_count; |
|
| 18 | - if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count; |
|
| 13 | + if ($this->module_info->list_count) $this->list_count = $this->module_info->list_count; |
|
| 14 | + if ($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count; |
|
| 15 | + if ($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count; |
|
| 16 | + if ($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count; |
|
| 17 | + if ($this->module_info->page_count) $this->page_count = $this->module_info->page_count; |
|
| 18 | + if ($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count; |
|
| 19 | 19 | $this->except_notice = $this->module_info->except_notice == 'N' ? false : true; |
| 20 | 20 | |
| 21 | 21 | // $this->_getStatusNameListecret option backward compatibility |
| 22 | 22 | $oDocumentModel = getModel('document');
|
| 23 | 23 | |
| 24 | 24 | $statusList = $this->_getStatusNameList($oDocumentModel); |
| 25 | - if(isset($statusList['SECRET'])) |
|
| 25 | + if (isset($statusList['SECRET'])) |
|
| 26 | 26 | {
|
| 27 | 27 | $this->module_info->secret = 'Y'; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | // use_category <=1.5.x, hide_category >=1.7.x |
| 31 | 31 | $count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl)); |
| 32 | - if($count_category) |
|
| 32 | + if ($count_category) |
|
| 33 | 33 | {
|
| 34 | - if($this->module_info->hide_category) |
|
| 34 | + if ($this->module_info->hide_category) |
|
| 35 | 35 | {
|
| 36 | 36 | $this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y'; |
| 37 | 37 | } |
| 38 | - else if($this->module_info->use_category) |
|
| 38 | + else if ($this->module_info->use_category) |
|
| 39 | 39 | {
|
| 40 | 40 | $this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y'; |
| 41 | 41 | } |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | * check the consultation function, if the user is admin then swich off consultation function |
| 56 | 56 | * if the user is not logged, then disppear write document/write comment./ view document |
| 57 | 57 | **/ |
| 58 | - if($this->module_info->consultation == 'Y' && !$this->grant->manager) |
|
| 58 | + if ($this->module_info->consultation == 'Y' && !$this->grant->manager) |
|
| 59 | 59 | {
|
| 60 | 60 | $this->consultation = true; |
| 61 | - if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
|
|
| 61 | + if (!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
|
|
| 62 | 62 | } else {
|
| 63 | 63 | $this->consultation = false; |
| 64 | 64 | } |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | $extra_keys = $oDocumentModel->getExtraKeys($this->module_info->module_srl); |
| 68 | 68 | Context::set('extra_keys', $extra_keys);
|
| 69 | 69 | |
| 70 | - $template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
|
|
| 71 | - if(!is_dir($template_path)||!$this->module_info->mskin) |
|
| 70 | + $template_path = sprintf("%sm.skins/%s/", $this->module_path, $this->module_info->mskin);
|
|
| 71 | + if (!is_dir($template_path) || !$this->module_info->mskin) |
|
| 72 | 72 | {
|
| 73 | 73 | $this->module_info->mskin = 'default'; |
| 74 | - $template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
|
|
| 74 | + $template_path = sprintf("%sm.skins/%s/", $this->module_path, $this->module_info->mskin);
|
|
| 75 | 75 | } |
| 76 | 76 | $this->setTemplatePath($template_path); |
| 77 | 77 | Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml'); |
@@ -87,13 +87,13 @@ discard block |
||
| 87 | 87 | function getBoardCommentPage() |
| 88 | 88 | {
|
| 89 | 89 | $document_srl = Context::get('document_srl');
|
| 90 | - $oDocumentModel =& getModel('document');
|
|
| 91 | - if(!$document_srl) |
|
| 90 | + $oDocumentModel = & getModel('document');
|
|
| 91 | + if (!$document_srl) |
|
| 92 | 92 | {
|
| 93 | 93 | return new Object(-1, "msg_invalid_request"); |
| 94 | 94 | } |
| 95 | 95 | $oDocument = $oDocumentModel->getDocument($document_srl); |
| 96 | - if(!$oDocument->isExists()) |
|
| 96 | + if (!$oDocument->isExists()) |
|
| 97 | 97 | {
|
| 98 | 98 | return new Object(-1, "msg_invalid_request"); |
| 99 | 99 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | function dispBoardMessage($msg_code) |
| 107 | 107 | {
|
| 108 | 108 | $msg = Context::getLang($msg_code); |
| 109 | - $oMessageObject = &ModuleHandler::getModuleInstance('message','mobile');
|
|
| 109 | + $oMessageObject = &ModuleHandler::getModuleInstance('message', 'mobile');
|
|
| 110 | 110 | $oMessageObject->setError(-1); |
| 111 | 111 | $oMessageObject->setMessage($msg); |
| 112 | 112 | $oMessageObject->dispMessage(); |