summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/configuration.md7
-rw-r--r--index.php9
2 files changed, 15 insertions, 1 deletions
diff --git a/docs/configuration.md b/docs/configuration.md
index 8ef9df5..b29fb2c 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -70,6 +70,13 @@ $config['frontpage']['order'] = array('routers', 'commands', 'parameter', 'butto
```
Sets the order of the sections that are displayed.
+```php
+$config['frontpage']['router_count'] = 5;
+```
+Sets the number of routers to show on the front page before the list scrolls. If
+set to a positive integer, then that number of routers will be shown, otherwise
+the list will show all routers.
+
### Contact
```php
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) {