diff options
author | Pim van den Berg | 2012-12-28 20:25:29 +0100 |
---|---|---|
committer | Pim van den Berg | 2012-12-28 20:25:29 +0100 |
commit | 79ac52d54a51acdbd469f2d48890eb11e04ac991 (patch) | |
tree | 2bed6c9c58d6279a0f6da9083107017312d5bfe5 /inc/html.inc.php | |
parent | don't show plugins the host doesn't have (diff) | |
download | apt-panopticon_cgp-79ac52d54a51acdbd469f2d48890eb11e04ac991.zip apt-panopticon_cgp-79ac52d54a51acdbd469f2d48890eb11e04ac991.tar.gz apt-panopticon_cgp-79ac52d54a51acdbd469f2d48890eb11e04ac991.tar.bz2 apt-panopticon_cgp-79ac52d54a51acdbd469f2d48890eb11e04ac991.tar.xz |
remove arguments overview_plugins and other_plugins from plugins_list function
Those can be gathered within the function.
Diffstat (limited to '')
-rw-r--r-- | inc/html.inc.php | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/inc/html.inc.php b/inc/html.inc.php index fd32b38..a9e6a94 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php | |||
@@ -63,29 +63,42 @@ function plugin_header($host, $plugin) { | |||
63 | return printf("<h3><a href='%shost.php?h=%s&p=%s'>%s</a></h3>\n", $CONFIG['weburl'], $host, $plugin, $plugin); | 63 | return printf("<h3><a href='%shost.php?h=%s&p=%s'>%s</a></h3>\n", $CONFIG['weburl'], $host, $plugin, $plugin); |
64 | } | 64 | } |
65 | 65 | ||
66 | function plugins_list($host, $overview_plugins, $other_plugins, $selected_plugins = array()) { | 66 | function plugins_list($host, $selected_plugins = array()) { |
67 | global $CONFIG; | 67 | global $CONFIG; |
68 | 68 | ||
69 | $plugins = collectd_plugins($host); | ||
70 | |||
69 | echo '<div class="plugins">'; | 71 | echo '<div class="plugins">'; |
70 | echo '<h3>Plugins</h3>'; | 72 | echo '<h3>Plugins</h3>'; |
71 | echo '<ul>'; | 73 | echo '<ul>'; |
72 | 74 | ||
73 | $selected = selected_overview($selected_plugins); | 75 | printf("<li><a %s href='%shost.php?h=%s'>overview</a></li>\n", |
74 | printf("<li><a %s href='%shost.php?h=%s'>%s</a></li>\n", $selected, $CONFIG['weburl'], $host, 'overview'); | 76 | selected_overview($selected_plugins), |
77 | $CONFIG['weburl'], | ||
78 | $host | ||
79 | ); | ||
75 | 80 | ||
76 | # first the ones defined as ordered | 81 | # first the ones defined as ordered |
77 | foreach($overview_plugins as $plugin) { | 82 | foreach($CONFIG['overview'] as $plugin) { |
78 | if (in_array($plugin, $other_plugins)) { | 83 | if (in_array($plugin, $plugins)) { |
79 | $selected = selected_plugin($plugin, $selected_plugins); | 84 | printf("<li><a %s href='%shost.php?h=%s&p=%s'>%4\$s</a></li>\n", |
80 | printf("<li><a %s href='%shost.php?h=%s&p=%s'>%s</a></li>\n", $selected, $CONFIG['weburl'], $host, $plugin, $plugin); | 85 | selected_plugin($plugin, $selected_plugins), |
86 | $CONFIG['weburl'], | ||
87 | $host, | ||
88 | $plugin | ||
89 | ); | ||
81 | } | 90 | } |
82 | } | 91 | } |
83 | 92 | ||
84 | # other plugins | 93 | # other plugins |
85 | foreach($other_plugins as $plugin) { | 94 | foreach($plugins as $plugin) { |
86 | if (!in_array($plugin, $overview_plugins)) { | 95 | if (!in_array($plugin, $CONFIG['overview'])) { |
87 | $selected = selected_plugin($plugin, $selected_plugins); | 96 | printf("<li><a %s href='%shost.php?h=%s&p=%s'>%4\$s</a></li>\n", |
88 | printf("<li><a %s href='%shost.php?h=%s&p=%s'>%s</a></li>\n", $selected, $CONFIG['weburl'], $host, $plugin, $plugin); | 97 | selected_plugin($plugin, $selected_plugins), |
98 | $CONFIG['weburl'], | ||
99 | $host, | ||
100 | $plugin | ||
101 | ); | ||
89 | } | 102 | } |
90 | } | 103 | } |
91 | 104 | ||