summaryrefslogtreecommitdiff
path: root/app/Template/user
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-12-28 11:28:50 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-12-28 11:28:50 -0500
commit34d7450d3c13342715e90ec21bceaa13e1baa876 (patch)
treea2d8f2f22ad3fe9b56f01fe2db0357f9b963e660 /app/Template/user
parent88d84073aecbe8bdc5f10825b6d7ca6b81c5f7b1 (diff)
Template helpers refactoring
Diffstat (limited to 'app/Template/user')
-rw-r--r--app/Template/user/edit.php30
-rw-r--r--app/Template/user/external.php12
-rw-r--r--app/Template/user/index.php32
-rw-r--r--app/Template/user/last.php6
-rw-r--r--app/Template/user/layout.php8
-rw-r--r--app/Template/user/login.php20
-rw-r--r--app/Template/user/new.php34
-rw-r--r--app/Template/user/notifications.php10
-rw-r--r--app/Template/user/password.php20
-rw-r--r--app/Template/user/remove.php4
-rw-r--r--app/Template/user/sessions.php6
-rw-r--r--app/Template/user/show.php8
-rw-r--r--app/Template/user/sidebar.php20
13 files changed, 105 insertions, 105 deletions
diff --git a/app/Template/user/edit.php b/app/Template/user/edit.php
index bc942567..6766f952 100644
--- a/app/Template/user/edit.php
+++ b/app/Template/user/edit.php
@@ -1,32 +1,32 @@
<div class="page-header">
<h2><?= t('Edit user') ?></h2>
</div>
-<form method="post" action="<?= Helper\u('user', 'edit', array('user_id' => $user['id'])) ?>" autocomplete="off">
+<form method="post" action="<?= $this->u('user', 'edit', array('user_id' => $user['id'])) ?>" autocomplete="off">
- <?= Helper\form_csrf() ?>
+ <?= $this->formCsrf() ?>
- <?= Helper\form_hidden('id', $values) ?>
- <?= Helper\form_hidden('is_ldap_user', $values) ?>
+ <?= $this->formHidden('id', $values) ?>
+ <?= $this->formHidden('is_ldap_user', $values) ?>
- <?= Helper\form_label(t('Username'), 'username') ?>
- <?= Helper\form_text('username', $values, $errors, array('required', $values['is_ldap_user'] == 1 ? 'readonly' : '')) ?><br/>
+ <?= $this->formLabel(t('Username'), 'username') ?>
+ <?= $this->formText('username', $values, $errors, array('required', $values['is_ldap_user'] == 1 ? 'readonly' : '')) ?><br/>
- <?= Helper\form_label(t('Name'), 'name') ?>
- <?= Helper\form_text('name', $values, $errors) ?><br/>
+ <?= $this->formLabel(t('Name'), 'name') ?>
+ <?= $this->formText('name', $values, $errors) ?><br/>
- <?= Helper\form_label(t('Email'), 'email') ?>
- <?= Helper\form_email('email', $values, $errors) ?><br/>
+ <?= $this->formLabel(t('Email'), 'email') ?>
+ <?= $this->formEmail('email', $values, $errors) ?><br/>
- <?= Helper\form_label(t('Default project'), 'default_project_id') ?>
- <?= Helper\form_select('default_project_id', $projects, $values, $errors) ?><br/>
+ <?= $this->formLabel(t('Default project'), 'default_project_id') ?>
+ <?= $this->formSelect('default_project_id', $projects, $values, $errors) ?><br/>
- <?php if (Helper\is_admin()): ?>
- <?= Helper\form_checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?><br/>
+ <?php if ($this->acl->isAdminUser()): ?>
+ <?= $this->formCheckbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?><br/>
<?php endif ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
- <?= Helper\a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
</div>
</form> \ No newline at end of file
diff --git a/app/Template/user/external.php b/app/Template/user/external.php
index 31ffcb75..6ee1e459 100644
--- a/app/Template/user/external.php
+++ b/app/Template/user/external.php
@@ -6,11 +6,11 @@
<h3><i class="fa fa-google"></i> <?= t('Google Account') ?></h3>
<p class="listing">
- <?php if (Helper\is_current_user($user['id'])): ?>
+ <?php if ($this->acl->isCurrentUser($user['id'])): ?>
<?php if (empty($user['google_id'])): ?>
- <?= Helper\a(t('Link my Google Account'), 'user', 'google', array(), true) ?>
+ <?= $this->a(t('Link my Google Account'), 'user', 'google', array(), true) ?>
<?php else: ?>
- <?= Helper\a(t('Unlink my Google Account'), 'user', 'unlinkGoogle', array(), true) ?>
+ <?= $this->a(t('Unlink my Google Account'), 'user', 'unlinkGoogle', array(), true) ?>
<?php endif ?>
<?php else: ?>
<?= empty($user['google_id']) ? t('No account linked.') : t('Account linked.') ?>
@@ -22,11 +22,11 @@
<h3><i class="fa fa-github"></i> <?= t('Github Account') ?></h3>
<p class="listing">
- <?php if (Helper\is_current_user($user['id'])): ?>
+ <?php if ($this->acl->isCurrentUser($user['id'])): ?>
<?php if (empty($user['github_id'])): ?>
- <?= Helper\a(t('Link my GitHub Account'), 'user', 'github', array(), true) ?>
+ <?= $this->a(t('Link my GitHub Account'), 'user', 'github', array(), true) ?>
<?php else: ?>
- <?= Helper\a(t('Unlink my GitHub Account'), 'user', 'unlinkGitHub', array(), true) ?>
+ <?= $this->a(t('Unlink my GitHub Account'), 'user', 'unlinkGitHub', array(), true) ?>
<?php endif ?>
<?php else: ?>
<?= empty($user['github_id']) ? t('No account linked.') : t('Account linked.') ?>
diff --git a/app/Template/user/index.php b/app/Template/user/index.php
index 73612b0b..a6da9f65 100644
--- a/app/Template/user/index.php
+++ b/app/Template/user/index.php
@@ -1,8 +1,8 @@
<section id="main">
<div class="page-header">
- <?php if (Helper\is_admin()): ?>
+ <?php if ($this->acl->isAdminUser()): ?>
<ul>
- <li><i class="fa fa-plus fa-fw"></i><?= Helper\a(t('New user'), 'user', 'create') ?></li>
+ <li><i class="fa fa-plus fa-fw"></i><?= $this->a(t('New user'), 'user', 'create') ?></li>
</ul>
<?php endif ?>
</div>
@@ -12,35 +12,35 @@
<?php else: ?>
<table>
<tr>
- <th><?= Helper\order(t('Id'), 'id', $pagination) ?></th>
- <th><?= Helper\order(t('Username'), 'username', $pagination) ?></th>
- <th><?= Helper\order(t('Name'), 'name', $pagination) ?></th>
- <th><?= Helper\order(t('Email'), 'email', $pagination) ?></th>
- <th><?= Helper\order(t('Administrator'), 'is_admin', $pagination) ?></th>
- <th><?= Helper\order(t('Default project'), 'default_project_id', $pagination) ?></th>
- <th><?= Helper\order(t('Notifications'), 'notifications_enabled', $pagination) ?></th>
+ <th><?= $this->order(t('Id'), 'id', $pagination) ?></th>
+ <th><?= $this->order(t('Username'), 'username', $pagination) ?></th>
+ <th><?= $this->order(t('Name'), 'name', $pagination) ?></th>
+ <th><?= $this->order(t('Email'), 'email', $pagination) ?></th>
+ <th><?= $this->order(t('Administrator'), 'is_admin', $pagination) ?></th>
+ <th><?= $this->order(t('Default project'), 'default_project_id', $pagination) ?></th>
+ <th><?= $this->order(t('Notifications'), 'notifications_enabled', $pagination) ?></th>
<th><?= t('External accounts') ?></th>
- <th><?= Helper\order(t('Account type'), 'is_ldap_user', $pagination) ?></th>
+ <th><?= $this->order(t('Account type'), 'is_ldap_user', $pagination) ?></th>
</tr>
<?php foreach ($users as $user): ?>
<tr>
<td>
- <?= Helper\a('#'.$user['id'], 'user', 'show', array('user_id' => $user['id'])) ?>
+ <?= $this->a('#'.$user['id'], 'user', 'show', array('user_id' => $user['id'])) ?>
</td>
<td>
- <?= Helper\a(Helper\escape($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?>
+ <?= $this->a($this->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?>
</td>
<td>
- <?= Helper\escape($user['name']) ?>
+ <?= $this->e($user['name']) ?>
</td>
<td>
- <a href="mailto:<?= Helper\escape($user['email']) ?>"><?= Helper\escape($user['email']) ?></a>
+ <a href="mailto:<?= $this->e($user['email']) ?>"><?= $this->e($user['email']) ?></a>
</td>
<td>
<?= $user['is_admin'] ? t('Yes') : t('No') ?>
</td>
<td>
- <?= (isset($user['default_project_id']) && isset($projects[$user['default_project_id']])) ? Helper\escape($projects[$user['default_project_id']]) : t('None'); ?>
+ <?= (isset($user['default_project_id']) && isset($projects[$user['default_project_id']])) ? $this->e($projects[$user['default_project_id']]) : t('None'); ?>
</td>
<td>
<?php if ($user['notifications_enabled'] == 1): ?>
@@ -66,7 +66,7 @@
<?php endforeach ?>
</table>
- <?= Helper\paginate($pagination) ?>
+ <?= $this->paginate($pagination) ?>
<?php endif ?>
</section>
</section>
diff --git a/app/Template/user/last.php b/app/Template/user/last.php
index 0b55b0d5..317334b8 100644
--- a/app/Template/user/last.php
+++ b/app/Template/user/last.php
@@ -15,9 +15,9 @@
<?php foreach($last_logins as $login): ?>
<tr>
<td><?= dt('%B %e, %Y at %k:%M %p', $login['date_creation']) ?></td>
- <td><?= Helper\escape($login['auth_type']) ?></td>
- <td><?= Helper\escape($login['ip']) ?></td>
- <td><?= Helper\escape(Helper\summary($login['user_agent'])) ?></td>
+ <td><?= $this->e($login['auth_type']) ?></td>
+ <td><?= $this->e($login['ip']) ?></td>
+ <td><?= $this->e($this->summary($login['user_agent'])) ?></td>
</tr>
<?php endforeach ?>
</table>
diff --git a/app/Template/user/layout.php b/app/Template/user/layout.php
index 0778b716..94610000 100644
--- a/app/Template/user/layout.php
+++ b/app/Template/user/layout.php
@@ -1,15 +1,15 @@
<section id="main">
<div class="page-header">
- <?php if (Helper\is_admin()): ?>
+ <?php if ($this->acl->isAdminUser()): ?>
<ul>
- <li><i class="fa fa-user fa-fw"></i><?= Helper\a(t('All users'), 'user', 'index') ?></li>
- <li><i class="fa fa-plus fa-fw"></i><?= Helper\a(t('New user'), 'user', 'create') ?></li>
+ <li><i class="fa fa-user fa-fw"></i><?= $this->a(t('All users'), 'user', 'index') ?></li>
+ <li><i class="fa fa-plus fa-fw"></i><?= $this->a(t('New user'), 'user', 'create') ?></li>
</ul>
<?php endif ?>
</div>
<section class="sidebar-container" id="user-section">
- <?= Helper\template('user/sidebar', array('user' => $user)) ?>
+ <?= $this->render('user/sidebar', array('user' => $user)) ?>
<div class="sidebar-content">
<?= $user_content_for_layout ?>
diff --git a/app/Template/user/login.php b/app/Template/user/login.php
index fea44a01..c2e3914e 100644
--- a/app/Template/user/login.php
+++ b/app/Template/user/login.php
@@ -1,27 +1,27 @@
<div class="form-login">
<?php if (isset($errors['login'])): ?>
- <p class="alert alert-error"><?= Helper\escape($errors['login']) ?></p>
+ <p class="alert alert-error"><?= $this->e($errors['login']) ?></p>
<?php endif ?>
- <form method="post" action="<?= Helper\u('user', 'check', array('redirect_query' => urlencode($redirect_query))) ?>">
+ <form method="post" action="<?= $this->u('user', 'check', array('redirect_query' => urlencode($redirect_query))) ?>">
- <?= Helper\form_csrf() ?>
+ <?= $this->formCsrf() ?>
- <?= Helper\form_label(t('Username'), 'username') ?>
- <?= Helper\form_text('username', $values, $errors, array('autofocus', 'required')) ?><br/>
+ <?= $this->formLabel(t('Username'), 'username') ?>
+ <?= $this->formText('username', $values, $errors, array('autofocus', 'required')) ?><br/>
- <?= Helper\form_label(t('Password'), 'password') ?>
- <?= Helper\form_password('password', $values, $errors, array('required')) ?>
+ <?= $this->formLabel(t('Password'), 'password') ?>
+ <?= $this->formPassword('password', $values, $errors, array('required')) ?>
- <?= Helper\form_checkbox('remember_me', t('Remember Me'), 1) ?><br/>
+ <?= $this->formCheckbox('remember_me', t('Remember Me'), 1) ?><br/>
<?php if (GOOGLE_AUTH): ?>
- <?= Helper\a(t('Login with my Google Account'), 'user', 'google') ?>
+ <?= $this->a(t('Login with my Google Account'), 'user', 'google') ?>
<?php endif ?>
<?php if (GITHUB_AUTH): ?>
- <?= Helper\a(t('Login with my GitHub Account'), 'user', 'gitHub') ?>
+ <?= $this->a(t('Login with my GitHub Account'), 'user', 'gitHub') ?>
<?php endif ?>
<div class="form-actions">
diff --git a/app/Template/user/new.php b/app/Template/user/new.php
index af5824e0..a720d1a1 100644
--- a/app/Template/user/new.php
+++ b/app/Template/user/new.php
@@ -1,38 +1,38 @@
<section id="main">
<div class="page-header">
<ul>
- <li><i class="fa fa-user fa-fw"></i><?= Helper\a(t('All users'), 'user', 'index') ?></li>
+ <li><i class="fa fa-user fa-fw"></i><?= $this->a(t('All users'), 'user', 'index') ?></li>
</ul>
</div>
<section>
- <form method="post" action="<?= Helper\u('user', 'save') ?>" autocomplete="off">
+ <form method="post" action="<?= $this->u('user', 'save') ?>" autocomplete="off">
- <?= Helper\form_csrf() ?>
+ <?= $this->formCsrf() ?>
- <?= Helper\form_label(t('Username'), 'username') ?>
- <?= Helper\form_text('username', $values, $errors, array('autofocus', 'required')) ?><br/>
+ <?= $this->formLabel(t('Username'), 'username') ?>
+ <?= $this->formText('username', $values, $errors, array('autofocus', 'required')) ?><br/>
- <?= Helper\form_label(t('Name'), 'name') ?>
- <?= Helper\form_text('name', $values, $errors) ?><br/>
+ <?= $this->formLabel(t('Name'), 'name') ?>
+ <?= $this->formText('name', $values, $errors) ?><br/>
- <?= Helper\form_label(t('Email'), 'email') ?>
- <?= Helper\form_email('email', $values, $errors) ?><br/>
+ <?= $this->formLabel(t('Email'), 'email') ?>
+ <?= $this->formEmail('email', $values, $errors) ?><br/>
- <?= Helper\form_label(t('Password'), 'password') ?>
- <?= Helper\form_password('password', $values, $errors, array('required')) ?><br/>
+ <?= $this->formLabel(t('Password'), 'password') ?>
+ <?= $this->formPassword('password', $values, $errors, array('required')) ?><br/>
- <?= Helper\form_label(t('Confirmation'), 'confirmation') ?>
- <?= Helper\form_password('confirmation', $values, $errors, array('required')) ?><br/>
+ <?= $this->formLabel(t('Confirmation'), 'confirmation') ?>
+ <?= $this->formPassword('confirmation', $values, $errors, array('required')) ?><br/>
- <?= Helper\form_label(t('Default project'), 'default_project_id') ?>
- <?= Helper\form_select('default_project_id', $projects, $values, $errors) ?><br/>
+ <?= $this->formLabel(t('Default project'), 'default_project_id') ?>
+ <?= $this->formSelect('default_project_id', $projects, $values, $errors) ?><br/>
- <?= Helper\form_checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?>
+ <?= $this->formCheckbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
- <?= Helper\a(t('cancel'), 'user', 'index') ?>
+ <?= $this->a(t('cancel'), 'user', 'index') ?>
</div>
</form>
</section>
diff --git a/app/Template/user/notifications.php b/app/Template/user/notifications.php
index 33da61fb..56c48f8f 100644
--- a/app/Template/user/notifications.php
+++ b/app/Template/user/notifications.php
@@ -2,18 +2,18 @@
<h2><?= t('Email notifications') ?></h2>
</div>
-<form method="post" action="<?= Helper\u('user', 'notifications', array('user_id' => $user['id'])) ?>" autocomplete="off">
+<form method="post" action="<?= $this->u('user', 'notifications', array('user_id' => $user['id'])) ?>" autocomplete="off">
- <?= Helper\form_csrf() ?>
+ <?= $this->formCsrf() ?>
- <?= Helper\form_checkbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?><br/>
+ <?= $this->formCheckbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?><br/>
<?php if (! empty($projects)): ?>
<p><?= t('I want to receive notifications only for those projects:') ?><br/><br/></p>
<div class="form-checkbox-group">
<?php foreach ($projects as $project_id => $project_name): ?>
- <?= Helper\form_checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?><br/>
+ <?= $this->formCheckbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?><br/>
<?php endforeach ?>
</div>
<?php endif ?>
@@ -21,6 +21,6 @@
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
- <?= Helper\a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
</div>
</form> \ No newline at end of file
diff --git a/app/Template/user/password.php b/app/Template/user/password.php
index 76e0ab15..14de0d42 100644
--- a/app/Template/user/password.php
+++ b/app/Template/user/password.php
@@ -2,25 +2,25 @@
<h2><?= t('Password modification') ?></h2>
</div>
-<form method="post" action="<?= Helper\u('user', 'password', array('user_id' => $user['id'])) ?>" autocomplete="off">
+<form method="post" action="<?= $this->u('user', 'password', array('user_id' => $user['id'])) ?>" autocomplete="off">
- <?= Helper\form_hidden('id', $values) ?>
- <?= Helper\form_csrf() ?>
+ <?= $this->formHidden('id', $values) ?>
+ <?= $this->formCsrf() ?>
<div class="alert alert-error">
- <?= Helper\form_label(t('Current password for the user "%s"', Helper\get_username()), 'current_password') ?>
- <?= Helper\form_password('current_password', $values, $errors) ?><br/>
+ <?= $this->formLabel(t('Current password for the user "%s"', $this->getFullname()), 'current_password') ?>
+ <?= $this->formPassword('current_password', $values, $errors) ?><br/>
</div>
- <?= Helper\form_label(t('New password for the user "%s"', Helper\get_username($user)), 'password') ?>
- <?= Helper\form_password('password', $values, $errors) ?><br/>
+ <?= $this->formLabel(t('New password for the user "%s"', $this->getFullname($user)), 'password') ?>
+ <?= $this->formPassword('password', $values, $errors) ?><br/>
- <?= Helper\form_label(t('Confirmation'), 'confirmation') ?>
- <?= Helper\form_password('confirmation', $values, $errors) ?><br/>
+ <?= $this->formLabel(t('Confirmation'), 'confirmation') ?>
+ <?= $this->formPassword('confirmation', $values, $errors) ?><br/>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
- <?= Helper\a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
</div>
</form>
diff --git a/app/Template/user/remove.php b/app/Template/user/remove.php
index 5f58b631..e4b09cfa 100644
--- a/app/Template/user/remove.php
+++ b/app/Template/user/remove.php
@@ -6,8 +6,8 @@
<p class="alert alert-info"><?= t('Do you really want to remove this user: "%s"?', $user['name'] ?: $user['username']) ?></p>
<div class="form-actions">
- <?= Helper\a(t('Yes'), 'user', 'remove', array('user_id' => $user['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?>
+ <?= $this->a(t('Yes'), 'user', 'remove', array('user_id' => $user['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?>
<?= t('or') ?>
- <?= Helper\a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
</div>
</div> \ No newline at end of file
diff --git a/app/Template/user/sessions.php b/app/Template/user/sessions.php
index d05d5b6d..5a06057c 100644
--- a/app/Template/user/sessions.php
+++ b/app/Template/user/sessions.php
@@ -17,9 +17,9 @@
<tr>
<td><?= dt('%B %e, %Y at %k:%M %p', $session['date_creation']) ?></td>
<td><?= dt('%B %e, %Y at %k:%M %p', $session['expiration']) ?></td>
- <td><?= Helper\escape($session['ip']) ?></td>
- <td><?= Helper\escape(Helper\summary($session['user_agent'])) ?></td>
- <td><?= Helper\a(t('Remove'), 'user', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?></td>
+ <td><?= $this->e($session['ip']) ?></td>
+ <td><?= $this->e($this->summary($session['user_agent'])) ?></td>
+ <td><?= $this->a(t('Remove'), 'user', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?></td>
</tr>
<?php endforeach ?>
</table>
diff --git a/app/Template/user/show.php b/app/Template/user/show.php
index 1c843751..f65be260 100644
--- a/app/Template/user/show.php
+++ b/app/Template/user/show.php
@@ -2,10 +2,10 @@
<h2><?= t('Summary') ?></h2>
</div>
<ul class="listing">
- <li><?= t('Username:') ?> <strong><?= Helper\escape($user['username']) ?></strong></li>
- <li><?= t('Name:') ?> <strong><?= Helper\escape($user['name']) ?></strong></li>
- <li><?= t('Email:') ?> <strong><?= Helper\escape($user['email']) ?></strong></li>
- <li><?= t('Default project:') ?> <strong><?= (isset($user['default_project_id']) && isset($projects[$user['default_project_id']])) ? Helper\escape($projects[$user['default_project_id']]) : t('None'); ?></strong></li>
+ <li><?= t('Username:') ?> <strong><?= $this->e($user['username']) ?></strong></li>
+ <li><?= t('Name:') ?> <strong><?= $this->e($user['name']) ?></strong></li>
+ <li><?= t('Email:') ?> <strong><?= $this->e($user['email']) ?></strong></li>
+ <li><?= t('Default project:') ?> <strong><?= (isset($user['default_project_id']) && isset($projects[$user['default_project_id']])) ? $this->e($projects[$user['default_project_id']]) : t('None'); ?></strong></li>
<li><?= t('Notifications:') ?> <strong><?= $user['notifications_enabled'] == 1 ? t('Enabled') : t('Disabled') ?></strong></li>
<li><?= t('Group:') ?> <strong><?= $user['is_admin'] ? t('Administrator') : t('Regular user') ?></strong></li>
<li><?= t('Account type:') ?> <strong><?= $user['is_ldap_user'] ? t('Remote') : t('Local') ?></strong></li>
diff --git a/app/Template/user/sidebar.php b/app/Template/user/sidebar.php
index 0a1a0764..5b7abc34 100644
--- a/app/Template/user/sidebar.php
+++ b/app/Template/user/sidebar.php
@@ -2,37 +2,37 @@
<h2><?= t('Actions') ?></h2>
<ul>
<li>
- <?= Helper\a(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?>
</li>
- <?php if (Helper\is_admin() || Helper\is_current_user($user['id'])): ?>
+ <?php if ($this->acl->isAdminUser() || $this->acl->isCurrentUser($user['id'])): ?>
<li>
- <?= Helper\a(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?>
</li>
<?php if ($user['is_ldap_user'] == 0): ?>
<li>
- <?= Helper\a(t('Change password'), 'user', 'password', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('Change password'), 'user', 'password', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>
<li>
- <?= Helper\a(t('Email notifications'), 'user', 'notifications', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('Email notifications'), 'user', 'notifications', array('user_id' => $user['id'])) ?>
</li>
<li>
- <?= Helper\a(t('External accounts'), 'user', 'external', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('External accounts'), 'user', 'external', array('user_id' => $user['id'])) ?>
</li>
<li>
- <?= Helper\a(t('Last logins'), 'user', 'last', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('Last logins'), 'user', 'last', array('user_id' => $user['id'])) ?>
</li>
<li>
- <?= Helper\a(t('Persistent connections'), 'user', 'sessions', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('Persistent connections'), 'user', 'sessions', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>
- <?php if (Helper\is_admin() && ! Helper\is_current_user($user['id'])): ?>
+ <?php if ($this->acl->isAdminUser() && ! $this->acl->isCurrentUser($user['id'])): ?>
<li>
- <?= Helper\a(t('Remove'), 'user', 'remove', array('user_id' => $user['id'])) ?>
+ <?= $this->a(t('Remove'), 'user', 'remove', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>
</ul>