From 57bd53847cfd01d414728c871512ef2af123ffd5 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 19 Aug 2015 20:59:05 -0400 Subject: Improve sidebar menus --- app/Controller/Projectuser.php | 2 -- app/Core/Router.php | 41 +++++++++++++++++++++++++++++++++++ app/Helper/App.php | 22 +++++++++++++++++++ app/Template/analytic/sidebar.php | 12 +++++----- app/Template/app/sidebar.php | 12 +++++----- app/Template/category/edit.php | 2 ++ app/Template/column/edit.php | 2 ++ app/Template/config/sidebar.php | 20 ++++++++--------- app/Template/project/sidebar.php | 24 ++++++++++---------- app/Template/project_user/layout.php | 2 +- app/Template/project_user/sidebar.php | 10 ++++----- app/Template/swimlane/edit.php | 2 ++ app/Template/task/sidebar.php | 36 +++++++++++++++--------------- app/Template/user/sidebar.php | 30 ++++++++++++------------- 14 files changed, 142 insertions(+), 75 deletions(-) (limited to 'app') diff --git a/app/Controller/Projectuser.php b/app/Controller/Projectuser.php index dba069c9..4456ce3d 100644 --- a/app/Controller/Projectuser.php +++ b/app/Controller/Projectuser.php @@ -65,7 +65,6 @@ class Projectuser extends Base $this->response->html($this->layout('project_user/roles', array( 'paginator' => $paginator, 'title' => $title, - 'action' => $action, 'user_id' => $user_id, 'users' => $users, ))); @@ -92,7 +91,6 @@ class Projectuser extends Base $this->response->html($this->layout('project_user/tasks', array( 'paginator' => $paginator, 'title' => $title, - 'action' => $action, 'user_id' => $user_id, 'users' => $users, ))); diff --git a/app/Core/Router.php b/app/Core/Router.php index ae989de5..6e7576d6 100644 --- a/app/Core/Router.php +++ b/app/Core/Router.php @@ -10,6 +10,22 @@ namespace Core; */ class Router extends Base { + /** + * Controller + * + * @access private + * @var string + */ + private $controller = ''; + + /** + * Action + * + * @access private + * @var string + */ + private $action = ''; + /** * Store routes for path lookup * @@ -26,6 +42,28 @@ class Router extends Base */ private $urls = array(); + /** + * Get action + * + * @access public + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * Get controller + * + * @access public + * @return string + */ + public function getController() + { + return $this->controller; + } + /** * Get the path to compare patterns * @@ -208,6 +246,9 @@ class Router extends Base return false; } + $this->action = $method; + $this->controller = $controller; + $instance = new $class($this->container); $instance->beforeAction($controller, $method); $instance->$method(); diff --git a/app/Helper/App.php b/app/Helper/App.php index 8f591143..e5ebefcb 100644 --- a/app/Helper/App.php +++ b/app/Helper/App.php @@ -10,6 +10,28 @@ namespace Helper; */ class App extends \Core\Base { + /** + * Get router controller + * + * @access public + * @return string + */ + public function getRouterController() + { + return $this->router->getController(); + } + + /** + * Get router action + * + * @access public + * @return string + */ + public function getRouterAction() + { + return $this->router->getAction(); + } + /** * Get javascript language code * diff --git a/app/Template/analytic/sidebar.php b/app/Template/analytic/sidebar.php index 59cc1fa6..c942f7ed 100644 --- a/app/Template/analytic/sidebar.php +++ b/app/Template/analytic/sidebar.php @@ -1,22 +1,22 @@