summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Controller/Projectuser.php2
-rw-r--r--app/Core/Router.php41
-rw-r--r--app/Helper/App.php22
-rw-r--r--app/Template/analytic/sidebar.php12
-rw-r--r--app/Template/app/sidebar.php12
-rw-r--r--app/Template/category/edit.php2
-rw-r--r--app/Template/column/edit.php2
-rw-r--r--app/Template/config/sidebar.php20
-rw-r--r--app/Template/project/sidebar.php24
-rw-r--r--app/Template/project_user/layout.php2
-rw-r--r--app/Template/project_user/sidebar.php10
-rw-r--r--app/Template/swimlane/edit.php2
-rw-r--r--app/Template/task/sidebar.php36
-rw-r--r--app/Template/user/sidebar.php30
14 files changed, 142 insertions, 75 deletions
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
@@ -11,6 +11,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
*
* @access private
@@ -27,6 +43,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
*
* @access public
@@ -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
@@ -11,6 +11,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
*
* @access public
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 @@
<div class="sidebar">
<h2><?= t('Reportings') ?></h2>
<ul>
- <li>
+ <li <?= $this->app->getRouterAction() === 'tasks' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Task distribution'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'users' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('User repartition'), 'analytic', 'users', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'cfd' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Cumulative flow diagram'), 'analytic', 'cfd', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'burndown' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Burndown chart'), 'analytic', 'burndown', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'averagetimebycolumn' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Average time into each column'), 'analytic', 'averageTimeByColumn', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'leadandcycletime' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Lead and cycle time'), 'analytic', 'leadAndCycleTime', array('project_id' => $project['id'])) ?>
</li>
</ul>
diff --git a/app/Template/app/sidebar.php b/app/Template/app/sidebar.php
index 4cace15a..2d966009 100644
--- a/app/Template/app/sidebar.php
+++ b/app/Template/app/sidebar.php
@@ -1,22 +1,22 @@
<div class="sidebar">
<h2><?= $this->e($user['name'] ?: $user['username']) ?></h2>
<ul>
- <li>
+ <li <?= $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Overview'), 'app', 'index', array('user_id' => $user['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'projects' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('My projects'), 'app', 'projects', array('user_id' => $user['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'tasks' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('My tasks'), 'app', 'tasks', array('user_id' => $user['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'subtasks' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('My subtasks'), 'app', 'subtasks', array('user_id' => $user['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'calendar' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('My calendar'), 'app', 'calendar', array('user_id' => $user['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'activity' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('My activity stream'), 'app', 'activity', array('user_id' => $user['id'])) ?>
</li>
</ul>
diff --git a/app/Template/category/edit.php b/app/Template/category/edit.php
index 7d40fe65..f844eea4 100644
--- a/app/Template/category/edit.php
+++ b/app/Template/category/edit.php
@@ -34,5 +34,7 @@
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ <?= t('or') ?>
+ <?= $this->url->link(t('cancel'), 'category', 'index', array('project_id' => $project['id'])) ?>
</div>
</form> \ No newline at end of file
diff --git a/app/Template/column/edit.php b/app/Template/column/edit.php
index 4d9848a9..691cff00 100644
--- a/app/Template/column/edit.php
+++ b/app/Template/column/edit.php
@@ -38,5 +38,7 @@
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ <?= t('or') ?>
+ <?= $this->url->link(t('cancel'), 'column', 'index', array('project_id' => $project['id'])) ?>
</div>
</form> \ No newline at end of file
diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php
index 05ec4094..b2c73292 100644
--- a/app/Template/config/sidebar.php
+++ b/app/Template/config/sidebar.php
@@ -1,34 +1,34 @@
<div class="sidebar">
<h2><?= t('Actions') ?></h2>
<ul>
- <li>
+ <li <?= $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('About'), 'config', 'index') ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'application' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Application settings'), 'config', 'application') ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'project' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Project settings'), 'config', 'project') ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'board' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Board settings'), 'config', 'board') ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'calendar' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Calendar settings'), 'config', 'calendar') ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'link' && $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Link settings'), 'link', 'index') ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'currency' && $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Currency rates'), 'currency', 'index') ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'integrations' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Integrations'), 'config', 'integrations') ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'webhook' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Webhooks'), 'config', 'webhook') ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'api' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('API'), 'config', 'api') ?>
</li>
</ul>
diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php
index d6f7db97..7b5d976f 100644
--- a/app/Template/project/sidebar.php
+++ b/app/Template/project/sidebar.php
@@ -1,41 +1,41 @@
<div class="sidebar">
<h2><?= t('Actions') ?></h2>
<ul>
- <li>
+ <li <?= $this->app->getRouterAction() === 'show' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php if ($this->user->isProjectManagementAllowed($project['id'])): ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'share' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'integration' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Integrations'), 'project', 'integration', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'edit' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Edit project'), 'project', 'edit', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'column' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Columns'), 'column', 'index', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'swimlane' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Swimlanes'), 'swimlane', 'index', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'category' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Categories'), 'category', 'index', array('project_id' => $project['id'])) ?>
</li>
<?php if ($this->user->isAdmin() || $project['is_private'] == 0): ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'users' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Users'), 'project', 'users', array('project_id' => $project['id'])) ?>
</li>
<?php endif ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'action' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'duplicate' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'project' && ($this->app->getRouterAction() === 'disable' || $this->app->getRouterAction() === 'enable') ? 'class="active"' : '' ?>>
<?php if ($project['is_active']): ?>
<?= $this->url->link(t('Disable'), 'project', 'disable', array('project_id' => $project['id']), true) ?>
<?php else: ?>
@@ -43,7 +43,7 @@
<?php endif ?>
</li>
<?php if ($this->user->isProjectAdministrationAllowed($project['id'])): ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'remove' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?>
</li>
<?php endif ?>
diff --git a/app/Template/project_user/layout.php b/app/Template/project_user/layout.php
index 23486cb7..a68fc579 100644
--- a/app/Template/project_user/layout.php
+++ b/app/Template/project_user/layout.php
@@ -16,7 +16,7 @@
</div>
<section class="sidebar-container">
- <?= $this->render('project_user/sidebar', array('users' => $users, 'action' => $action, 'filter' => $filter)) ?>
+ <?= $this->render('project_user/sidebar', array('users' => $users, 'filter' => $filter)) ?>
<div class="sidebar-content">
<div class="page-header">
diff --git a/app/Template/project_user/sidebar.php b/app/Template/project_user/sidebar.php
index f57323d5..8cc3f41b 100644
--- a/app/Template/project_user/sidebar.php
+++ b/app/Template/project_user/sidebar.php
@@ -6,22 +6,22 @@
$users,
$filter,
array(),
- array('data-redirect-url="'.$this->url->href('projectuser', $action, array('user_id' => 'USER_ID')).'"', 'data-redirect-regex="USER_ID"'),
+ array('data-redirect-url="'.$this->url->href('projectuser', $this->app->getRouterAction(), array('user_id' => 'USER_ID')).'"', 'data-redirect-regex="USER_ID"'),
'chosen-select select-auto-redirect'
) ?>
<br/><br/>
<ul>
- <li>
+ <li <?= $this->app->getRouterAction() === 'managers' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Project managers'), 'projectuser', 'managers', $filter) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'members' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Project members'), 'projectuser', 'members', $filter) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'opens' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Open tasks'), 'projectuser', 'opens', $filter) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterAction() === 'closed' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Closed tasks'), 'projectuser', 'closed', $filter) ?>
</li>
</ul>
diff --git a/app/Template/swimlane/edit.php b/app/Template/swimlane/edit.php
index cc98b584..1788fed2 100644
--- a/app/Template/swimlane/edit.php
+++ b/app/Template/swimlane/edit.php
@@ -14,5 +14,7 @@
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ <?= t('or') ?>
+ <?= $this->url->link(t('cancel'), 'swimlane', 'index', array('project_id' => $project['id'])) ?>
</div>
</form> \ No newline at end of file
diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php
index 1116040a..1f06ab8c 100644
--- a/app/Template/task/sidebar.php
+++ b/app/Template/task/sidebar.php
@@ -1,60 +1,60 @@
<div class="sidebar">
<h2><?= t('Information') ?></h2>
<ul>
- <li>
+ <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'show' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Summary'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'activity' && $this->app->getRouterAction() === 'task' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Activity stream'), 'activity', 'task', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'transitions' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Transitions'), 'task', 'transitions', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'analytics' ? 'class="active"' : '' ?>>
<?= $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>
+ <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'timetracking' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Time tracking'), 'task', 'timetracking', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<?php endif ?>
</ul>
<h2><?= t('Actions') ?></h2>
<ul>
- <li>
+ <li <?= $this->app->getRouterController() === 'taskmodification' && $this->app->getRouterAction() === 'edit' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Edit the task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'taskmodification' && $this->app->getRouterAction() === 'description' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Edit the description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'taskmodification' && $this->app->getRouterAction() === 'recurrence' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Edit recurrence'), 'taskmodification', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'subtask' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'tasklink' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'comment' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'file' && $this->app->getRouterAction() === 'create' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Attach a document'), 'file', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'file' && $this->app->getRouterAction() === 'screenshot' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Add a screenshot'), 'file', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'taskduplication' && $this->app->getRouterAction() === 'duplicate' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Duplicate'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'taskduplication' && $this->app->getRouterAction() === 'copy' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Duplicate to another project'), 'taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'taskduplication' && $this->app->getRouterAction() === 'move' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Move to another project'), 'taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'taskstatus' ? 'class="active"' : '' ?>>
<?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: ?>
@@ -62,7 +62,7 @@
<?php endif ?>
</li>
<?php if ($this->task->canRemove($task)): ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'task' && $this->app->getRouterAction() === 'remove' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</li>
<?php endif ?>
diff --git a/app/Template/user/sidebar.php b/app/Template/user/sidebar.php
index 213b3209..cd1c85c1 100644
--- a/app/Template/user/sidebar.php
+++ b/app/Template/user/sidebar.php
@@ -1,7 +1,7 @@
<div class="sidebar">
<h2><?= t('Information') ?></h2>
<ul>
- <li>
+ <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'show' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?>
</li>
<?php if ($this->user->isAdmin()): ?>
@@ -10,13 +10,13 @@
</li>
<?php endif ?>
<?php if ($this->user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'timesheet' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Time tracking'), 'user', 'timesheet', array('user_id' => $user['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'last' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Last logins'), 'user', 'last', array('user_id' => $user['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'sessions' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Persistent connections'), 'user', 'sessions', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>
@@ -25,51 +25,51 @@
<h2><?= t('Actions') ?></h2>
<ul>
<?php if ($this->user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'edit' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?>
</li>
<?php if ($user['is_ldap_user'] == 0): ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'password' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Change password'), 'user', 'password', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>
<?php if ($this->user->isCurrentUser($user['id'])): ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'twofactor' && $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Two factor authentication'), 'twofactor', 'index', array('user_id' => $user['id'])) ?>
</li>
<?php elseif ($this->user->isAdmin() && $user['twofactor_activated'] == 1): ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'twofactor' && $this->app->getRouterAction() === 'disable' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Two factor authentication'), 'twofactor', 'disable', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'share' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Public access'), 'user', 'share', array('user_id' => $user['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'notifications' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Email notifications'), 'user', 'notifications', array('user_id' => $user['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'external' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('External accounts'), 'user', 'external', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>
<?php if ($this->user->isAdmin()): ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'authentication' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Edit Authentication'), 'user', 'authentication', array('user_id' => $user['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'hourlyrate' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Hourly rates'), 'hourlyrate', 'index', array('user_id' => $user['id'])) ?>
</li>
- <li>
+ <li <?= $this->app->getRouterController() === 'timetable' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Manage timetable'), 'timetable', 'index', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>
<?php if ($this->user->isAdmin() && ! $this->user->isCurrentUser($user['id'])): ?>
- <li>
+ <li <?= $this->app->getRouterController() === 'user' && $this->app->getRouterAction() === 'remove' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Remove'), 'user', 'remove', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>