pages.phtml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. /**
  3. * @version 7.9 [rev.7.9.01]
  4. */
  5. ?>
  6. <nav class="navbar navbar-filter">
  7. <div class="navbar-left">
  8. <a class="btn btn-default"
  9. href="<?php echo $this->url(array('action' => 'add-page')); ?>">
  10. <?php echo $this->_('Create Page'); ?>
  11. </a>
  12. <a class="btn btn-default"
  13. href="<?php echo $this->url(array('controller' => 'tables', 'action' => 'index', 'table' => 'relational.ContentSections'), null, false, null, true, false); ?>">
  14. <?php echo $this->_('View Sections'); ?>
  15. </a>
  16. </div>
  17. <form class="navbar-form navbar-right"
  18. action="<?php echo $this->url(null, null, true, array('title', 'submit')); ?>"
  19. method="get">
  20. <div class="form-group">
  21. <?php echo $this->formElement('text', 'title', $this->title)
  22. ->setAttributes(array('placeholder' => $this->_('Page Name'), 'class' => 'form-control input-medium'))
  23. ->render();
  24. ?>
  25. </div>
  26. <?php echo $this->formElement('submit', 'submit', $this->_('Search'))
  27. ->setAttributes(array('class' => 'btn btn-default'))
  28. ->render();
  29. ?>
  30. </form>
  31. </nav>
  32. <div class="table-responsive">
  33. <table class="table table-striped table-hover">
  34. <caption>
  35. <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong> <?php echo $this->_('pages found.'); ?>
  36. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  37. <?php echo $this->_('Showing results'); ?>
  38. <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
  39. <?php echo $this->_('to'); ?>
  40. <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>
  41. <?php } ?>
  42. </caption>
  43. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  44. <thead>
  45. <tr>
  46. <th class="size-large"><?php echo $this->_('Section'); ?></th>
  47. <th><?php echo $this->_('Title'); ?></th>
  48. <th class="size-tiny"><?php echo $this->_('Language'); ?></th>
  49. <th class="size-mini"><?php echo $this->_('Date'); ?></th>
  50. <th class="size-tiny"></th>
  51. </tr>
  52. </thead>
  53. <?php } ?>
  54. <tbody>
  55. <?php
  56. /** @var \Cube\Db\Table\Row $page */
  57. foreach ($this->paginator as $page) {
  58. ?>
  59. <tr>
  60. <td>
  61. <?php echo $this->contentSections()->getContentSections()->getFullName($page['section_id']); ?>
  62. </td>
  63. <td>
  64. <?php echo $this->fieldDisplay($page['title'], null, '-'); ?>
  65. </td>
  66. <td>
  67. <?php echo $page['language']; ?>
  68. </td>
  69. <td>
  70. <?php echo $this->date(max(array($page['created_at'], $page['updated_at'])), true); ?>
  71. </td>
  72. <td>
  73. <div class="btn-group-vertical">
  74. <a class="btn btn-default btn-sm"
  75. href="<?php echo $this->url(array('action' => 'edit-page', 'id' => $page['id'])); ?>"
  76. title="<?php echo $this->_('Edit Page'); ?>">
  77. <i class="fa fa-folder-open"></i>
  78. </a>
  79. <a class="btn btn-danger btn-sm confirm-box"
  80. href="<?php echo $this->url(array('action' => 'delete-page', 'id' => $page['id']),
  81. null, true); ?>"
  82. title="<?php echo $this->_('Delete Page'); ?>"
  83. data-message="<?php echo $this->_('Are you sure you want to delete this page?'); ?>">
  84. <i class="fa fa-times"></i>
  85. </a>
  86. </div>
  87. </td>
  88. </tr>
  89. <?php } ?>
  90. </tbody>
  91. </table>
  92. </div>
  93. <?php echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml'); ?>