diff options
| author | Pim van den Berg | 2009-12-28 10:59:29 +0100 |
|---|---|---|
| committer | Pim van den Berg | 2009-12-28 10:59:29 +0100 |
| commit | 0808310391b8ecb5b8cdee3c922ffccc076c8daa (patch) | |
| tree | a704d189bddd04ce2aee978134a6b95ae1bf74db /inc/html.inc.php | |
| parent | load plugins on the host page via ajax (diff) | |
| download | apt-panopticon_cgp-0808310391b8ecb5b8cdee3c922ffccc076c8daa.zip apt-panopticon_cgp-0808310391b8ecb5b8cdee3c922ffccc076c8daa.tar.gz apt-panopticon_cgp-0808310391b8ecb5b8cdee3c922ffccc076c8daa.tar.bz2 apt-panopticon_cgp-0808310391b8ecb5b8cdee3c922ffccc076c8daa.tar.xz | |
replace duplicate code by function plugin_header
Diffstat (limited to '')
| -rw-r--r-- | inc/html.inc.php | 16 |
1 files changed, 16 insertions, 0 deletions
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 | ||
