diff options
author | Pim van den Berg | 2011-03-09 01:22:33 +0100 |
---|---|---|
committer | Pim van den Berg | 2011-03-09 01:23:01 +0100 |
commit | 91ce168e2c835919581df602b33fdb56e8f21185 (patch) | |
tree | 05bdf5d1201aab9c30362202397168224006f195 /inc | |
parent | plugin: add filecount plugin (diff) | |
download | apt-panopticon_cgp-91ce168e2c835919581df602b33fdb56e8f21185.zip apt-panopticon_cgp-91ce168e2c835919581df602b33fdb56e8f21185.tar.gz apt-panopticon_cgp-91ce168e2c835919581df602b33fdb56e8f21185.tar.bz2 apt-panopticon_cgp-91ce168e2c835919581df602b33fdb56e8f21185.tar.xz |
add version information to footer
Diffstat (limited to 'inc')
-rw-r--r-- | inc/html.inc.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/inc/html.inc.php b/inc/html.inc.php index a580899..f8a5b62 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php | |||
@@ -34,10 +34,24 @@ EOT; | |||
34 | 34 | ||
35 | function html_end() { | 35 | function html_end() { |
36 | global $CONFIG; | 36 | global $CONFIG; |
37 | |||
38 | $git = '/usr/bin/git'; | ||
39 | $changelog = $CONFIG['webdir'].'/doc/CHANGELOG'; | ||
40 | |||
41 | $version = 'v?'; | ||
42 | if (file_exists($git) && is_dir($CONFIG['webdir'].'/.git')) { | ||
43 | chdir($CONFIG['webdir']); | ||
44 | $version = exec($git.' describe'); | ||
45 | } elseif (file_exists($changelog)) { | ||
46 | $changelog = file($changelog); | ||
47 | $version = explode(' ', $changelog[0]); | ||
48 | $version = 'v'.$version[0]; | ||
49 | } | ||
50 | |||
37 | echo <<<EOT | 51 | echo <<<EOT |
38 | </div> | 52 | </div> |
39 | <div id="footer"> | 53 | <div id="footer"> |
40 | <hr><span class="small"><a href="http://pommi.nethuis.nl/category/cgp/" rel="external">Collectd Graph Panel</a> is distributed under the <a href="{$CONFIG['weburl']}/doc/LICENSE" rel="licence">GNU General Public License (GPLv3)</a></span> | 54 | <hr><span class="small"><a href="http://pommi.nethuis.nl/category/cgp/" rel="external">Collectd Graph Panel</a> ({$version}) is distributed under the <a href="{$CONFIG['weburl']}/doc/LICENSE" rel="licence">GNU General Public License (GPLv3)</a></span> |
41 | </div> | 55 | </div> |
42 | </body> | 56 | </body> |
43 | </html> | 57 | </html> |