summaryrefslogtreecommitdiff
path: root/app/Helper/App.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Helper/App.php')
-rw-r--r--app/Helper/App.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/Helper/App.php b/app/Helper/App.php
index 6e6028fc..2015d896 100644
--- a/app/Helper/App.php
+++ b/app/Helper/App.php
@@ -13,6 +13,30 @@ use Kanboard\Core\Base;
class App extends Base
{
/**
+ * Make sidebar menu active
+ *
+ * @access public
+ * @param string $controller
+ * @param string $action
+ * @param string $plugin
+ * @return string
+ */
+ public function checkMenuSelection($controller, $action = '', $plugin = '')
+ {
+ $result = strtolower($this->getRouterController()) === strtolower($controller);
+
+ if ($result && $action !== '') {
+ $result = strtolower($this->getRouterAction()) === strtolower($action);
+ }
+
+ if ($result && $plugin !== '') {
+ $result = strtolower($this->getPluginName()) === strtolower($plugin);
+ }
+
+ return $result ? 'class="active"' : '';
+ }
+
+ /**
* Get plugin name from route
*
* @access public