browse.phtml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?php
  2. /**
  3. * @version 7.4
  4. */
  5. /* @var bool $inAdmin */
  6. /* @var bool $archived */
  7. /* @var bool $summary */
  8. if (!$summary) {
  9. ?>
  10. <nav class="navbar navbar-filter">
  11. <?php if ($inAdmin) { ?>
  12. <div class="navbar-left">
  13. <?php
  14. $container = $this->navigation()->getContainer();
  15. echo $this->navigation()
  16. ->setContainer($container->findOneBy('label', $this->_('Messaging Filter')))
  17. ->setPartial('navigation/browse-filter.phtml')
  18. ->menu();
  19. $this->navigation()->setContainer($container);
  20. ?>
  21. </div>
  22. <?php } ?>
  23. <form class="navbar-form navbar-right" action="" method="get">
  24. <div class="form-group">
  25. <?php echo $this->formElement('text', 'keywords', $this->keywords)
  26. ->setAttributes(array('placeholder' => $this->_('Keywords'), 'class' => 'form-control input-default'))
  27. ->render();
  28. ?>
  29. </div>
  30. <?php echo $this->formElement('submit', 'submit', $this->_('Search'))
  31. ->setAttributes(array('class' => 'btn btn-default'))
  32. ->render();
  33. ?>
  34. </form>
  35. </nav>
  36. <?php } ?>
  37. <form action="" method="post">
  38. <?php echo $this->formElement('hidden', 'option', '')->render(); ?>
  39. <div class="table-responsive">
  40. <table class="table table-striped table-hover">
  41. <caption>
  42. <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong> <?php echo $this->_('messages found.'); ?>
  43. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  44. <?php echo $this->_('Showing results'); ?>
  45. <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
  46. <?php echo $this->_('to'); ?>
  47. <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>
  48. <?php } ?>
  49. </caption>
  50. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  51. <thead>
  52. <tr>
  53. <?php if (!$archived && !$summary) { ?>
  54. <th class="size-tiny">
  55. <?php echo $this->formElement('checkbox', 'selectAll')
  56. ->setMultiOptions(array(1 => null))
  57. ->render();
  58. ?>
  59. </th>
  60. <?php } ?>
  61. <th class="size-tiny"></th>
  62. <th><?php echo $this->_('Message Title'); ?></th>
  63. <?php if (in_array($this->filter, array('received', 'all'))) { ?>
  64. <th class="size-medium"><?php echo $this->_('From'); ?></th>
  65. <?php } ?>
  66. <?php if (in_array($this->filter, array('sent', 'all'))) { ?>
  67. <th class="size-medium"><?php echo $this->_('To'); ?></th>
  68. <?php } ?>
  69. </tr>
  70. </thead>
  71. <?php } ?>
  72. <tbody>
  73. <?php
  74. /** @var \Ppb\Db\Table\Row\Message $message */
  75. foreach ($this->paginator as $message) {
  76. $link = $message->link($inAdmin);
  77. $topicTitle = $this->message($message)->topicTitle();
  78. ?>
  79. <tr>
  80. <?php if (!$archived && !$summary) { ?>
  81. <td>
  82. <?php echo $this->formElement('checkbox', 'id')
  83. ->setMultiOptions(array($message['id'] => null))
  84. ->setAttributes(array('class' => 'select-all'))
  85. ->setMultiple()
  86. ->render();
  87. ?>
  88. </td>
  89. <?php } ?>
  90. <td>
  91. <?php if (!$message['flag_read']) { ?>
  92. <i class="fa fa-envelope"></i>
  93. <?php } ?>
  94. </td>
  95. <td>
  96. <div>
  97. <?php if ($link !== false) { ?>
  98. <a href="<?php echo $this->url($link); ?>">
  99. <?php echo $this->fieldDisplay($this->renderText($message['title']), null, $this->_('Message')); ?>
  100. </a>
  101. <?php
  102. }
  103. else {
  104. ?>
  105. <?php echo $this->renderText($message['title']); ?>
  106. <?php } ?>
  107. </div>
  108. <?php if (!empty($topicTitle)) { ?>
  109. <div>
  110. <small>
  111. <strong><?php echo $this->renderText($topicTitle); ?></strong>
  112. </small>
  113. </div>
  114. <?php } ?>
  115. <div>
  116. <small class="muted"><?php echo $this->date($message['created_at']); ?></small>
  117. </div>
  118. <?php if ($inAdmin) { ?>
  119. <div>
  120. <small><?php echo $this->renderText($message['content'], true); ?></small>
  121. </div>
  122. <?php } ?>
  123. </td>
  124. <?php if (in_array($this->filter, array('received', 'all'))) { ?>
  125. <td>
  126. <?php echo $this->userDetails($message->findParentRow('\Ppb\Db\Table\Users',
  127. 'Sender'))->display(); ?>
  128. </td>
  129. <?php } ?>
  130. <?php if (in_array($this->filter, array('sent', 'all'))) { ?>
  131. <td>
  132. <?php echo $this->userDetails($message->findParentRow('\Ppb\Db\Table\Users',
  133. 'Receiver'))->display(); ?>
  134. </td>
  135. <?php } ?>
  136. </tr>
  137. <?php } ?>
  138. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  139. <tr>
  140. <td colspan="6">
  141. <div class="btn-group">
  142. <?php if (!$archived && !$summary) { ?>
  143. <?php if ($inAdmin) { ?>
  144. <button class="btn btn-default confirm-form" value="delete"
  145. data-message="<?php echo $this->_('Are you sure you want to delete these messages?'); ?>">
  146. <?php echo $this->_('Delete'); ?>
  147. </button>
  148. <?php
  149. }
  150. else {
  151. ?>
  152. <button class="btn btn-default confirm-form" value="archive"
  153. data-message="<?php echo $this->_('Are you sure you want to archive these messages?'); ?>">
  154. <?php echo $this->_('Archive'); ?>
  155. </button>
  156. <?php } ?>
  157. <?php } ?>
  158. </div>
  159. </td>
  160. </tr>
  161. <?php } ?>
  162. </tbody>
  163. </table>
  164. </div>
  165. </form>
  166. <?php
  167. if (!$summary) {
  168. echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml');
  169. }
  170. ?>