diff options
author | xian310 | 2012-12-21 19:59:39 +0100 |
---|---|---|
committer | Pim van den Berg | 2012-12-21 19:59:39 +0100 |
commit | ea946240c9a5a11d337b7afcc8590870bc18cd84 (patch) | |
tree | bcd0e0733775b430716ab06b6444aa8ccd6f3b00 /inc/html.inc.php | |
parent | type/default: resolve division by zero warning (diff) | |
download | apt-panopticon_cgp-ea946240c9a5a11d337b7afcc8590870bc18cd84.zip apt-panopticon_cgp-ea946240c9a5a11d337b7afcc8590870bc18cd84.tar.gz apt-panopticon_cgp-ea946240c9a5a11d337b7afcc8590870bc18cd84.tar.bz2 apt-panopticon_cgp-ea946240c9a5a11d337b7afcc8590870bc18cd84.tar.xz |
replace the ajax expand system by a navigation menu
Signed-off-by: Pim van den Berg <pim@nethuis.nl>
Diffstat (limited to '')
-rw-r--r-- | inc/html.inc.php | 59 |
1 files changed, 47 insertions, 12 deletions
diff --git a/inc/html.inc.php b/inc/html.inc.php index 2e71488..f0390ce 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php | |||
@@ -13,7 +13,7 @@ function html_start() { | |||
13 | $path = htmlentities(breadcrumbs()); | 13 | $path = htmlentities(breadcrumbs()); |
14 | 14 | ||
15 | echo <<<EOT | 15 | echo <<<EOT |
16 | <!DOCTYPE HTML> | 16 | <!DOCTYPE html> |
17 | <html> | 17 | <html> |
18 | <head> | 18 | <head> |
19 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | 19 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
@@ -58,20 +58,55 @@ function html_end() { | |||
58 | EOT; | 58 | EOT; |
59 | } | 59 | } |
60 | 60 | ||
61 | function plugin_header($host, $plugin, $status) { | 61 | function plugin_header($host, $plugin) { |
62 | global $CONFIG; | 62 | return printf("<h3><a href='%shost.php?h=%s&p=%s'>%s</a></h3>\n", $CONFIG['weburl'], $host, $plugin, $plugin); |
63 | } | ||
64 | |||
65 | function plugins_list($host, $overview_plugins, $other_plugins, $selected_plugins = array()) { | ||
66 | echo '<div class="plugins">'; | ||
67 | echo '<h3>Plugins</h3>'; | ||
68 | echo '<ul>'; | ||
69 | |||
70 | $selected = selected_overview($selected_plugins); | ||
71 | printf("<li><a %s href='%shost.php?h=%s'>%s</a></li>\n", $selected, $CONFIG['weburl'], $host, 'overview'); | ||
72 | |||
73 | # first the ones defined as ordered | ||
74 | foreach($overview_plugins as $plugin) { | ||
75 | $selected = selected_plugin($plugin, $selected_plugins); | ||
76 | printf("<li><a %s href='%shost.php?h=%s&p=%s'>%s</a></li>\n", $selected, $CONFIG['weburl'], $host, $plugin, $plugin); | ||
77 | } | ||
78 | |||
79 | # other plugins | ||
80 | foreach($other_plugins as $plugin) { | ||
81 | if (!in_array($plugin, $overview_plugins)) { | ||
82 | $selected = selected_plugin($plugin, $selected_plugins); | ||
83 | printf("<li><a %s href='%shost.php?h=%s&p=%s'>%s</a></li>\n", $selected, $CONFIG['weburl'], $host, $plugin, $plugin); | ||
84 | } | ||
85 | } | ||
86 | |||
87 | echo '</ul>'; | ||
88 | echo '</div><! .plugins -->'; | ||
89 | } | ||
90 | |||
91 | function selected_overview($selected_plugins) { | ||
92 | if (count($selected_plugins) > 1) { | ||
93 | return 'class="selected"'; | ||
94 | } | ||
95 | return ''; | ||
96 | } | ||
63 | 97 | ||
64 | if ($status == 1) { | 98 | function selected_plugin($plugin, $selected_plugins) { |
65 | $f = 'get'; | 99 | if (in_array($plugin, $selected_plugins)) { |
66 | $i = 'plus'; | 100 | return 'class="selected"'; |
67 | $a = '+'; | ||
68 | } else { | ||
69 | $f = 'rm'; | ||
70 | $i = 'minus'; | ||
71 | $a = '-'; | ||
72 | } | 101 | } |
102 | return ''; | ||
103 | } | ||
73 | 104 | ||
74 | return printf("<h3><span class=\"point\" onclick=\"javascript:%sP('%s','%s')\"><img src=\"%slayout/%s.gif\" alt=\"[%s]\"> %s</span></h3>\n", $f, $host, $plugin, $CONFIG['weburl'], $i, $a, $plugin); | 105 | function selected_timerange($value1, $value2) { |
106 | if ($value1 == $value2) { | ||
107 | return 'class="selected"'; | ||
108 | } | ||
109 | return ''; | ||
75 | } | 110 | } |
76 | 111 | ||
77 | function host_summary($hosts) { | 112 | function host_summary($hosts) { |