Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Do host link show/hiding in template, making the js file redundant.

  • Loading branch information...
commit e58395ca05e61b25f15dda39c039e00e3ad14fcc 1 parent d9f447c
@jwheare authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 functions.php
View
7 functions.php
@@ -216,11 +216,16 @@ function htmlHostsInConfig() {
# Prints HTML output of all the switches in the config
echo "<ul id=\"navlinks\">";
+ $currentHost = @$_GET['host'];
foreach ($pollhosts as $thishost) {
if($thishost['showoninterface'] == true) {
echo '<li><a href="viewhost.php?host=' . $thishost['prettyname'] . '">' . $thishost['prettyname'] . '</a>';
foreach ($thishost['graphtypes'] as $thistype) {
- echo '<ul>';
+ if ($currentHost == $thishost['prettyname']) {
+ echo '<ul>';
+ } else {
+ echo '<ul style="display: none;">';
+ }
echo '<li><a href="viewhost.php?host=' . $thishost['prettyname'] . '&type=' . $thistype . '">' . $thistype . '</a></li>';
echo '</ul>';
}
Please sign in to comment.
Something went wrong with that request. Please try again.