123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <?php
- /**
- * @version 7.4
- */
- /* @var bool $inAdmin */
- /* @var bool $archived */
- /* @var bool $summary */
- if (!$summary) {
- ?>
- <nav class="navbar navbar-filter">
- <?php if ($inAdmin) { ?>
- <div class="navbar-left">
- <?php
- $container = $this->navigation()->getContainer();
- echo $this->navigation()
- ->setContainer($container->findOneBy('label', $this->_('Messaging Filter')))
- ->setPartial('navigation/browse-filter.phtml')
- ->menu();
- $this->navigation()->setContainer($container);
- ?>
- </div>
- <?php } ?>
- <form class="navbar-form navbar-right" action="" method="get">
- <div class="form-group">
- <?php echo $this->formElement('text', 'keywords', $this->keywords)
- ->setAttributes(array('placeholder' => $this->_('Keywords'), 'class' => 'form-control input-default'))
- ->render();
- ?>
- </div>
- <?php echo $this->formElement('submit', 'submit', $this->_('Search'))
- ->setAttributes(array('class' => 'btn btn-default'))
- ->render();
- ?>
- </form>
- </nav>
- <?php } ?>
- <form action="" method="post">
- <?php echo $this->formElement('hidden', 'option', '')->render(); ?>
- <div class="table-responsive">
- <table class="table table-striped table-hover">
- <caption>
- <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong> <?php echo $this->_('messages found.'); ?>
- <?php if ($this->paginator->getPages()->totalItemCount) { ?>
- <?php echo $this->_('Showing results'); ?>
- <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
- <?php echo $this->_('to'); ?>
- <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>
- <?php } ?>
- </caption>
- <?php if ($this->paginator->getPages()->totalItemCount) { ?>
- <thead>
- <tr>
- <?php if (!$archived && !$summary) { ?>
- <th class="size-tiny">
- <?php echo $this->formElement('checkbox', 'selectAll')
- ->setMultiOptions(array(1 => null))
- ->render();
- ?>
- </th>
- <?php } ?>
- <th class="size-tiny"></th>
- <th><?php echo $this->_('Message Title'); ?></th>
- <?php if (in_array($this->filter, array('received', 'all'))) { ?>
- <th class="size-medium"><?php echo $this->_('From'); ?></th>
- <?php } ?>
- <?php if (in_array($this->filter, array('sent', 'all'))) { ?>
- <th class="size-medium"><?php echo $this->_('To'); ?></th>
- <?php } ?>
- </tr>
- </thead>
- <?php } ?>
- <tbody>
- <?php
- /** @var \Ppb\Db\Table\Row\Message $message */
- foreach ($this->paginator as $message) {
- $link = $message->link($inAdmin);
- $topicTitle = $this->message($message)->topicTitle();
- ?>
- <tr>
- <?php if (!$archived && !$summary) { ?>
- <td>
- <?php echo $this->formElement('checkbox', 'id')
- ->setMultiOptions(array($message['id'] => null))
- ->setAttributes(array('class' => 'select-all'))
- ->setMultiple()
- ->render();
- ?>
- </td>
- <?php } ?>
- <td>
- <?php if (!$message['flag_read']) { ?>
- <i class="fa fa-envelope"></i>
- <?php } ?>
- </td>
- <td>
- <div>
- <?php if ($link !== false) { ?>
- <a href="<?php echo $this->url($link); ?>">
- <?php echo $this->fieldDisplay($this->renderText($message['title']), null, $this->_('Message')); ?>
- </a>
- <?php
- }
- else {
- ?>
- <?php echo $this->renderText($message['title']); ?>
- <?php } ?>
- </div>
- <?php if (!empty($topicTitle)) { ?>
- <div>
- <small>
- <strong><?php echo $this->renderText($topicTitle); ?></strong>
- </small>
- </div>
- <?php } ?>
- <div>
- <small class="muted"><?php echo $this->date($message['created_at']); ?></small>
- </div>
- <?php if ($inAdmin) { ?>
- <div>
- <small><?php echo $this->renderText($message['content'], true); ?></small>
- </div>
- <?php } ?>
- </td>
- <?php if (in_array($this->filter, array('received', 'all'))) { ?>
- <td>
- <?php echo $this->userDetails($message->findParentRow('\Ppb\Db\Table\Users',
- 'Sender'))->display(); ?>
- </td>
- <?php } ?>
- <?php if (in_array($this->filter, array('sent', 'all'))) { ?>
- <td>
- <?php echo $this->userDetails($message->findParentRow('\Ppb\Db\Table\Users',
- 'Receiver'))->display(); ?>
- </td>
- <?php } ?>
- </tr>
- <?php } ?>
- <?php if ($this->paginator->getPages()->totalItemCount) { ?>
- <tr>
- <td colspan="6">
- <div class="btn-group">
- <?php if (!$archived && !$summary) { ?>
- <?php if ($inAdmin) { ?>
- <button class="btn btn-default confirm-form" value="delete"
- data-message="<?php echo $this->_('Are you sure you want to delete these messages?'); ?>">
- <?php echo $this->_('Delete'); ?>
- </button>
- <?php
- }
- else {
- ?>
- <button class="btn btn-default confirm-form" value="archive"
- data-message="<?php echo $this->_('Are you sure you want to archive these messages?'); ?>">
- <?php echo $this->_('Archive'); ?>
- </button>
- <?php } ?>
- <?php } ?>
- </div>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- </form>
- <?php
- if (!$summary) {
- echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml');
- }
- ?>
|