summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorNat Lasseter <Nat Lasseter nathan@bytemark.co.uk>2018-02-02 16:52:48 +0000
committerNat Lasseter <Nat Lasseter nathan@bytemark.co.uk>2018-02-02 16:52:48 +0000
commitb1e4faeb9eb3398fc8dee795b2203ae0c141bdfb (patch)
tree85999976090c5246a7acb45f8beb228b0faacdb9 /index.php
parent88fcd07560c4c19a7621e43ee00862a028423839 (diff)
Add an option to show all of the routers (<1)
Diffstat (limited to 'index.php')
-rw-r--r--index.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/index.php b/index.php
index 8f661ac..f3b3249 100644
--- a/index.php
+++ b/index.php
@@ -40,10 +40,17 @@ final class LookingGlass {
$this->doc = $config['doc'];
}
+ private function router_count() {
+ if ($this->frontpage['router_count'] > 0)
+ return $this->frontpage['router_count'];
+ else
+ return count($this->routers);
+ }
+
private function render_routers() {
print('<div class="form-group">');
print('<label for="routers">Router to use</label>');
- print('<select size="'.$this->frontpage['router_count'].'" class="form-control" name="routers" id="routers">');
+ print('<select size="'.router_count().'" class="form-control" name="routers" id="routers">');
$first = true;
foreach (array_keys($this->routers) as $router) {