aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/host.php
diff options
context:
space:
mode:
authorPim van den Berg2009-12-05 20:23:25 +0100
committerPim van den Berg2009-12-05 20:23:25 +0100
commit1a076098050969d217f7abe8ec2102719fcba21d (patch)
treea44dedb92ce9687b5465963292de427dc08d0dd6 /host.php
parenttemporary disable swap_io (diff)
downloadapt-panopticon_cgp-1a076098050969d217f7abe8ec2102719fcba21d.zip
apt-panopticon_cgp-1a076098050969d217f7abe8ec2102719fcba21d.tar.gz
apt-panopticon_cgp-1a076098050969d217f7abe8ec2102719fcba21d.tar.bz2
apt-panopticon_cgp-1a076098050969d217f7abe8ec2102719fcba21d.tar.xz
load plugins on the host page via ajax
Diffstat (limited to '')
-rw-r--r--host.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/host.php b/host.php
index 3bf3698..17cb499 100644
--- a/host.php
+++ b/host.php
@@ -21,21 +21,24 @@ if(!$plugins) {
21# first the ones defined in overview 21# first the ones defined in overview
22foreach($CONFIG['overview'] as $plugin) { 22foreach($CONFIG['overview'] as $plugin) {
23 if (in_array($plugin, $plugins)) { 23 if (in_array($plugin, $plugins)) {
24 printf("<h3><img src=\"%s/layout/minus.gif\" alt=\"[-]\"> %s</h3>\n", $CONFIG['weburl'], $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 graphs_from_plugin($host, $plugin); 26 graphs_from_plugin($host, $plugin);
27 print "</div>\n";
26 } 28 }
27} 29}
28 30
29# other plugins 31# other plugins
30foreach($plugins as $plugin) { 32foreach($plugins as $plugin) {
31 if (!in_array($plugin, $CONFIG['overview'])) { 33 if (!in_array($plugin, $CONFIG['overview'])) {
32 $url = sprintf('<a href="%s/host.php?h=%s&p=%s">%s</a>'."\n", $CONFIG['weburl'], $host, $plugin, $plugin); 34 printf('<div id="%s">'."\n", $plugin);
33 if ($splugin == $plugin) { 35 if ($splugin == $plugin) {
34 printf("<h3><img src=\"%s/layout/minus.gif\" alt=\"[-]\"> %s</h3>\n", $CONFIG['weburl'], $url); 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);
35 graphs_from_plugin($host, $plugin); 37 graphs_from_plugin($host, $plugin);
36 } else { 38 } else {
37 printf("<h3><img src=\"%s/layout/plus.gif\" alt=\"[+]\"> %s</h3>\n", $CONFIG['weburl'], $url); 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);
38 } 40 }
41 print "</div>\n";
39 } 42 }
40} 43}
41 44