User: Use $query->hasResult() instead of $query->count()

refs #9632
This commit is contained in:
Johannes Meyer 2015-08-03 16:28:43 +02:00
parent 3b36009122
commit 7bd8b4b19a

View File

@ -52,7 +52,12 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
<?php endif ?> <?php endif ?>
</div> </div>
<div class="content memberships"> <div class="content memberships">
<?php if (count($memberships) > 0): ?> <?php
$firstRow = true;
foreach ($memberships as $membership): ?>
<?php if ($firstRow): ?>
<?php $firstRow = false; ?>
<table data-base-target="_next" class="action membership-list alternating"> <table data-base-target="_next" class="action membership-list alternating">
<thead> <thead>
<tr> <tr>
@ -61,7 +66,7 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($memberships as $membership): ?> <?php endif ?>
<tr> <tr>
<td class="membership-group"> <td class="membership-group">
<?php if ($this->hasPermission('config/authentication/groups/show') && $membership->backend instanceof Selectable): ?> <?php if ($this->hasPermission('config/authentication/groups/show') && $membership->backend instanceof Selectable): ?>
@ -86,7 +91,8 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
<?php endif ?> <?php endif ?>
</td> </td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
<?php if ($memberships->hasResult()): ?>
</tbody> </tbody>
</table> </table>
<?php else: ?> <?php else: ?>