mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +09:00
Fix #1934 add 'default' option to domain timezone
This commit is contained in:
parent
a5f056284c
commit
59a1215c87
4 changed files with 14 additions and 9 deletions
|
|
@ -260,8 +260,9 @@ class Context
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$site_module_info = ModuleModel::getDefaultMid() ?: new stdClass;
|
$site_module_info = ModuleModel::getDefaultMid() ?: new stdClass;
|
||||||
|
$site_timezone = (isset($site_module_info->settings->timezone) && $site_module_info->settings->timezone !== 'default') ? $site_module_info->settings->timezone : null;
|
||||||
self::set('site_module_info', $site_module_info);
|
self::set('site_module_info', $site_module_info);
|
||||||
self::set('_default_timezone', ($site_module_info->settings && $site_module_info->settings->timezone) ? $site_module_info->settings->timezone : null);
|
self::set('_default_timezone', $site_timezone);
|
||||||
self::set('_default_url', self::$_instance->db_info->default_url = self::getDefaultUrl($site_module_info, RX_SSL));
|
self::set('_default_url', self::$_instance->db_info->default_url = self::getDefaultUrl($site_module_info, RX_SSL));
|
||||||
self::set('_http_port', self::$_instance->db_info->http_port = $site_module_info->http_port ?: null);
|
self::set('_http_port', self::$_instance->db_info->http_port = $site_module_info->http_port ?: null);
|
||||||
self::set('_https_port', self::$_instance->db_info->https_port = $site_module_info->https_port ?: null);
|
self::set('_https_port', self::$_instance->db_info->https_port = $site_module_info->https_port ?: null);
|
||||||
|
|
|
||||||
|
|
@ -1154,7 +1154,7 @@ class adminAdminController extends admin
|
||||||
|
|
||||||
// Validate the default time zone.
|
// Validate the default time zone.
|
||||||
$timezone_list = Rhymix\Framework\DateTime::getTimezoneList();
|
$timezone_list = Rhymix\Framework\DateTime::getTimezoneList();
|
||||||
if (!isset($timezone_list[$vars->default_timezone]))
|
if ($vars->default_timezone !== 'default' && !isset($timezone_list[$vars->default_timezone]))
|
||||||
{
|
{
|
||||||
throw new Rhymix\Framework\Exception('msg_invalid_timezone');
|
throw new Rhymix\Framework\Exception('msg_invalid_timezone');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@
|
||||||
<label class="x_control-label" for="default_timezone">{$lang->timezone}</label>
|
<label class="x_control-label" for="default_timezone">{$lang->timezone}</label>
|
||||||
<div class="x_controls">
|
<div class="x_controls">
|
||||||
<select name="default_timezone">
|
<select name="default_timezone">
|
||||||
|
<option value="default" selected="selected"|cond="$domain_timezone === 'default'">{$lang->follow_default_lang}</option>
|
||||||
<option loop="$timezones => $key,$val" value="{$key}" selected="selected"|cond="$key == $domain_timezone">{$val}</option>
|
<option loop="$timezones => $key,$val" value="{$key}" selected="selected"|cond="$key == $domain_timezone">{$val}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,10 @@ class module extends ModuleObject
|
||||||
$domain->https_port = RX_SSL ? $current_port : null;
|
$domain->https_port = RX_SSL ? $current_port : null;
|
||||||
$domain->security = config('url.ssl') ?: 'none';
|
$domain->security = config('url.ssl') ?: 'none';
|
||||||
$domain->description = '';
|
$domain->description = '';
|
||||||
$domain->settings = json_encode(array('language' => null, 'timezone' => null));
|
$domain->settings = json_encode(array(
|
||||||
|
'language' => 'default',
|
||||||
|
'timezone' => 'default',
|
||||||
|
));
|
||||||
$output = executeQuery('module.insertDomain', $domain);
|
$output = executeQuery('module.insertDomain', $domain);
|
||||||
if (!$output->toBool())
|
if (!$output->toBool())
|
||||||
{
|
{
|
||||||
|
|
@ -288,8 +291,8 @@ class module extends ModuleObject
|
||||||
$domain->settings = json_encode(array(
|
$domain->settings = json_encode(array(
|
||||||
'title' => $config->siteTitle,
|
'title' => $config->siteTitle,
|
||||||
'subtitle' => $config->siteSubtitle,
|
'subtitle' => $config->siteSubtitle,
|
||||||
'language' => $site_info->default_language,
|
'language' => 'default',
|
||||||
'timezone' => config('locale.default_timezone'),
|
'timezone' => 'default',
|
||||||
'html_footer' => $config->htmlFooter,
|
'html_footer' => $config->htmlFooter,
|
||||||
));
|
));
|
||||||
$domain->regdate = $site_info->regdate;
|
$domain->regdate = $site_info->regdate;
|
||||||
|
|
@ -318,8 +321,8 @@ class module extends ModuleObject
|
||||||
$domain->settings = json_encode(array(
|
$domain->settings = json_encode(array(
|
||||||
'title' => $config->siteTitle,
|
'title' => $config->siteTitle,
|
||||||
'subtitle' => $config->siteSubtitle,
|
'subtitle' => $config->siteSubtitle,
|
||||||
'language' => $site_info->default_language,
|
'language' => 'default',
|
||||||
'timezone' => config('locale.default_timezone'),
|
'timezone' => 'default',
|
||||||
'html_footer' => $config->htmlFooter,
|
'html_footer' => $config->htmlFooter,
|
||||||
));
|
));
|
||||||
$domains[$domain->domain] = $domain;
|
$domains[$domain->domain] = $domain;
|
||||||
|
|
@ -353,8 +356,8 @@ class module extends ModuleObject
|
||||||
$domain->settings = json_encode(array(
|
$domain->settings = json_encode(array(
|
||||||
'title' => $config->siteTitle,
|
'title' => $config->siteTitle,
|
||||||
'subtitle' => $config->siteSubtitle,
|
'subtitle' => $config->siteSubtitle,
|
||||||
'language' => $site_info->default_language,
|
'language' => 'default',
|
||||||
'timezone' => config('locale.default_timezone'),
|
'timezone' => 'default',
|
||||||
'html_footer' => $config->htmlFooter,
|
'html_footer' => $config->htmlFooter,
|
||||||
));
|
));
|
||||||
$domain->regdate = $site_info->regdate;
|
$domain->regdate = $site_info->regdate;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue