diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index 11d6848c5..d498e738a 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -9,6 +9,11 @@ class HTMLDisplayHandler const JQUERY_V1 = '1.12.4'; const JQUERY_V2 = '2.2.4'; + /** + * Default viewport setting + */ + const DEFAULT_VIEWPORT = 'width=device-width, initial-scale=1.0, user-scalable=yes'; + /** * Reserved scripts */ diff --git a/common/constants.php b/common/constants.php index 3fe113e16..6350b3dbf 100644 --- a/common/constants.php +++ b/common/constants.php @@ -3,7 +3,7 @@ /** * RX_VERSION is the version number of the Rhymix CMS. */ -define('RX_VERSION', '1.9.9.8'); +define('RX_VERSION', '1.9.9.9'); /** * RX_MICROTIME is the startup time of the current script, in microseconds since the Unix epoch. @@ -139,11 +139,6 @@ define('__XE_RECOMMEND_PHP_VERSION__', '7.2.0'); define('__ZBXE__', true); 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('__DEBUG__', 0); /** * Status constants for various content types. diff --git a/common/css/rhymix.less b/common/css/rhymix.less index d3f565b83..feb6f7eaf 100644 --- a/common/css/rhymix.less +++ b/common/css/rhymix.less @@ -234,6 +234,12 @@ a img { border-bottom-right-radius: 4px; box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.18), 0 0 6px 0 rgba(0, 0, 0, 0.12); z-index: 1073741824; + &.visible { + display: block; + @media print { + display: none; + } + } &:hover { background: #dddddd; background: linear-gradient(to bottom, #e8e8e8 0%, #d9d9d9 100%); diff --git a/common/js/debug.js b/common/js/debug.js index 99951ed16..17bb86348 100644 --- a/common/js/debug.js +++ b/common/js/debug.js @@ -15,7 +15,7 @@ $(function() { // Find debug panel elements. var panel = $("#rhymix_debug_panel"); - var button = $("#rhymix_debug_button").show(); + var button = $("#rhymix_debug_button").addClass('visible'); // Initialize the debug button. var button_link = $('').text("DEBUG").appendTo(button).click(function(event) { diff --git a/common/lang/ko.php b/common/lang/ko.php index 8999cbc45..a71b3ff9c 100644 --- a/common/lang/ko.php +++ b/common/lang/ko.php @@ -90,7 +90,7 @@ $lang->password = '비밀번호'; $lang->password1 = '새 비밀번호'; $lang->password2 = '새 비밀번호 확인'; $lang->password3 = '비밀번호 확인'; -$lang->admin_id = '관리자ID'; +$lang->admin_id = '관리자 ID'; $lang->admin_email_address = '관리자 Email 주소'; $lang->writer = '글쓴이'; $lang->user_name = '이름'; diff --git a/common/tpl/common_layout.html b/common/tpl/common_layout.html index cff607919..e9ca773bc 100644 --- a/common/tpl/common_layout.html +++ b/common/tpl/common_layout.html @@ -5,7 +5,9 @@ - + + + diff --git a/modules/admin/admin.admin.view.php b/modules/admin/admin.admin.view.php index a9e307be6..61aea67a6 100644 --- a/modules/admin/admin.admin.view.php +++ b/modules/admin/admin.admin.view.php @@ -105,11 +105,14 @@ class adminAdminView extends admin return; } + $oAutoinstallAdminModel = getAdminModel('autoinstall'); + $config = $oAutoinstallAdminModel->getAutoInstallAdminModuleConfig(); + $oAutoinstallModel = getModel('autoinstall'); $params = array(); $params["act"] = "getResourceapiLastupdate"; $body = XmlGenerater::generate($params); - $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml"); + $buff = FileHandler::getRemoteResource($config->download_server, $body, 3, "POST", "application/xml"); $xml_lUpdate = new XmlParser(); $lUpdateDoc = $xml_lUpdate->parse($buff); $updateDate = $lUpdateDoc->response->updatedate->body; @@ -578,7 +581,7 @@ class adminAdminView extends admin Context::set('use_rewrite', Rhymix\Framework\Router::getRewriteLevel()); Context::set('use_mobile_view', (config('mobile.enabled') !== null ? config('mobile.enabled') : config('use_mobile_view')) ? true : false); Context::set('tablets_as_mobile', config('mobile.tablets') ? true : false); - Context::set('mobile_viewport', config('mobile.viewport') ?: 'width=device-width, initial-scale=1.0, user-scalable=yes'); + Context::set('mobile_viewport', config('mobile.viewport') ?? HTMLDisplayHandler::DEFAULT_VIEWPORT); Context::set('use_ssl', Rhymix\Framework\Config::get('url.ssl')); Context::set('delay_session', Rhymix\Framework\Config::get('session.delay')); Context::set('use_db_session', Rhymix\Framework\Config::get('session.use_db')); diff --git a/modules/admin/lang/en.php b/modules/admin/lang/en.php index a3779649f..3053bd9d3 100644 --- a/modules/admin/lang/en.php +++ b/modules/admin/lang/en.php @@ -274,6 +274,7 @@ $lang->about_use_mobile_view = 'Show mobile page when visitors access with mobil $lang->tablets_as_mobile = 'Treat Tablets as Mobile'; $lang->mobile_viewport = 'Mobile viewport Setting'; $lang->about_mobile_viewport = 'The settings entered above will be output in a <meta name="viewport"> tag for mobile visitors.'; +$lang->restore_default_viewport = 'Restore Default'; $lang->thumbnail_target = 'Extract Thumbnail From'; $lang->thumbnail_target_all = 'All images'; $lang->thumbnail_target_attachment = 'Attached images only'; diff --git a/modules/admin/lang/ko.php b/modules/admin/lang/ko.php index 289119957..a0c91aa2c 100644 --- a/modules/admin/lang/ko.php +++ b/modules/admin/lang/ko.php @@ -270,6 +270,7 @@ $lang->about_use_mobile_view = '모바일 기기로 접속시 모바일 페이 $lang->tablets_as_mobile = '태블릿도 모바일 취급'; $lang->mobile_viewport = '모바일 viewport 설정'; $lang->about_mobile_viewport = '모바일 접속시 여기 입력한 내용이 <meta name="viewport"> 태그로 출력됩니다.'; +$lang->restore_default_viewport = '기본값 복원'; $lang->thumbnail_target = '썸네일 생성 대상'; $lang->thumbnail_target_all = '모든 이미지 (외부 이미지 포함)'; $lang->thumbnail_target_attachment = '첨부된 이미지'; diff --git a/modules/admin/tpl/config_advanced.html b/modules/admin/tpl/config_advanced.html index d68581567..9fac1894d 100644 --- a/modules/admin/tpl/config_advanced.html +++ b/modules/admin/tpl/config_advanced.html @@ -89,7 +89,7 @@
-

{$lang->about_mobile_viewport}

+

{$lang->about_mobile_viewport} {$lang->restore_default_viewport}

@@ -224,3 +224,9 @@
+ + \ No newline at end of file diff --git a/modules/advanced_mailer/advanced_mailer.controller.php b/modules/advanced_mailer/advanced_mailer.controller.php index c8207b60c..adfbb14f5 100644 --- a/modules/advanced_mailer/advanced_mailer.controller.php +++ b/modules/advanced_mailer/advanced_mailer.controller.php @@ -31,7 +31,8 @@ class Advanced_MailerController extends Advanced_Mailer if (!$mail->getFrom()) { - $mail->setFrom(config('mail.default_from'), config('mail.default_name')); + list($default_from, $default_name) = $this->getDefaultEmailIdentity(); + $mail->setFrom($default_from, $default_name); if ($replyTo = config('mail.default_reply_to')) { $mail->setReplyTo($replyTo); @@ -48,9 +49,10 @@ class Advanced_MailerController extends Advanced_Mailer $sender = $mail->message->getFrom(); $original_sender_email = $sender ? array_first_key($sender) : null; $original_sender_name = $sender ? array_first($sender) : null; - if ($original_sender_email !== config('mail.default_from')) + list($default_from, $default_name) = $this->getDefaultEmailIdentity(); + if ($original_sender_email !== $default_from) { - $mail->setFrom(config('mail.default_from'), $original_sender_name ?: config('mail.default_name')); + $mail->setFrom($default_from, $original_sender_name ?: $default_name); $mail->setReplyTo($original_sender_email); } } @@ -117,6 +119,25 @@ class Advanced_MailerController extends Advanced_Mailer } } + /** + * Get the default identity for sending email. + * + * @return array + */ + public function getDefaultEmailIdentity() + { + $email = config('mail.default_from'); + $name = config('mail.default_name'); + if (!$email) + { + $member_config = getModel('module')->getModuleConfig('member'); + $email = $member_config->webmaster_email; + $name = $member_config->webmaster_name ?: 'webmaster'; + } + + return [$email, $name]; + } + /** * Check if an email address is on a list of exceptions. * diff --git a/modules/autoinstall/autoinstall.admin.controller.php b/modules/autoinstall/autoinstall.admin.controller.php index 5eabf8244..a3b18c982 100644 --- a/modules/autoinstall/autoinstall.admin.controller.php +++ b/modules/autoinstall/autoinstall.admin.controller.php @@ -16,7 +16,6 @@ class autoinstallAdminController extends autoinstall */ function init() { - } /** @@ -75,7 +74,11 @@ class autoinstallAdminController extends autoinstall 'ssl_verify_peer' => FALSE, 'ssl_verify_host' => FALSE ); - $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); + + $oAdminModel = getAdminModel('autoinstall'); + $config = $oAdminModel->getAutoInstallAdminModuleConfig(); + + $buff = FileHandler::getRemoteResource($config->download_server, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); $xml = new XmlParser(); $xmlDoc = $xml->parse($buff); $this->updateCategory($xmlDoc); @@ -224,7 +227,10 @@ class autoinstallAdminController extends autoinstall $oModuleInstaller = new FTPModuleInstaller($package); } - $oModuleInstaller->setServerUrl(_XE_DOWNLOAD_SERVER_); + $oAdminModel = getAdminModel('autoinstall'); + $config = $oAdminModel->getAutoInstallAdminModuleConfig(); + + $oModuleInstaller->setServerUrl($config->download_server); $oModuleInstaller->setPassword($ftp_password); $output = $oModuleInstaller->install(); if(!$output->toBool()) @@ -397,7 +403,10 @@ class autoinstallAdminController extends autoinstall $oModuleInstaller = new FTPModuleInstaller($package); } - $oModuleInstaller->setServerUrl(_XE_DOWNLOAD_SERVER_); + $oAdminModel = getAdminModel('autoinstall'); + $config = $oAdminModel->getAutoInstallAdminModuleConfig(); + + $oModuleInstaller->setServerUrl($config->download_server); $oModuleInstaller->setPassword($ftp_password); $output = $oModuleInstaller->uninstall(); @@ -413,6 +422,39 @@ class autoinstallAdminController extends autoinstall return new BaseObject(); } + function procAutoinstallAdminInsertConfig() + { + // if end of string does not have a slash, add it + $_location_site = Context::get('location_site'); + if(substr($_location_site, -1) != '/' && strlen($_location_site) > 0) + { + $_location_site .= '/'; + } + $_download_server = Context::get('download_server'); + if(substr($_download_server, -1) != '/' && strlen($_download_server) > 0) + { + $_download_server .= '/'; + } + + $args = new stdClass(); + $args->location_site = $_location_site; + $args->download_server = $_download_server; + + $oModuleController = getController('module'); + $output = $oModuleController->updateModuleConfig('autoinstall', $args); + + // init. DB tables + executeQuery("autoinstall.deletePackages"); + executeQuery("autoinstall.deleteCategory"); + executeQuery("autoinstall.deleteInstalledPackage"); + + // 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.model.php b/modules/autoinstall/autoinstall.admin.model.php index db5d0abeb..ce8793721 100644 --- a/modules/autoinstall/autoinstall.admin.model.php +++ b/modules/autoinstall/autoinstall.admin.model.php @@ -420,6 +420,20 @@ class autoinstallAdminModel extends autoinstall return new BaseObject(); } + public function getAutoInstallAdminModuleConfig() + { + $oModuleModel = getModel('module'); + $config_info = $oModuleModel->getModuleConfig('autoinstall'); + $_location_site = 'https://xe1.xpressengine.com/'; + $_download_server = 'https://download.xpressengine.com/'; + + $config = new stdClass(); + $config->location_site = $config_info->location_site ? $config_info->location_site : $_location_site; + $config->download_server = $config_info->download_server ? $config_info->download_server : $_download_server; + + return $config; + } + } /* End of file autoinstall.admin.model.php */ /* Location: ./modules/autoinstall/autoinstall.admin.model.php */ diff --git a/modules/autoinstall/autoinstall.admin.view.php b/modules/autoinstall/autoinstall.admin.view.php index 446dbd5e1..d4bef340e 100644 --- a/modules/autoinstall/autoinstall.admin.view.php +++ b/modules/autoinstall/autoinstall.admin.view.php @@ -27,9 +27,13 @@ class autoinstallAdminView extends autoinstall */ function init() { + $oAdminModel = getAdminModel('autoinstall'); + $config = $oAdminModel->getAutoInstallAdminModuleConfig(); + Context::set('config', $config); + $template_path = sprintf("%stpl/", $this->module_path); - Context::set('original_site', _XE_LOCATION_SITE_); - Context::set('uri', _XE_DOWNLOAD_SERVER_); + Context::set('original_site', $config->location_site); + Context::set('uri', $config->download_server); $this->setTemplatePath($template_path); $ftp_info = Context::getFTPInfo(); @@ -192,17 +196,30 @@ class autoinstallAdminView extends autoinstall $depto = array(); + $oAdminModel = getAdminModel('autoinstall'); + $config = $oAdminModel->getAutoInstallAdminModuleConfig(); + foreach($items as $item) { $v = $this->rearrange($item, $targets); - $v->item_screenshot_url = str_replace('./', _XE_DOWNLOAD_SERVER_, $v->item_screenshot_url); + $v->item_screenshot_url = str_replace('./', $config->download_server, $v->item_screenshot_url); $v->category = $this->categories[$v->category_srl]->title; - $v->url = _XE_LOCATION_SITE_ . '?mid=download&package_srl=' . $v->package_srl; + $v->url = $config->location_site . '?mid=download&package_srl=' . $v->package_srl; 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(version_compare($v->item_version, $v->current_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) @@ -314,7 +331,11 @@ class autoinstallAdminView extends autoinstall 'ssl_verify_peer' => FALSE, 'ssl_verify_host' => FALSE ); - $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); + + $oAdminModel = getAdminModel('autoinstall'); + $config = $oAdminModel->getAutoInstallAdminModuleConfig(); + + $buff = FileHandler::getRemoteResource($config->download_server, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); $xml_lUpdate = new XmlParser(); $xmlDoc = $xml_lUpdate->parse($buff); if($xmlDoc && $xmlDoc->response->packagelist->item) @@ -366,6 +387,7 @@ class autoinstallAdminView extends autoinstall Context::set("package", $package); Context::set('contain_core', $package->contain_core); + Context::set('module_config', $oAdminModel->getAutoInstallAdminModuleConfig()); if(!$_SESSION['ftp_password']) { @@ -407,7 +429,11 @@ class autoinstallAdminView extends autoinstall 'ssl_verify_peer' => FALSE, 'ssl_verify_host' => FALSE ); - $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); + + $oAdminModel = getAdminModel('autoinstall'); + $config = $oAdminModel->getAutoInstallAdminModuleConfig(); + + $buff = FileHandler::getRemoteResource($config->download_server, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); $xml_lUpdate = new XmlParser(); $lUpdateDoc = $xml_lUpdate->parse($buff); $updateDate = $lUpdateDoc->response->updatedate->body; @@ -558,7 +584,11 @@ class autoinstallAdminView extends autoinstall 'ssl_verify_peer' => FALSE, 'ssl_verify_host' => FALSE ); - $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); + + $oAdminModel = getAdminModel('autoinstall'); + $config = $oAdminModel->getAutoInstallAdminModuleConfig(); + + $buff = FileHandler::getRemoteResource($config->download_server, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); $xml_lUpdate = new XmlParser(); $xmlDoc = $xml_lUpdate->parse($buff); if($xmlDoc && $xmlDoc->response->packagelist->item) @@ -583,6 +613,14 @@ class autoinstallAdminView extends autoinstall } } + /** + * Display config + * + */ + function dispAutoinstallAdminConfig() + { + $this->setTemplateFile('config'); + } } /* End of file autoinstall.admin.view.php */ /* Location: ./modules/autoinstall/autoinstall.admin.view.php */ diff --git a/modules/autoinstall/autoinstall.class.php b/modules/autoinstall/autoinstall.class.php index e74731877..b3e4823c4 100644 --- a/modules/autoinstall/autoinstall.class.php +++ b/modules/autoinstall/autoinstall.class.php @@ -44,7 +44,13 @@ class XmlGenerater 'ssl_verify_peer' => FALSE, 'ssl_verify_host' => FALSE ); - $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); + + $oModuleModel = getModel('module'); + $module_info = $oModuleModel->getModuleConfig('autoinstall'); + $location_site = $module_info->location_site; + $download_server = $module_info->download_server; + + $buff = FileHandler::getRemoteResource($download_server, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); if(!$buff) { return; diff --git a/modules/autoinstall/conf/module.xml b/modules/autoinstall/conf/module.xml index 1e7c1780a..d5b0e87a7 100644 --- a/modules/autoinstall/conf/module.xml +++ b/modules/autoinstall/conf/module.xml @@ -6,16 +6,20 @@ - + + + + + diff --git a/modules/autoinstall/lang/en.php b/modules/autoinstall/lang/en.php index 73d91756a..a0edb8a4a 100644 --- a/modules/autoinstall/lang/en.php +++ b/modules/autoinstall/lang/en.php @@ -53,3 +53,8 @@ $lang->typename['m.skin'] = 'Mobile Skin'; $lang->typename['skin'] = 'Skin'; $lang->typename['widgetstyle'] = 'Widget style'; $lang->typename['style'] = 'Document style'; + +$lang->location_site = 'Download Homepage'; +$lang->about_location_site = 'Please type your download homepage. ex)https://xe1.xpressengine.com/'; +$lang->download_server = 'Download Server'; +$lang->about_download_server = 'Please type your download server. ex)https://download.xpressengine.com/'; diff --git a/modules/autoinstall/lang/ko.php b/modules/autoinstall/lang/ko.php index 846f36e6e..6e3265291 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->location_site = '다운로드 홈페이지'; +$lang->about_location_site = '다운로드 홈페이지를 입력해 주세요. 예)https://xe1.xpressengine.com/'; +$lang->download_server = '다운로드 서버'; +$lang->about_download_server = '다운로드 서버를 입력해 주세요. 예)https://download.xpressengine.com/'; + diff --git a/modules/autoinstall/queries/deletePackages.xml b/modules/autoinstall/queries/deletePackages.xml new file mode 100644 index 000000000..ac303ef2f --- /dev/null +++ b/modules/autoinstall/queries/deletePackages.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/modules/autoinstall/tpl/category.html b/modules/autoinstall/tpl/category.html index 288b7c56f..7b9732b09 100644 --- a/modules/autoinstall/tpl/category.html +++ b/modules/autoinstall/tpl/category.html @@ -1,6 +1,7 @@