From 16994dbdb25bfc2be8bd19afd93cbcdfe3c6feda Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 13 Sep 2013 09:07:19 -0400 Subject: [PATCH] Add some styling to the version number in the footer. If there is an upgrade available, the label-info (blue) class is applied. If there is not an upgrade avaiable, the label-success (green) class is applied. --- web/app/Controller/AppController.php | 8 +++++++- web/app/View/Layouts/default.ctp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/web/app/Controller/AppController.php b/web/app/Controller/AppController.php index 7dfef14d1..673aaab7e 100644 --- a/web/app/Controller/AppController.php +++ b/web/app/Controller/AppController.php @@ -71,9 +71,15 @@ class AppController extends Controller { $this->set('daemonStatus', ('Stopped')); } + if (Configure::read('ZM_DYN_LAST_VERSION') > Configure::read('ZM_VERSION')) { + $zmVersion = '' . Configure::read('ZM_VERSION') . ''; + } else { + $zmVersion = '' . Configure::read('ZM_VERSION') . ''; + } + $this->set('systemLoad', $this->AppModel->getSystemLoad()); $this->set('diskSpace', $this->AppModel->getDiskSpace()); - $this->set('zmVersion', Configure::read('ZM_VERSION')); + $this->set('zmVersion', $zmVersion); } function extractNamedParams($mandatory, $optional = array()) { diff --git a/web/app/View/Layouts/default.ctp b/web/app/View/Layouts/default.ctp index 033486eab..ee1f3b988 100644 --- a/web/app/View/Layouts/default.ctp +++ b/web/app/View/Layouts/default.ctp @@ -79,7 +79,7 @@ $cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework

Configured for Html->link($zmBandwidth, array('controller' => 'Bandwidth', 'action' => 'index')); ?> bandwidth. - Version Html->link($zmVersion, array('controller' => 'Version')); ?> + Version Html->link($zmVersion, array('controller' => 'Version'), array('escape' => false)); ?>