aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPim van den Berg2012-12-28 20:13:08 +0100
committerPim van den Berg2012-12-28 20:13:08 +0100
commit1e47ade7e95bf69a6e34613b05416b4b2f5b372c (patch)
tree70a08ffce2aff483a44e385e16158fc1fdf2b480
parentresolve php warning/notices when plugin doesn't exist (diff)
downloadapt-panopticon_cgp-1e47ade7e95bf69a6e34613b05416b4b2f5b372c.zip
apt-panopticon_cgp-1e47ade7e95bf69a6e34613b05416b4b2f5b372c.tar.gz
apt-panopticon_cgp-1e47ade7e95bf69a6e34613b05416b4b2f5b372c.tar.bz2
apt-panopticon_cgp-1e47ade7e95bf69a6e34613b05416b4b2f5b372c.tar.xz
don't show plugins the host doesn't have
-rw-r--r--host.php6
-rw-r--r--inc/html.inc.php6
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);
29 29
30echo '<div class="graphs">'; 30echo '<div class="graphs">';
31foreach ($selected_plugins as $selected_plugin) { 31foreach ($selected_plugins as $selected_plugin) {
32 plugin_header($host, $selected_plugin); 32 if (in_array($selected_plugin, $plugins)) {
33 graphs_from_plugin($host, $selected_plugin); 33 plugin_header($host, $selected_plugin);
34 graphs_from_plugin($host, $selected_plugin);
35 }
34} 36}
35echo '</div>'; 37echo '</div>';
36 38
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
75 75
76 # first the ones defined as ordered 76 # first the ones defined as ordered
77 foreach($overview_plugins as $plugin) { 77 foreach($overview_plugins as $plugin) {
78 $selected = selected_plugin($plugin, $selected_plugins); 78 if (in_array($plugin, $other_plugins)) {
79 printf("<li><a %s href='%shost.php?h=%s&p=%s'>%s</a></li>\n", $selected, $CONFIG['weburl'], $host, $plugin, $plugin); 79 $selected = selected_plugin($plugin, $selected_plugins);
80 printf("<li><a %s href='%shost.php?h=%s&p=%s'>%s</a></li>\n", $selected, $CONFIG['weburl'], $host, $plugin, $plugin);
81 }
80 } 82 }
81 83
82 # other plugins 84 # other plugins