Skip to content

Commit

Permalink
A new configuration setting so that the admin can define the site's d…
Browse files Browse the repository at this point in the history
…efault

timezone.
  • Loading branch information
moodler committed Feb 12, 2004
1 parent 90207a0 commit d6582c7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
27 changes: 27 additions & 0 deletions admin/config.html
Expand Up @@ -43,6 +43,33 @@
<?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"), "") ?>
Expand Down
1 change: 1 addition & 0 deletions lang/en/moodle.php
Expand Up @@ -153,6 +153,7 @@
$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';
Expand Down
1 change: 1 addition & 0 deletions lib/defaults.php
Expand Up @@ -38,6 +38,7 @@
"smtpuser" => "",
"teacherassignteachers" => true,
"textfilters" => "mod/glossary/dynalink.php",
"timezone" => 99,
"theme" => "standard",
"unzip" => "",
"zip" => ""
Expand Down

0 comments on commit d6582c7

Please sign in to comment.