diff --git a/modules/admin/admin.admin.controller.php b/modules/admin/admin.admin.controller.php index dafa34d2c..66181f39e 100644 --- a/modules/admin/admin.admin.controller.php +++ b/modules/admin/admin.admin.controller.php @@ -958,13 +958,21 @@ class adminAdminController extends admin $domain_info = null; if ($domain_srl !== '') { - $output = executeQuery('module.getDomainInfo', (object)array('domain_srl' => $domain_srl)); - if ($output->toBool() && $output->data) + $domain_info = getModel('module')->getSiteInfo($domain_srl); + if ($domain_info->domain_srl != $domain_srl) { - $domain_info = $output->data; + $domain_info = null; } } + // Validate the title and subtitle. + $vars->title = utf8_trim($vars->title); + $vars->subtitle = utf8_trim($vars->subtitle); + if ($vars->title === '') + { + return new Object(-1, 'msg_site_title_is_empty'); + } + // Validate the domain. if (!preg_match('@^https?://@', $vars->domain)) { @@ -1041,6 +1049,25 @@ class adminAdminController extends admin return new Object(-1, 'msg_lang_is_not_enabled'); } + // Validate the default time zone. + $timezone_list = Rhymix\Framework\DateTime::getTimezoneList(); + if (!isset($timezone_list[$vars->default_timezone])) + { + return new Object(-1, 'msg_invalid_timezone'); + } + + // Clean up the footer script. + $vars->html_footer = utf8_trim($vars->html_footer); + + // Merge all settings into an array. + $settings = array( + 'title' => $vars->title, + 'subtitle' => $vars->subtitle, + 'language' => $vars->default_lang, + 'timezone' => $vars->default_timezone, + 'html_footer' => $vars->html_footer, + ); + // Insert or update the domain. if (!$domain_info) { @@ -1053,7 +1080,7 @@ class adminAdminController extends admin $args->https_port = $vars->https_port; $args->security = $vars->domain_security; $args->description = ''; - $args->settings = json_encode(array('language' => $vars->default_lang, 'timezone' => null)); + $args->settings = json_encode($settings); $output = executeQuery('module.insertDomain', $args); if (!$output->toBool()) { @@ -1070,7 +1097,7 @@ class adminAdminController extends admin $args->http_port = $vars->http_port; $args->https_port = $vars->https_port; $args->security = $vars->domain_security; - $args->settings = json_encode(array_merge($domain_info->settings, array('language' => $vars->default_lang))); + $args->settings = json_encode(array_merge(get_object_vars($domain_info->settings), $settings)); $output = executeQuery('module.updateDomain', $args); if (!$output->toBool()) { diff --git a/modules/admin/admin.admin.model.php b/modules/admin/admin.admin.model.php index 8d26d9711..feca54c5e 100644 --- a/modules/admin/admin.admin.model.php +++ b/modules/admin/admin.admin.model.php @@ -811,22 +811,26 @@ class adminAdminModel extends admin return $output->data->count; } - function getFaviconUrl($default = true) + function getFaviconUrl($domain_srl = 0) { - return $this->iconUrlCheck('favicon.ico', 'faviconSample.png', $default); + return $this->iconUrlCheck('favicon.ico', 'faviconSample.png', $domain_srl); } - function getMobileIconUrl($default = true) + function getMobileIconUrl($domain_srl = 0) { - return $this->iconUrlCheck('mobicon.png', 'mobiconSample.png', $default); + return $this->iconUrlCheck('mobicon.png', 'mobiconSample.png', $domain_srl); } - function getSiteDefaultImageUrl(&$width = 0, &$height = 0) + function getSiteDefaultImageUrl($domain_srl = 0, &$width = 0, &$height = 0) { - $site_info = Context::get('site_module_info'); - if ($site_info->site_srl) + $domain_srl = intval($domain_srl); + if (!$domain_srl) { - $virtual_site = $site_info->site_srl . '/'; + $domain_srl = intval(Context::get('site_module_info')->domain_srl); + } + if ($domain_srl) + { + $virtual_site = $domain_srl . '/'; } else { @@ -846,17 +850,16 @@ class adminAdminModel extends admin } } - function iconUrlCheck($iconname, $default_icon_name, $default) + function iconUrlCheck($iconname, $default_icon_name, $domain_srl) { - if ($default) + $domain_srl = intval($domain_srl); + if (!$domain_srl) { - return \RX_BASEURL . 'modules/admin/tpl/img/' . $default_icon_name; + $domain_srl = intval(Context::get('site_module_info')->domain_srl); } - - $site_info = Context::get('site_module_info'); - if ($site_info->site_srl) + if ($domain_srl) { - $virtual_site = $site_info->site_srl . '/'; + $virtual_site = $domain_srl . '/'; } else { diff --git a/modules/admin/admin.admin.view.php b/modules/admin/admin.admin.view.php index 8306fc5ad..877931fd9 100644 --- a/modules/admin/admin.admin.view.php +++ b/modules/admin/admin.admin.view.php @@ -689,10 +689,10 @@ class adminAdminView extends admin $domain_info = null; if ($domain_srl !== '') { - $output = executeQuery('module.getDomainInfo', (object)array('domain_srl' => $domain_srl)); - if ($output->toBool() && $output->data) + $domain_info = getModel('module')->getSiteInfo($domain_srl); + if ($domain_info->domain_srl != $domain_srl) { - $domain_info = $output->data; + $domain_info = null; } } Context::set('domain_info', $domain_info); @@ -723,6 +723,24 @@ class adminAdminView extends admin } Context::set('domain_lang', $domain_lang); + // Get timezone list. + Context::set('timezones', Rhymix\Framework\DateTime::getTimezoneList()); + if ($domain_info && $domain_info->settings->timezone) + { + $domain_timezone = $domain_info->settings->timezone; + } + else + { + $domain_timezone = Rhymix\Framework\Config::get('locale.default_timezone'); + } + Context::set('domain_timezone', $domain_timezone); + + // Get favicon and images. + $oAdminAdminModel = getAdminModel('admin'); + Context::set('favicon_url', $oAdminAdminModel->getFaviconUrl($domain_info->domain_srl)); + Context::set('mobicon_url', $oAdminAdminModel->getMobileIconUrl($domain_info->domain_srl)); + Context::set('default_image_url', $oAdminAdminModel->getSiteDefaultImageUrl($domain_info->domain_srl)); + $this->setTemplateFile('config_domains_edit'); } diff --git a/modules/admin/lang/en.php b/modules/admin/lang/en.php index a9ec4251c..f2b869766 100644 --- a/modules/admin/lang/en.php +++ b/modules/admin/lang/en.php @@ -119,6 +119,7 @@ $lang->cmd_edit_domain = 'Edit Domain'; $lang->about_use_ssl = 'Selecting \'Optional\' is to use SSL for the specified actions such as signing up and changing information.
Selecting \'Always\' is to use SSL for the entire pages, generated by Rhymix.
Please be careful! You may not be able to access to the site, before installing SSL certificate.'; $lang->server_ports = 'Server Port'; $lang->about_server_ports = 'If your web server does not use 80 for HTTP or 443 for HTTPS port, you should specify server ports.'; +$lang->msg_site_title_is_empty = 'Please enter a title for the domain.'; $lang->msg_invalid_domain = 'Invalid domain.'; $lang->msg_domain_already_exists = 'The domain already exists.'; $lang->msg_invalid_http_port = 'Invalid HTTP port.'; @@ -126,6 +127,7 @@ $lang->msg_invalid_https_port = 'Invalid HTTPS port.'; $lang->msg_invalid_index_module_srl = 'The main module does not exist.'; $lang->msg_invalid_index_document_srl = 'The main document number does not exist.'; $lang->msg_lang_is_not_enabled = 'The language you selected is not enabled in this site.'; +$lang->msg_invalid_timezone = 'The selected time zone is not usable on this server.'; $lang->use_db_session = 'Store Session in DB'; $lang->about_db_session = 'Store PHP sessions in the database. This setting must be turned on if you want to see current users or get detailed statistics.
Unnecessary use may decrease server performance.'; $lang->qmail_compatibility = 'Enable Qmail'; @@ -235,7 +237,7 @@ $lang->about_use_mobile_view = 'Show mobile page when visitors access with mobil $lang->tablets_as_mobile = 'Treat Tablets as Mobile'; $lang->thumbnail_type = 'Select thumbnail type.'; $lang->input_footer_script = 'Footer script'; -$lang->detail_input_footer_script = 'The script is inserted into the bottom of body. It does not work at admin page.'; +$lang->detail_input_footer_script = 'Any content added here will be printed at the bottom of the page, except the admin module.'; $lang->thumbnail_crop = 'Crop'; $lang->thumbnail_ratio = 'Keep aspect ratio (may result in spaces)'; $lang->thumbnail_none = 'Do not create thumbnails'; diff --git a/modules/admin/lang/ko.php b/modules/admin/lang/ko.php index ff27add03..abf4a3ba0 100644 --- a/modules/admin/lang/ko.php +++ b/modules/admin/lang/ko.php @@ -119,6 +119,7 @@ $lang->cmd_edit_domain = '도메인 정보 수정'; $lang->about_use_ssl = '\'선택적으로 사용\'은 회원가입, 정보수정 등의 지정된 동작(action)에서만 보안접속(HTTPS)을 사용합니다.
\'항상 사용\'은 사이트 전체에 HTTPS를 사용합니다.
SSL 인증서가 설치되지 않은 상태에서 HTTPS 사용을 시도하면 접속이 되지 않을 수 있으니 주의하시기 바랍니다.'; $lang->server_ports = '포트'; $lang->about_server_ports = 'HTTP는 80, HTTPS는 443 이 아닌, 다른 포트를 사용할 경우에 포트를 지정해 주어야 합니다.'; +$lang->msg_site_title_is_empty = '사이트 이름을 입력해 주십시오.'; $lang->msg_invalid_domain = '올바르지 않은 도메인입니다.'; $lang->msg_domain_already_exists = '이미 등록된 도메인입니다.'; $lang->msg_invalid_http_port = '올바르지 않은 HTTP 포트입니다.'; @@ -126,6 +127,7 @@ $lang->msg_invalid_https_port = '올바르지 않은 HTTPS 포트입니다.'; $lang->msg_invalid_index_module_srl = '선택하신 메인 모듈이 존재하지 않습니다.'; $lang->msg_invalid_index_document_srl = '선택하신 메인 문서 번호가 존재하지 않습니다.'; $lang->msg_lang_is_not_enabled = '선택하신 언어가 활성화되어 있지 않습니다.'; +$lang->msg_invalid_timezone = '사용할 수 없는 표준 시간대입니다.'; $lang->use_db_session = '인증 세션 DB 사용'; $lang->about_db_session = '세션을 DB에 저장합니다. 현재 접속자를 파악하려면 이 기능을 켜야 합니다.
불필요하게 사용하면 서버 성능에 악영향을 줄 수 있으니 주의하십시오.'; $lang->qmail_compatibility = '큐메일(Qmail) 사용'; @@ -230,7 +232,7 @@ $lang->about_use_mobile_view = '모바일 기기로 접속시 모바일 페이 $lang->tablets_as_mobile = '태블릿도 모바일 취급'; $lang->thumbnail_type = '썸네일 생성 방식'; $lang->input_footer_script = '하단(footer) 스크립트'; -$lang->detail_input_footer_script = '최하단에 코드를 삽입합니다. 관리자 페이지에서는 수행되지 않습니다.'; +$lang->detail_input_footer_script = '최하단에 코드를 삽입합니다. 관리자 화면에는 적용되지 않습니다.'; $lang->thumbnail_crop = '크기에 맞추어 잘라내기'; $lang->thumbnail_ratio = '비율 유지 (여백이 생길 수 있음)'; $lang->thumbnail_none = '썸네일 생성하지 않음'; diff --git a/modules/admin/tpl/config_domains_edit.html b/modules/admin/tpl/config_domains_edit.html index 7a6002f0a..57e9de758 100644 --- a/modules/admin/tpl/config_domains_edit.html +++ b/modules/admin/tpl/config_domains_edit.html @@ -9,6 +9,20 @@ +
+ +
+ +
+
+ +
+ +
+ +
+
+
@@ -45,11 +59,7 @@
- +
@@ -69,6 +79,67 @@
+
+ +
+ +
+
+ +
+ +
+ +
{$lang->detail_input_footer_script}
+
+
+ +
+ +
+

+ Favicon + Favicon +

+ + + {$lang->about_use_favicon} +
+
+ +
+ +
+

+ Mobile Home Icon + Rhymix +

+ + + {$lang->detail_use_mobile_icon} +
+
+ +
+ +
+

+ Default Image +

+ + + {$lang->about_site_default_image} +
+
+