summaryrefslogtreecommitdiff
path: root/app/Template/project/sidebar.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-12-24 15:34:50 +0100
committerFrederic Guillot <fred@kanboard.net>2015-12-24 15:34:50 +0100
commit9ff0abd8d683ab5a285fcf70e27d1bcd1cbc47df (patch)
treed8680640f331ea8dec2fe3f6be55a66f3f986b84 /app/Template/project/sidebar.php
parent4003b122d085b58ad7acb31bafa44121ed94c37f (diff)
Update active menu in sidebars
Diffstat (limited to 'app/Template/project/sidebar.php')
-rw-r--r--app/Template/project/sidebar.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php
index 92794038..025c410d 100644
--- a/app/Template/project/sidebar.php
+++ b/app/Template/project/sidebar.php
@@ -1,60 +1,61 @@
<div class="sidebar">
<h2><?= t('Actions') ?></h2>
<ul>
- <li <?= $this->app->getRouterAction() === 'show' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('project', 'show') ?>>
<?= $this->url->link(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php if ($this->user->hasProjectAccess('customfilter', 'index', $project['id'])): ?>
- <li <?= $this->app->getRouterController() === 'customfilter' && $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('customfilter') ?>>
<?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?>
</li>
<?php endif ?>
<?php if ($this->user->hasProjectAccess('project', 'edit', $project['id'])): ?>
- <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'share' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('project', 'share') ?>>
<?= $this->url->link(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?>
</li>
- <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'notifications' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('project', 'notifications') ?>>
<?= $this->url->link(t('Notifications'), 'project', 'notifications', array('project_id' => $project['id'])) ?>
</li>
- <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'integrations' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('project', 'integrations') ?>>
<?= $this->url->link(t('Integrations'), 'project', 'integrations', array('project_id' => $project['id'])) ?>
</li>
- <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'edit' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('project', 'edit') ?>>
<?= $this->url->link(t('Edit project'), 'project', 'edit', array('project_id' => $project['id'])) ?>
</li>
- <li <?= $this->app->getRouterController() === 'column' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('column') ?>>
<?= $this->url->link(t('Columns'), 'column', 'index', array('project_id' => $project['id'])) ?>
</li>
- <li <?= $this->app->getRouterController() === 'swimlane' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('swimlane') ?>>
<?= $this->url->link(t('Swimlanes'), 'swimlane', 'index', array('project_id' => $project['id'])) ?>
</li>
- <li <?= $this->app->getRouterController() === 'category' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('category') ?>>
<?= $this->url->link(t('Categories'), 'category', 'index', array('project_id' => $project['id'])) ?>
</li>
<?php if ($project['is_private'] == 0): ?>
- <li <?= $this->app->getRouterController() === 'ProjectPermission' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('ProjectPermission') ?>>
<?= $this->url->link(t('Permissions'), 'ProjectPermission', 'index', array('project_id' => $project['id'])) ?>
</li>
<?php endif ?>
- <li <?= $this->app->getRouterController() === 'action' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('action') ?>>
<?= $this->url->link(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?>
</li>
- <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'duplicate' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('project', 'duplicate') ?>>
<?= $this->url->link(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id'])) ?>
</li>
- <li <?= $this->app->getRouterController() === 'project' && ($this->app->getRouterAction() === 'disable' || $this->app->getRouterAction() === 'enable') ? 'class="active"' : '' ?>>
<?php if ($project['is_active']): ?>
+ <li <?= $this->app->checkMenuSelection('project', 'disable') ?>>
<?= $this->url->link(t('Disable'), 'project', 'disable', array('project_id' => $project['id']), true) ?>
<?php else: ?>
+ <li <?= $this->app->checkMenuSelection('project', 'enable') ?>>
<?= $this->url->link(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?>
<?php endif ?>
</li>
- <li <?= $this->app->getRouterController() === 'taskImport' && $this->app->getRouterAction() === 'step1' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('taskImport') ?>>
<?= $this->url->link(t('Import'), 'taskImport', 'step1', array('project_id' => $project['id'])) ?>
</li>
<?php if ($this->user->hasProjectAccess('project', 'remove', $project['id'])): ?>
- <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'remove' ? 'class="active"' : '' ?>>
+ <li <?= $this->app->checkMenuSelection('project', 'remove') ?>>
<?= $this->url->link(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?>
</li>
<?php endif ?>