]> git.mjollnir.org Git - moodle.git/commitdiff
Merged MDL-8670
authormoodler <moodler>
Tue, 27 Feb 2007 01:19:46 +0000 (01:19 +0000)
committermoodler <moodler>
Tue, 27 Feb 2007 01:19:46 +0000 (01:19 +0000)
admin/settings/appearance.php
calendar/lib.php
lang/en_utf8/calendar.php

index 3e9d484d6cd8200c1de5f29c0d79416e6574bd82..b0289ef2f0f4c1135280cfbfd38204f7c4cda8a0 100644 (file)
@@ -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'),
index 822efde1e62a3d19e814ffddc5096a458d90070b..8d22fd4c5109d4c8b499ec88ae20309db8bd25f3 100644 (file)
@@ -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);
 }
index 10871ffbda6f087ee56f1ed849fcf19e909b8f1e..3f5e9944676b7828d9485961322d276326af512b 100644 (file)
@@ -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';