From c7dd2550ddd43274104efba57a840dd6e4653e84 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 27 Feb 2007 01:19:46 +0000 Subject: [PATCH] Merged MDL-8670 --- admin/settings/appearance.php | 7 +++++++ calendar/lib.php | 3 +++ lang/en_utf8/calendar.php | 1 + 3 files changed, 11 insertions(+) diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index 3e9d484d6c..b0289ef2f0 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -14,10 +14,17 @@ $temp->add(new admin_setting_configcheckbox('tabselectedtofront', get_string('ta $ADMIN->add('themes', $temp); $ADMIN->add('themes', new admin_externalpage('themeselector', get_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php')); +# for CALENDAR_TF_12 and CALENDAR_TF_24 ... +require_once($CFG->dirroot . '/calendar/lib.php'); // calendar $temp = new admin_settingpage('calendar', get_string('calendarsettings','admin')); $temp->add(new admin_setting_special_adminseesall()); +$temp->add(new admin_setting_configselect('calendar_site_timeformat', get_string('pref_timeformat', 'calendar'), get_string('explain_site_timeformat', 'calendar'), '0', +array( 0 => get_string('default', 'calendar'), + CALENDAR_TF_12 => get_string('timeformat_12', 'calendar'), + CALENDAR_TF_24 => get_string('timeformat_24', 'calendar') + ))); $temp->add(new admin_setting_configselect('calendar_startwday', get_string('configstartwday', 'admin'), get_string('helpstartofweek', 'admin'), 0, array( 0 => get_string('sunday', 'calendar'), diff --git a/calendar/lib.php b/calendar/lib.php index 822efde1e6..8d22fd4c51 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -832,6 +832,9 @@ function calendar_time_representation($time) { $langtimeformat = get_string('strftimetime'); } $timeformat = get_user_preferences('calendar_timeformat'); + if(empty($timeformat)){ + $timeformat = get_config(NULL,'calendar_site_timeformat'); + } // The ? is needed because the preference might be present, but empty return userdate($time, empty($timeformat) ? $langtimeformat : $timeformat); } diff --git a/lang/en_utf8/calendar.php b/lang/en_utf8/calendar.php index 10871ffbda..3f5e994467 100644 --- a/lang/en_utf8/calendar.php +++ b/lang/en_utf8/calendar.php @@ -46,6 +46,7 @@ $string['explain_maxevents'] = 'This sets the maximum number of upcoming events $string['explain_persistflt'] = 'If this is enabled, then Moodle will remember your last event filter settings and automatically restore them each time you login.'; $string['explain_startwday'] = 'Calendar weeks will be shown as starting on the day that you select here.'; $string['explain_timeformat'] = 'You can choose to see times in either 12 or 24 hour format. If you choose \"default\", then the format will be automatically chosen according to the language you use in the site.'; +$string['explain_site_timeformat'] = 'You can choose to see times in either 12 or 24 hour format for the whole site. If you choose \"default\", then the format will be automatically chosen according to the language you use in the site. This setting can be overridden by user preferences.'; $string['export'] = 'Export'; $string['exportcalendar'] = 'Export calendar'; $string['exportbutton'] = 'Export'; -- 2.39.5