From 1e47ade7e95bf69a6e34613b05416b4b2f5b372c Mon Sep 17 00:00:00 2001
From: Pim van den Berg
Date: Fri, 28 Dec 2012 20:13:08 +0100
Subject: don't show plugins the host doesn't have
---
host.php | 6 ++++--
inc/html.inc.php | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/host.php b/host.php
index bd7209a..42121ea 100644
--- a/host.php
+++ b/host.php
@@ -29,8 +29,10 @@ plugins_list($host, $CONFIG['overview'], $plugins, $selected_plugins);
echo '
';
foreach ($selected_plugins as $selected_plugin) {
- plugin_header($host, $selected_plugin);
- graphs_from_plugin($host, $selected_plugin);
+ if (in_array($selected_plugin, $plugins)) {
+ plugin_header($host, $selected_plugin);
+ graphs_from_plugin($host, $selected_plugin);
+ }
}
echo '
';
diff --git a/inc/html.inc.php b/inc/html.inc.php
index 3ad2439..fd32b38 100644
--- a/inc/html.inc.php
+++ b/inc/html.inc.php
@@ -75,8 +75,10 @@ function plugins_list($host, $overview_plugins, $other_plugins, $selected_plugin
# first the ones defined as ordered
foreach($overview_plugins as $plugin) {
- $selected = selected_plugin($plugin, $selected_plugins);
- printf("%s\n", $selected, $CONFIG['weburl'], $host, $plugin, $plugin);
+ if (in_array($plugin, $other_plugins)) {
+ $selected = selected_plugin($plugin, $selected_plugins);
+ printf("%s\n", $selected, $CONFIG['weburl'], $host, $plugin, $plugin);
+ }
}
# other plugins
--
cgit v1.1