diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-12-24 15:34:50 +0100 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-12-24 15:34:50 +0100 |
commit | 9ff0abd8d683ab5a285fcf70e27d1bcd1cbc47df (patch) | |
tree | d8680640f331ea8dec2fe3f6be55a66f3f986b84 /app/Template/task | |
parent | 4003b122d085b58ad7acb31bafa44121ed94c37f (diff) |
Update active menu in sidebars
Diffstat (limited to 'app/Template/task')
-rw-r--r-- | app/Template/task/sidebar.php | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index d994aad3..f522c1c4 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -1,20 +1,20 @@ <div class="sidebar"> <h2><?= t('Information') ?></h2> <ul> - <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'show' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('task', 'show') ?>> <?= $this->url->link(t('Summary'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'activity' && $this->app->getRouterAction() === 'task' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('activity', 'task') ?>> <?= $this->url->link(t('Activity stream'), 'activity', 'task', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'transitions' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('task', 'transitions') ?>> <?= $this->url->link(t('Transitions'), 'task', 'transitions', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'analytics' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('task', 'analytics') ?>> <?= $this->url->link(t('Analytics'), 'task', 'analytics', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <?php if ($task['time_estimated'] > 0 || $task['time_spent'] > 0): ?> - <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'timetracking' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('task', 'timetracking') ?>> <?= $this->url->link(t('Time tracking'), 'task', 'timetracking', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <?php endif ?> @@ -24,40 +24,40 @@ <?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?> <h2><?= t('Actions') ?></h2> <ul> - <li <?= $this->app->getRouterController() === 'taskmodification' && $this->app->getRouterAction() === 'edit' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('taskmodification', 'edit') ?>> <?= $this->url->link(t('Edit the task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'taskmodification' && $this->app->getRouterAction() === 'description' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('taskmodification', 'description') ?>> <?= $this->url->link(t('Edit the description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'taskmodification' && $this->app->getRouterAction() === 'recurrence' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('taskmodification', 'recurrence') ?>> <?= $this->url->link(t('Edit recurrence'), 'taskmodification', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'subtask' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('subtask', 'create') ?>> <?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'tasklink' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('tasklink', 'create') ?>> <?= $this->url->link(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'comment' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('comment', 'create') ?>> <?= $this->url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'file' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('file', 'create') ?>> <?= $this->url->link(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'file' && $this->app->getRouterAction() === 'screenshot' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('file', 'screenshot') ?>> <?= $this->url->link(t('Add a screenshot'), 'file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'taskduplication' && $this->app->getRouterAction() === 'duplicate' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('taskduplication', 'duplicate') ?>> <?= $this->url->link(t('Duplicate'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'taskduplication' && $this->app->getRouterAction() === 'copy' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('taskduplication', 'copy') ?>> <?= $this->url->link(t('Duplicate to another project'), 'taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'taskduplication' && $this->app->getRouterAction() === 'move' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('taskduplication', 'move') ?>> <?= $this->url->link(t('Move to another project'), 'taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> - <li <?= $this->app->getRouterController() === 'taskstatus' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('taskstatus') ?>> <?php if ($task['is_active'] == 1): ?> <?= $this->url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?php else: ?> @@ -65,7 +65,7 @@ <?php endif ?> </li> <?php if ($this->task->canRemove($task)): ?> - <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'remove' ? 'class="active"' : '' ?>> + <li <?= $this->app->checkMenuSelection('task', 'remove') ?>> <?= $this->url->link(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> </li> <?php endif ?> |