diff options
author | Andy Lindeman <andy@highgroove.com> | 2011-04-22 18:15:17 -0400 |
---|---|---|
committer | Andy Lindeman <andy@highgroove.com> | 2011-04-22 18:15:17 -0400 |
commit | 6f916e49d5b431c2c1961a13d1a61fef8c02d628 (patch) | |
tree | 134b2907e041635915ecb4f7fa5418610b1dc653 | |
parent | b9a720e86bcaeab19aca81ee2af2b5c12fda1c55 (diff) |
Allow timezone to be configurable
* Fixes #1637
* New advanced setting gallery/timezone
* Default setting comes from PHP
-rw-r--r-- | modules/gallery/config/locale.php | 8 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_installer.php | 7 | ||||
-rw-r--r-- | modules/gallery/module.info | 2 |
3 files changed, 10 insertions, 7 deletions
diff --git a/modules/gallery/config/locale.php b/modules/gallery/config/locale.php index 0509e45f..13de9098 100644 --- a/modules/gallery/config/locale.php +++ b/modules/gallery/config/locale.php @@ -29,14 +29,10 @@ $config['language'] = array('en_US', 'English_United States'); /** - * Locale timezone. Defaults to use the server timezone. + * Locale timezone. Set in 'Advanced' settings, falling back to the server's zone. * @see http://php.net/timezones */ -$config['timezone'] = ini_get('date.timezone'); -if (empty($config['timezone'])) { - // This is a required field. Pick something as a default. - $config['timezone'] = "America/Los_Angeles"; -} +$config['timezone'] = module::get_var("gallery", "timezone", date_default_timezone_get()); // i18n settings diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 20de1fea..2cb04356 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -683,6 +683,13 @@ class gallery_installer { module::set_var("gallery", "apple_touch_icon_url", "lib/images/apple-touch-icon.png"); module::set_version("gallery", $version = 47); } + + if ($version == 47) { + // Add configuration variable to set timezone. Defaults to the currently + // used timezone (from PHP configuration). + module::set_var("gallery", "timezone", Kohana::config('locale.timezone')); + module::set_version("gallery", $version = 48); + } } static function uninstall() { diff --git a/modules/gallery/module.info b/modules/gallery/module.info index aa1dc341..807d08fd 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 47 +version = 48 |