Template helpers refactoring
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user