A new configuration setting so that the admin can define the site's default

timezone.
This commit is contained in:
moodler 2004-02-12 06:08:06 +00:00
parent 90207a06e3
commit d6582c7cac
3 changed files with 29 additions and 0 deletions

View file

@ -43,6 +43,33 @@
<?php print_string("configlocale") ?> <?php print_string("configlocale") ?>
</td> </td>
</tr> </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> <tr valign=top>
<td align=right><p>country:</td> <td align=right><p>country:</td>
<td><?php choose_from_menu (get_list_of_countries(), "country", $config->country, get_string("selectacountry"), "") ?> <td><?php choose_from_menu (get_list_of_countries(), "country", $config->country, get_string("selectacountry"), "") ?>

View 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['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['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['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['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['configuration'] = 'Configuration';
$string['configvariables'] = 'Variables'; $string['configvariables'] = 'Variables';

View file

@ -38,6 +38,7 @@
"smtpuser" => "", "smtpuser" => "",
"teacherassignteachers" => true, "teacherassignteachers" => true,
"textfilters" => "mod/glossary/dynalink.php", "textfilters" => "mod/glossary/dynalink.php",
"timezone" => 99,
"theme" => "standard", "theme" => "standard",
"unzip" => "", "unzip" => "",
"zip" => "" "zip" => ""