admin_index.ctp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <div class="page index">
  2. <h2><?php echo __('Qurls');?></h2>
  3. <table class="list">
  4. <tr>
  5. <th><?php echo $this->Paginator->sort('url');?></th>
  6. <th><?php echo $this->Paginator->sort('used');?></th>
  7. <th><?php echo $this->Paginator->sort('last_used');?></th>
  8. <th><?php echo $this->Paginator->sort('created', null, ['direction' => 'desc']);?></th>
  9. <th class="actions"><?php echo __('Actions');?></th>
  10. </tr>
  11. <?php
  12. $i = 0;
  13. foreach ($qurls as $qurl): ?>
  14. <tr>
  15. <td>
  16. <?php
  17. $url = $qurl['Qurl']['url'];
  18. if (strpos($url, $baseUrl = Router::url('/', true)) === 0) {
  19. $url = substr($url, strlen($baseUrl));
  20. if (strpos($url, '/') !== 0) {
  21. $url = '/'.$url;
  22. }
  23. }
  24. echo $url; ?>
  25. <div><code><?php echo Qurl::urlByKey($qurl['Qurl']['key'], $qurl['Qurl']['title']); ?></code></div>
  26. <?php if ($qurl['Qurl']['comment']) { ?>
  27. <small><?php echo h($qurl['Qurl']['comment']); ?></small>
  28. <?php } ?>
  29. </td>
  30. <td>
  31. <?php echo h($qurl['Qurl']['used']); ?>
  32. <div><?php echo $this->Format->yesNo($qurl['Qurl']['active'], ['onTitle' => __('Active'), 'offTitle' => __('Inactive')]); ?></div>
  33. </td>
  34. <td>
  35. <?php echo $this->Datetime->niceDate($qurl['Qurl']['last_used']); ?>
  36. </td>
  37. <td>
  38. <?php echo $this->Datetime->niceDate($qurl['Qurl']['created']); ?>
  39. </td>
  40. <td class="actions">
  41. <?php echo $this->Html->link($this->Format->icon('add', 'Als Vorlage verwenden'), ['action'=>'add', $qurl['Qurl']['id']], ['escape'=>false]); ?>
  42. <?php echo $this->Html->link($this->Format->icon('view'), ['action'=>'view', $qurl['Qurl']['id']], ['escape'=>false]); ?>
  43. <?php echo $this->Html->link($this->Format->icon('edit'), ['action'=>'edit', $qurl['Qurl']['id']], ['escape'=>false]); ?>
  44. <?php echo $this->Form->postLink($this->Format->icon('delete'), ['action'=>'delete', $qurl['Qurl']['id']], ['escape' => false, 'confirm' => __('Are you sure you want to delete # %s?', $qurl['Qurl']['id'])]); ?>
  45. </td>
  46. </tr>
  47. <?php endforeach; ?>
  48. </table>
  49. <div class="pagination-container">
  50. <?php echo $this->element('Tools.pagination'); ?>
  51. </div>
  52. </div>
  53. <div class="actions">
  54. <ul>
  55. <li><?php echo $this->Html->link(__('New %s', __('Qurl')), ['action' => 'add']); ?></li>
  56. </ul>
  57. </div>