diff options
-rw-r--r-- | host.php | 6 | ||||
-rw-r--r-- | inc/html.inc.php | 16 | ||||
-rw-r--r-- | plugin.php | 4 |
3 files changed, 21 insertions, 5 deletions
@@ -22,7 +22,7 @@ if(!$plugins) { | |||
22 | foreach($CONFIG['overview'] as $plugin) { | 22 | foreach($CONFIG['overview'] as $plugin) { |
23 | if (in_array($plugin, $plugins)) { | 23 | if (in_array($plugin, $plugins)) { |
24 | printf('<div id="%s">'."\n", $plugin); | 24 | printf('<div id="%s">'."\n", $plugin); |
25 | printf("<h3><span class=\"point\" onclick=\"javascript:rmP('%s','%s')\"><img src=\"%s/layout/minus.gif\" alt=\"[-]\"> %s</span></h3>\n", $host, $plugin, $CONFIG['weburl'], $plugin); | 25 | plugin_header($host, $plugin, 0); |
26 | graphs_from_plugin($host, $plugin); | 26 | graphs_from_plugin($host, $plugin); |
27 | print "</div>\n"; | 27 | print "</div>\n"; |
28 | } | 28 | } |
@@ -33,10 +33,10 @@ foreach($plugins as $plugin) { | |||
33 | if (!in_array($plugin, $CONFIG['overview'])) { | 33 | if (!in_array($plugin, $CONFIG['overview'])) { |
34 | printf('<div id="%s">'."\n", $plugin); | 34 | printf('<div id="%s">'."\n", $plugin); |
35 | if ($splugin == $plugin) { | 35 | if ($splugin == $plugin) { |
36 | printf("<h3><span class=\"point\" onclick=\"javascript:rmP('%s','%s')\"><img src=\"%s/layout/minus.gif\" alt=\"[-]\"> %s</span></h3>\n", $host, $plugin, $CONFIG['weburl'], $plugin); | 36 | plugin_header($host, $plugin, 0); |
37 | graphs_from_plugin($host, $plugin); | 37 | graphs_from_plugin($host, $plugin); |
38 | } else { | 38 | } else { |
39 | printf("<h3><span class=\"point\" onclick=\"javascript:getP('%s','%s')\"><img src=\"%s/layout/plus.gif\" alt=\"[+]\"> %s</span></h3>\n", $host, $plugin, $CONFIG['weburl'], $plugin); | 39 | plugin_header($host, $plugin, 1); |
40 | } | 40 | } |
41 | print "</div>\n"; | 41 | print "</div>\n"; |
42 | } | 42 | } |
diff --git a/inc/html.inc.php b/inc/html.inc.php index b1cb80f..e93cc66 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php | |||
@@ -40,6 +40,22 @@ function html_end() { | |||
40 | EOT; | 40 | EOT; |
41 | } | 41 | } |
42 | 42 | ||
43 | function plugin_header($host, $plugin, $status) { | ||
44 | global $CONFIG; | ||
45 | |||
46 | if ($status == 1) { | ||
47 | $f = 'get'; | ||
48 | $i = 'plus'; | ||
49 | $a = '+'; | ||
50 | } else { | ||
51 | $f = 'rm'; | ||
52 | $i = 'minus'; | ||
53 | $a = '-'; | ||
54 | } | ||
55 | |||
56 | return printf("<h3><span class=\"point\" onclick=\"javascript:%sP('%s','%s')\"><img src=\"%s/layout/%s.gif\" alt=\"[%s]\"> %s</span></h3>\n", $f, $host, $plugin, $CONFIG['weburl'], $i, $a, $plugin); | ||
57 | } | ||
58 | |||
43 | function host_summary($hosts) { | 59 | function host_summary($hosts) { |
44 | global $CONFIG; | 60 | global $CONFIG; |
45 | 61 | ||
@@ -7,9 +7,9 @@ $host = $_GET['h']; | |||
7 | $plugin = $_GET['p']; | 7 | $plugin = $_GET['p']; |
8 | 8 | ||
9 | if ($_GET['a'] == 'del') { | 9 | if ($_GET['a'] == 'del') { |
10 | printf("<h3><span class=\"point\" onclick=\"javascript:getP('%s','%s')\"><img src=\"%s/layout/plus.gif\" alt=\"[+]\"> %s</span></h3>\n", $host, $plugin, $CONFIG['weburl'], $plugin); | 10 | plugin_header($host, $plugin, 1); |
11 | } else { | 11 | } else { |
12 | printf("<h3><span class=\"point\" onclick=\"javascript:rmP('%s','%s')\"><img src=\"%s/layout/minus.gif\" alt=\"[-]\"> %s</span></h3>\n", $host, $plugin, $CONFIG['weburl'], $plugin); | 12 | plugin_header($host, $plugin, 0); |
13 | graphs_from_plugin($host, $plugin); | 13 | graphs_from_plugin($host, $plugin); |
14 | } | 14 | } |
15 | 15 | ||