diff options
Diffstat (limited to '')
| -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> |
