diff options
author | Liam McLoughlin <hexxeh@hexxeh.net> | 2011-08-02 18:31:27 +0100 |
---|---|---|
committer | Liam McLoughlin <hexxeh@hexxeh.net> | 2011-08-02 18:31:27 +0100 |
commit | a0a786dbc48cf83aab4954058c28b4ff8dfa19f5 (patch) | |
tree | e57797caeb22109df6148dd4acba60f0929e27dd | |
parent | Fix a simultaneous builds bug where failed builds were counted as still being... (diff) | |
download | gentoaster-a0a786dbc48cf83aab4954058c28b4ff8dfa19f5.tar.gz gentoaster-a0a786dbc48cf83aab4954058c28b4ff8dfa19f5.tar.bz2 gentoaster-a0a786dbc48cf83aab4954058c28b4ff8dfa19f5.zip |
Add options for configuring default keyboard layout and timezone
-rw-r--r-- | web/config.php | 6 | ||||
-rw-r--r-- | web/index.php | 13 |
2 files changed, 16 insertions, 3 deletions
diff --git a/web/config.php b/web/config.php index 39f505f..38076e8 100644 --- a/web/config.php +++ b/web/config.php @@ -11,6 +11,12 @@ // Should we allow multiple simultaneous builds for a user? define("SIMULTANEOUS_BUILDS", false); + + // What should we set as the default keyboard layout? + define("DEFAULT_KEYBOARD", "gb"); + + // What should we set as the default timezone? + define("DEFAULT_TIMEZONE", "Europe/London"); // What should we set as the default list of packages? define("DEFAULT_PACKAGES", "dhcpd"); diff --git a/web/index.php b/web/index.php index b6cb119..4903bbb 100644 --- a/web/index.php +++ b/web/index.php @@ -57,15 +57,22 @@ } $timezoneOption = ""; foreach ($timezones as $timezone => $description) { - $timezoneOption .= "<option>".$timezone."</option>\n"; + $timezoneOption .= "<option"; + if ($timezone == DEFAULT_TIMEZONE) { + $timezoneOption .= " selected"; + } + $timezoneOption .= ">".$timezone."</option>\n"; } $layoutLines = file(GENTOASTER_PATH."/res/keyboard.lst"); $keyboardOption = ""; foreach($layoutLines as $layout) { $layoutdata = explode("\t", $layout); - $keyboardOption .= "<option value=\"".$layoutdata[0]."\">"; - $keyboardOption .= trim($layoutdata[1])."</option>\n"; + $keyboardOption .= "<option value=\"".$layoutdata[0]."\""; + if ($layoutdata[0] == DEFAULT_KEYBOARD) { + $keyboardOption .= " selected"; + } + $keyboardOption .= ">".trim($layoutdata[1])."</option>\n"; } asort($layouts); |