php-censor/src/PHPCensor/View/User/index.phtml

62 lines
2.8 KiB
PHTML
Raw Normal View History

2016-07-19 20:28:11 +02:00
<?php use PHPCensor\Helper\Lang; ?>
<div class="clearfix" style="margin-bottom: 20px;">
<div class="pull-right btn-group">
2016-07-21 17:20:34 +02:00
<a class="btn btn-primary" href="<?php print APP_URL; ?>user/add"><?php Lang::out('add_user'); ?></a>
</div>
2013-05-10 17:25:51 +02:00
</div>
<div class="row">
<div class="col-xs-12">
<div class="box box-primary">
2014-04-30 15:13:07 +02:00
<table class="table">
<thead>
<tr>
2014-12-04 15:30:43 +01:00
<th><?php Lang::out('email_address'); ?></th>
<th><?php Lang::out('name'); ?></th>
<th><?php Lang::out('is_admin'); ?></th>
<th style="width: 100px"></th>
</tr>
</thead>
<tbody id="users">
<?php foreach($users['items'] as $user): ?>
<?php
switch($user->getIsAdmin())
{
case 0:
$cls = '';
2014-12-04 15:30:43 +01:00
$status = Lang::get('no');
break;
case 1:
$cls = 'warning';
2014-12-04 15:30:43 +01:00
$status = Lang::get('yes');
break;
}
?>
<tr class="<?php print $cls; ?>">
2016-07-21 17:20:34 +02:00
<td><a href="<?php echo APP_URL ?>user/edit/<?php print $user->getId(); ?>"><?php print $user->getEmail(); ?></a></td>
<td><?php print htmlspecialchars($user->getName()); ?></td>
<td><?php print $status; ?></td>
<td>
<?php if($this->User()->getIsAdmin()): ?>
2015-10-09 12:10:14 +02:00
<div class="btn-group pull-right">
2016-07-21 17:20:34 +02:00
<a class="btn btn-default btn-small" href="<?php echo APP_URL ?>user/edit/<?php print $user->getId(); ?>"><?php Lang::out('edit'); ?></a>
<button class="btn btn-default btn-small dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
2016-07-21 19:02:11 +02:00
<li><a href="<?php echo APP_URL ?>user/delete/<?php print $user->getId(); ?>" class="app-delete-user"><?php Lang::out('delete_user'); ?></a></li>
</ul>
</div>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
2013-05-10 17:25:51 +02:00
</div>
</div>