]> git.mjollnir.org Git - moodle.git/commitdiff
A new configuration setting so that the admin can define the site's default
authormoodler <moodler>
Thu, 12 Feb 2004 06:08:06 +0000 (06:08 +0000)
committermoodler <moodler>
Thu, 12 Feb 2004 06:08:06 +0000 (06:08 +0000)
timezone.

admin/config.html
lang/en/moodle.php
lib/defaults.php

index 3f4a7f8e31ad51fe034d046d47073ff3bac4ad0a..5d93556dc83b4e3df95d9d29aa4ce32d7221cc9b 100644 (file)
     <?php print_string("configlocale") ?>
     </td>
 </tr>
+<tr valign=top>
+       <td align=right><p>timezone:</td>
+    <td><?php
+       if (abs($config->timezone) > 13) {
+           $config->timezone = 99;
+       }
+       $timenow = time();
+
+       for ($tz = -26; $tz <= 26; $tz++) {
+           $zone = (float)$tz/2.0;
+           $usertime = $timenow + ($tz * 1800);
+           if ($tz == 0) {
+               $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT)";
+           } else if ($tz < 0) {
+               $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT$zone)";
+           } else {
+               $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT+$zone)";
+           }
+       }
+
+       choose_from_menu ($timezones, "timezone", $config->timezone, get_string("serverlocaltime"), "", "99");
+    ?>
+    </td>
+    <td>
+    <?php print_string("configtimezone") ?>
+    </td>
+</tr>
 <tr valign=top>
        <td align=right><p>country:</td>
        <td><?php choose_from_menu (get_list_of_countries(), "country", $config->country, get_string("selectacountry"), "") ?>
index a01fd880623405740d62946167bdccb3fd40c0e7..67fc8967ce9623da7831da11ce3d9c09b186ea2a 100644 (file)
@@ -153,6 +153,7 @@ $string['configsmtphosts'] = 'Give the full name of one or more local SMTP serve
 $string['configsmtpuser'] = 'If you have specified an SMTP server above, and the server requires authentication, then enter the username and password here.';
 $string['configteacherassignteachers'] = 'Should ordinary teachers be allowed to assign other teachers within courses they teach?  If \'No\', then only course creators and admins can assign teachers.';
 $string['configtextfilters'] = 'Text filters process text in various ways.  Specify the relative paths to text filters you want to use in the order they should be applied to texts, separated by commas. (For example,  mod/glossary/dynalink.php, filter/censor/censor.php)';
+$string['configtimezone'] = 'You can set the default timezone here.  This is the only the DEFAULT timezone for displaying dates - each user can override this by setting their own in their profile. \"Server time\" will make Moodle default to the server\'s operating system setting.';
 $string['configunzip'] = 'Indicate the location of your unzip program (Unix only, optional).  If specified, this will be used to unpack zip archives on the server.  If you leave this blank, then Moodle will use internal routines.';
 $string['configuration'] = 'Configuration';
 $string['configvariables'] = 'Variables';
index 2cc140bd17df6c6e62dbbe46227b61d0b5d0d4fd..c6a579cd899471671d626eee1c176507a574852f 100644 (file)
@@ -38,6 +38,7 @@
        "smtpuser"         => "",
        "teacherassignteachers"  => true,
        "textfilters"      => "mod/glossary/dynalink.php",
+       "timezone"         => 99,
        "theme"            => "standard",
        "unzip"            => "",
        "zip"              => ""