From: "Liam McLoughlin" <hexxeh@hexxeh.net> To: gentoo-commits@lists.gentoo.org Subject: [gentoo-commits] proj/gentoaster:webui commit in: web/ Date: Tue, 2 Aug 2011 17:31:35 +0000 (UTC) [thread overview] Message-ID: <a0a786dbc48cf83aab4954058c28b4ff8dfa19f5.hexxeh@gentoo> (raw) commit: a0a786dbc48cf83aab4954058c28b4ff8dfa19f5 Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> AuthorDate: Tue Aug 2 17:31:27 2011 +0000 Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> CommitDate: Tue Aug 2 17:31:27 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=a0a786db Add options for configuring default keyboard layout and timezone --- web/config.php | 6 ++++++ 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);
WARNING: multiple messages have this Message-ID (diff)
From: "Liam McLoughlin" <hexxeh@hexxeh.net> To: gentoo-commits@lists.gentoo.org Subject: [gentoo-commits] proj/gentoaster:master commit in: web/ Date: Fri, 12 Aug 2011 23:17:59 +0000 (UTC) [thread overview] Message-ID: <a0a786dbc48cf83aab4954058c28b4ff8dfa19f5.hexxeh@gentoo> (raw) Message-ID: <20110812231759.xfjaqGKZY4MXbTZ_NLkmaDLEhOrzfOnJY6q19iBx0N0@z> (raw) commit: a0a786dbc48cf83aab4954058c28b4ff8dfa19f5 Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> AuthorDate: Tue Aug 2 17:31:27 2011 +0000 Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> CommitDate: Tue Aug 2 17:31:27 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=a0a786db Add options for configuring default keyboard layout and timezone --- web/config.php | 6 ++++++ 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);
next reply other threads:[~2011-08-02 17:31 UTC|newest] Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-08-02 17:31 Liam McLoughlin [this message] 2011-08-12 23:17 ` [gentoo-commits] proj/gentoaster:master commit in: web/ Liam McLoughlin -- strict thread matches above, loose matches on Subject: below -- 2011-08-12 23:17 Liam McLoughlin 2011-08-02 17:22 ` [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-12 23:17 [gentoo-commits] proj/gentoaster:master " Liam McLoughlin 2011-07-27 22:13 ` [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-12 23:17 [gentoo-commits] proj/gentoaster:master " Liam McLoughlin 2011-07-28 1:08 ` [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-12 23:17 [gentoo-commits] proj/gentoaster:master " Liam McLoughlin 2011-07-27 20:04 ` [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-12 23:17 [gentoo-commits] proj/gentoaster:master " Liam McLoughlin 2011-07-24 2:43 ` [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-06 0:14 Liam McLoughlin 2011-08-04 21:04 Liam McLoughlin 2011-07-28 1:12 Liam McLoughlin 2011-07-28 1:02 Liam McLoughlin 2011-07-28 0:56 Liam McLoughlin 2011-07-27 22:11 Liam McLoughlin 2011-07-27 22:11 Liam McLoughlin 2011-07-27 22:04 Liam McLoughlin 2011-07-27 22:02 Liam McLoughlin 2011-07-27 20:25 Liam McLoughlin 2011-07-27 20:11 Liam McLoughlin 2011-07-15 19:59 Liam McLoughlin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=a0a786dbc48cf83aab4954058c28b4ff8dfa19f5.hexxeh@gentoo \ --to=hexxeh@hexxeh.net \ --cc=gentoo-commits@lists.gentoo.org \ --cc=gentoo-dev@lists.gentoo.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox