From 2e523370d7ff1863d5f0b1bd9be1831cdeda135f Mon Sep 17 00:00:00 2001 From: "hanssem@forppl.com" Date: Sun, 9 Aug 2020 20:38:06 +0900 Subject: [PATCH] =?UTF-8?q?=EC=89=AC=EC=9A=B4=EC=84=A4=EC=B9=98=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/constants.php | 4 +-- .../autoinstall.admin.controller.php | 35 +++++++++++++++++- .../autoinstall/autoinstall.admin.view.php | 36 +++++++++++++++++-- modules/autoinstall/conf/module.xml | 5 ++- modules/autoinstall/lang/en.php | 6 ++++ modules/autoinstall/lang/ko.php | 6 ++++ modules/autoinstall/tpl/category.html | 1 + modules/autoinstall/tpl/config.html | 36 +++++++++++++++++++ .../autoinstall/tpl/filter/insert_config.xml | 3 +- 9 files changed, 125 insertions(+), 7 deletions(-) create mode 100644 modules/autoinstall/tpl/config.html diff --git a/common/constants.php b/common/constants.php index 3fe113e16..cffe7d532 100644 --- a/common/constants.php +++ b/common/constants.php @@ -141,8 +141,8 @@ define('__ZBXE_VERSION__', RX_VERSION); define('_XE_PATH_', RX_BASEDIR); define('_XE_PACKAGE_', 'XE'); define('_XE_LOCATION_', 'en'); -define('_XE_LOCATION_SITE_', 'https://xe1.xpressengine.com/'); -define('_XE_DOWNLOAD_SERVER_', 'https://download.xpressengine.com/'); +//define('_XE_LOCATION_SITE_', 'https://xe1.xpressengine.com/'); +//define('_XE_DOWNLOAD_SERVER_', 'https://download.xpressengine.com/'); define('__DEBUG__', 0); /** diff --git a/modules/autoinstall/autoinstall.admin.controller.php b/modules/autoinstall/autoinstall.admin.controller.php index 5eabf8244..05a9653dd 100644 --- a/modules/autoinstall/autoinstall.admin.controller.php +++ b/modules/autoinstall/autoinstall.admin.controller.php @@ -16,7 +16,12 @@ class autoinstallAdminController extends autoinstall */ function init() { - + $oModuleModel = getModel('module'); + $module_info = $oModuleModel->getModuleConfig('autoinstall'); + $location_site = $module_info->location_site; + $download_server = $module_info->download_server; + define('_XE_LOCATION_SITE_', $location_site ? $location_site : 'https://xe1.xpressengine.com/'); + define('_XE_DOWNLOAD_SERVER_', $download_server ? $download_server : 'https://download.xpressengine.com/'); } /** @@ -413,6 +418,34 @@ class autoinstallAdminController extends autoinstall return new BaseObject(); } + function procAutoinstallAdminInsertConfig() + { + $args = new stdClass(); + $args->location_site = Context::get('location_site'); + $args->download_server = Context::get('download_server'); + + $oModuleController = getController('module'); + $output = $oModuleController->updateModuleConfig('autoinstall', $args); + + // init. autoinstall DB data + $oDB = DB::getInstance(); + // truncate table rx_ai_installed_packages + $sql_a = 'truncate table '.$oDB->prefix.'ai_installed_packages'; + $oDB->_query($sql_a); + // truncate table rx_ai_remote_categories + $sql_b = 'truncate table '.$oDB->prefix.'ai_remote_categories'; + $oDB->_query($sql_b); + // truncate table rx_autoinstall_packages + $sql_c = 'truncate table '.$oDB->prefix.'autoinstall_packages'; + $oDB->_query($sql_c); + + // default setting end + $this->setMessage('success_updated'); + + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAutoinstallAdminConfig'); + $this->setRedirectUrl($returnUrl); + } + } /* End of file autoinstall.admin.controller.php */ /* Location: ./modules/autoinstall/autoinstall.admin.controller.php */ diff --git a/modules/autoinstall/autoinstall.admin.view.php b/modules/autoinstall/autoinstall.admin.view.php index 446dbd5e1..2389991f1 100644 --- a/modules/autoinstall/autoinstall.admin.view.php +++ b/modules/autoinstall/autoinstall.admin.view.php @@ -27,6 +27,13 @@ class autoinstallAdminView extends autoinstall */ function init() { + $oModuleModel = getModel('module'); + $module_info = $oModuleModel->getModuleConfig('autoinstall'); + $location_site = $module_info->location_site; + $download_server = $module_info->download_server; + define('_XE_LOCATION_SITE_', $location_site ? $location_site : 'https://xe1.xpressengine.com/'); + define('_XE_DOWNLOAD_SERVER_', $download_server ? $download_server : 'https://download.xpressengine.com/'); + $template_path = sprintf("%stpl/", $this->module_path); Context::set('original_site', _XE_LOCATION_SITE_); Context::set('uri', _XE_DOWNLOAD_SERVER_); @@ -202,7 +209,17 @@ class autoinstallAdminView extends autoinstall if($packages[$v->package_srl]) { $v->current_version = $packages[$v->package_srl]->current_version; - $v->need_update = $packages[$v->package_srl]->need_update; + // if version is up + // insert Y + if($v->current_version < $v->item_version) + { + $v->need_update = 'Y'; + } + else + { + $v->need_update = 'N'; + } + //$v->need_update = $packages[$v->package_srl]->need_update; $v->type = $oModel->getTypeFromPath($packages[$v->package_srl]->path); if($this->ftp_set && $v->depfrom) @@ -216,7 +233,11 @@ class autoinstallAdminView extends autoinstall if($v->type == "core") { - continue; + // if default, hide core + if(strpos(_XE_DOWNLOAD_SERVER_, 'xpressengine.com')!==false) + { + continue; + } } else if($v->type == "module") { @@ -583,6 +604,17 @@ class autoinstallAdminView extends autoinstall } } + /** + * Display config + * + */ + function dispAutoinstallAdminConfig() + { + $oModuleModel = getModel('module'); + $module_info = $oModuleModel->getModuleConfig('autoinstall'); + Context::set('config', $module_info); + $this->setTemplateFile('config'); + } } /* End of file autoinstall.admin.view.php */ /* Location: ./modules/autoinstall/autoinstall.admin.view.php */ diff --git a/modules/autoinstall/conf/module.xml b/modules/autoinstall/conf/module.xml index 1e7c1780a..287d86120 100644 --- a/modules/autoinstall/conf/module.xml +++ b/modules/autoinstall/conf/module.xml @@ -6,7 +6,8 @@ - + + @@ -16,6 +17,8 @@ + + diff --git a/modules/autoinstall/lang/en.php b/modules/autoinstall/lang/en.php index 73d91756a..08336e974 100644 --- a/modules/autoinstall/lang/en.php +++ b/modules/autoinstall/lang/en.php @@ -53,3 +53,9 @@ $lang->typename['m.skin'] = 'Mobile Skin'; $lang->typename['skin'] = 'Skin'; $lang->typename['widgetstyle'] = 'Widget style'; $lang->typename['style'] = 'Document style'; + +$lang->config = 'Config'; +$lang->location_site = 'Location Site'; +$lang->about_location_site = 'Please type your location site. ex)https://xe1.xpressengine.com/'; +$lang->download_server = 'Download Server'; +$lang->about_download_server = 'Please type your download server. ex)https://download.xpressengine.com/'; \ No newline at end of file diff --git a/modules/autoinstall/lang/ko.php b/modules/autoinstall/lang/ko.php index 846f36e6e..4d18918f8 100644 --- a/modules/autoinstall/lang/ko.php +++ b/modules/autoinstall/lang/ko.php @@ -55,3 +55,9 @@ $lang->typename['m.skin'] = '모바일 스킨'; $lang->typename['skin'] = '스킨'; $lang->typename['widgetstyle'] = '위젯스타일'; $lang->typename['style'] = '문서스타일'; + +$lang->config = '설정'; +$lang->location_site = '로케이션 사이트'; +$lang->about_location_site = '로케이션 사이트를 입력해 주세요. 예)https://xe1.xpressengine.com/'; +$lang->download_server = '다운로드 서버'; +$lang->about_download_server = '다운로드 서버를 입력해 주세요. 예)https://download.xpressengine.com/'; \ No newline at end of file diff --git a/modules/autoinstall/tpl/category.html b/modules/autoinstall/tpl/category.html index 288b7c56f..001951684 100644 --- a/modules/autoinstall/tpl/category.html +++ b/modules/autoinstall/tpl/category.html @@ -1,6 +1,7 @@