From 79ac52d54a51acdbd469f2d48890eb11e04ac991 Mon Sep 17 00:00:00 2001
From: Pim van den Berg
Date: Fri, 28 Dec 2012 20:25:29 +0100
Subject: remove arguments overview_plugins and other_plugins from plugins_list
function
Those can be gathered within the function.
---
inc/html.inc.php | 35 ++++++++++++++++++++++++-----------
1 file changed, 24 insertions(+), 11 deletions(-)
(limited to 'inc/html.inc.php')
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) {
return printf("
\n", $CONFIG['weburl'], $host, $plugin, $plugin);
}
-function plugins_list($host, $overview_plugins, $other_plugins, $selected_plugins = array()) {
+function plugins_list($host, $selected_plugins = array()) {
global $CONFIG;
+ $plugins = collectd_plugins($host);
+
echo '';
echo '
Plugins
';
echo '
';
- $selected = selected_overview($selected_plugins);
- printf("- %s
\n", $selected, $CONFIG['weburl'], $host, 'overview');
+ printf("- overview
\n",
+ selected_overview($selected_plugins),
+ $CONFIG['weburl'],
+ $host
+ );
# first the ones defined as ordered
- foreach($overview_plugins as $plugin) {
- if (in_array($plugin, $other_plugins)) {
- $selected = selected_plugin($plugin, $selected_plugins);
- printf("- %s
\n", $selected, $CONFIG['weburl'], $host, $plugin, $plugin);
+ foreach($CONFIG['overview'] as $plugin) {
+ if (in_array($plugin, $plugins)) {
+ printf("- %4\$s
\n",
+ selected_plugin($plugin, $selected_plugins),
+ $CONFIG['weburl'],
+ $host,
+ $plugin
+ );
}
}
# other plugins
- foreach($other_plugins as $plugin) {
- if (!in_array($plugin, $overview_plugins)) {
- $selected = selected_plugin($plugin, $selected_plugins);
- printf("- %s
\n", $selected, $CONFIG['weburl'], $host, $plugin, $plugin);
+ foreach($plugins as $plugin) {
+ if (!in_array($plugin, $CONFIG['overview'])) {
+ printf("- %4\$s
\n",
+ selected_plugin($plugin, $selected_plugins),
+ $CONFIG['weburl'],
+ $host,
+ $plugin
+ );
}
}
--
cgit v1.1