PageRenderTime 25ms CodeModel.GetById 46ms RepoModel.GetById 0ms app.codeStats 1ms

/src/admin/tmpl/trash/messages.php

https://github.com/Kunena/Kunena-Forum
PHP | 253 lines | 233 code | 7 blank | 13 comment | 3 complexity | bf5a3558c823bff98ea535a63ea75c76 MD5 | raw file
  1. <?php
  2. /**
  3. * Kunena Component
  4. *
  5. * @package Kunena.Administrator.Template
  6. * @subpackage Trash
  7. *
  8. * @copyright Copyright (C) 2008 - 2022 Kunena Team. All rights reserved.
  9. * @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
  10. * @link https://www.kunena.org
  11. **/
  12. defined('_JEXEC') or die();
  13. use Joomla\CMS\Factory;
  14. use Joomla\CMS\HTML\HTMLHelper;
  15. use Joomla\CMS\Language\Text;
  16. use Joomla\CMS\WebAsset\WebAssetManager;
  17. use Kunena\Forum\Libraries\Version\KunenaVersion;
  18. use Kunena\Forum\Libraries\Route\KunenaRoute;
  19. /** @var WebAssetManager $wa */
  20. $wa = $this->document->getWebAssetManager();
  21. $wa->useScript('multiselect');
  22. ?>
  23. <div id="kunena" class="container-fluid">
  24. <div class="row">
  25. <div id="j-main-container" class="col-md-12" role="main">
  26. <div class="card card-block bg-faded p-2">
  27. <form action="<?php echo KunenaRoute::_('administrator/index.php?option=com_kunena&view=trash') ?>"
  28. method="post" id="adminForm"
  29. name="adminForm">
  30. <input type="hidden" name="type" value="<?php echo $this->escape($this->state->get('layout')) ?>"/>
  31. <input type="hidden" name="layout"
  32. value="<?php echo $this->escape($this->state->get('layout')) ?>"/>
  33. <input type="hidden" name="filter_order"
  34. value="<?php echo intval($this->state->get('list.ordering')) ?>"/>
  35. <input type="hidden" name="filter_order_Dir"
  36. value="<?php echo $this->escape($this->state->get('list.direction')) ?>"/>
  37. <input type="hidden" name="task" value=""/>
  38. <input type="hidden" name="boxchecked" value="0"/>
  39. <?php echo HTMLHelper::_('form.token'); ?>
  40. <fieldset>
  41. <legend><?php echo Text::_('COM_KUNENA_TRASH_VIEW') . ' ' . Text::_('COM_KUNENA_TRASH_MESSAGES') ?>
  42. <span
  43. class="pull-right"><?php echo $this->viewOptionsList; ?></span></legend>
  44. <div id="filter-bar" class="btn-toolbar">
  45. <div class="filter-search btn-group pull-left">
  46. <label for="filter_search"
  47. class="element-invisible"><?php echo Text::_('COM_KUNENA_FIELD_LABEL_SEARCHIN') ?></label>
  48. <input type="text" name="filter_search" id="filter_search" class="filter form-control"
  49. placeholder="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>"
  50. value="<?php echo $this->filterSearch; ?>"
  51. title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>"/>
  52. </div>
  53. <div class="btn-group pull-left">
  54. <button class="btn btn-outline-primary tip" type="submit"
  55. title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT'); ?>"><i
  56. class="icon-search"></i> <?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT'); ?>
  57. </button>
  58. <button class="btn btn-outline-danger tip" type="button"
  59. title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERRESET'); ?>"
  60. onclick="document.id('filter_search').value='';this.form.submit();"><i
  61. class="icon-remove"></i> <?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERRESET'); ?>
  62. </button>
  63. </div>
  64. <div class="btn-group pull-right hidden-phone">
  65. <label for="limit"
  66. class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label>
  67. <?php echo $this->pagination->getLimitBox(); ?>
  68. </div>
  69. <div class="btn-group pull-right hidden-phone">
  70. <label for="directionTable"
  71. class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC'); ?></label>
  72. <select name="directionTable" id="directionTable" class="input-medium"
  73. onchange="orderTable()">
  74. <option value=""><?php echo Text::_('JFIELD_ORDERING_DESC'); ?></option>
  75. <?php echo HTMLHelper::_('select.options', $this->sortDirectionFields, 'value', 'text', $this->listDirection); ?>
  76. </select>
  77. </div>
  78. <div class="btn-group pull-right">
  79. <label for="sortTable"
  80. class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY'); ?></label>
  81. <select name="sortTable" id="sortTable" class="input-medium"
  82. onchange="orderTable()">
  83. <option value=""><?php echo Text::_('JGLOBAL_SORT_BY'); ?></option>
  84. <?php echo HTMLHelper::_('select.options', $this->sortFields, 'value', 'text', $this->listOrdering); ?>
  85. </select>
  86. </div>
  87. <div class="clearfix"></div>
  88. </div>
  89. <table class="table table-striped">
  90. <thead>
  91. <tr>
  92. <th width="1%" class="nowrap center">
  93. <input type="checkbox" name="checkall-toggle" value=""
  94. title="<?php echo Text::_('JGLOBAL_CHECK_ALL'); ?>"
  95. onclick="Joomla.checkAll(this);"/>
  96. </th>
  97. <th width="1%" class="nowrap">
  98. <?php echo HTMLHelper::_('grid.sort', 'COM_KUNENA_TRASH_ID', 'id', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
  99. </th>
  100. <th>
  101. <?php echo HTMLHelper::_('grid.sort', 'COM_KUNENA_TRASH_TITLE', 'title', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
  102. </th>
  103. <th width="15%" class="nowrap">
  104. <?php echo HTMLHelper::_('grid.sort', 'COM_KUNENA_MENU_TOPIC', 'topic', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
  105. </th>
  106. <th>
  107. <?php echo HTMLHelper::_('grid.sort', 'COM_KUNENA_TRASH_CATEGORY', 'category', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
  108. </th>
  109. <th width="10%" class="nowrap">
  110. <?php echo HTMLHelper::_('grid.sort', 'COM_KUNENA_TRASH_AUTHOR', 'author', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
  111. </th>
  112. <th width="15%" class="nowrap">
  113. <?php echo HTMLHelper::_('grid.sort', 'COM_KUNENA_TRASH_IP', 'ip', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
  114. </th>
  115. <th width="10%" class="nowrap">
  116. <?php echo HTMLHelper::_('grid.sort', 'COM_KUNENA_TRASH_DATE', 'time', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
  117. </th>
  118. </tr>
  119. <tr>
  120. <td class="hidden-phone">
  121. </td>
  122. <td class="hidden-phone">
  123. </td>
  124. <td class="hidden-phone">
  125. <label for="filterTitle"
  126. class="element-invisible"><?php echo Text::_('COM_KUNENA_FIELD_LABEL_SEARCHIN'); ?></label>
  127. <input class="input-block-level input-filter form-control" type="text"
  128. name="filterTitle"
  129. id="filterTitle"
  130. placeholder="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>"
  131. value="<?php echo $this->filterTitle; ?>"
  132. title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>"/>
  133. </td>
  134. <td class="hidden-phone">
  135. <label for="filter_topic"
  136. class="element-invisible"><?php echo Text::_('COM_KUNENA_FIELD_LABEL_SEARCHIN'); ?></label>
  137. <input class="input-block-level input-filter form-control" type="text"
  138. name="filter_topic"
  139. id="filter_topic"
  140. placeholder="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT'); ?>"
  141. value="<?php echo $this->filterTopic; ?>"
  142. title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT'); ?>"/>
  143. </td>
  144. <td class="hidden-phone">
  145. <label for="filter_category"
  146. class="element-invisible"><?php echo Text::_('COM_KUNENA_FIELD_LABEL_SEARCHIN'); ?></label>
  147. <input class="input-block-level input-filter form-control" type="text"
  148. name="filter_category"
  149. id="filter_category"
  150. placeholder="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>"
  151. value="<?php echo $this->filterCategory; ?>"
  152. title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>"/>
  153. </td>
  154. <td class="nowrap">
  155. <label for="filter_ip"
  156. class="element-invisible"><?php echo Text::_('COM_KUNENA_FIELD_LABEL_SEARCHIN'); ?></label>
  157. <input class="input-block-level input-filter form-control" type="text"
  158. name="filter_ip"
  159. id="filter_ip"
  160. placeholder="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>"
  161. value="<?php echo $this->filterIp; ?>"
  162. title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>"/>
  163. </td>
  164. <td class="nowrap">
  165. <label for="filter_author"
  166. class="element-invisible"><?php echo Text::_('COM_KUNENA_FIELD_LABEL_SEARCHIN'); ?></label>
  167. <input class="input-block-level input-filter form-control" type="text"
  168. name="filter_author"
  169. id="filter_author"
  170. placeholder="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>"
  171. value="<?php echo $this->filterAuthor; ?>"
  172. title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>"/>
  173. </td>
  174. <td class="nowrap">
  175. <?php /*
  176. <label for="filter_time" class="element-invisible"><?php echo Text::_('COM_KUNENA_FIELD_LABEL_SEARCHIN'); ?></label>
  177. <input class="input-block-level input-filter form-control" type="text" name="filter_time" id="filter_time" placeholder="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>" value="<?php echo $this->filterDate; ?>" title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>" />
  178. */ ?>
  179. </td>
  180. <td class="nowrap">
  181. </td>
  182. </tr>
  183. </thead>
  184. <tfoot>
  185. <tr>
  186. <td colspan="8">
  187. <?php echo $this->pagination->getListFooter(); ?>
  188. </td>
  189. </tr>
  190. </tfoot>
  191. <tbody>
  192. <?php
  193. $i = 0;
  194. $itemid = KunenaRoute::fixMissingItemID();
  195. if ($this->pagination->total > 0)
  196. :
  197. foreach ($this->trashInternalItems as $id => $row)
  198. :
  199. ?>
  200. <tr>
  201. <td><?php echo HTMLHelper::_('grid.id', $i++, intval($row->id)) ?></td>
  202. <td><?php echo intval($row->id); ?></td>
  203. <td>
  204. <a href="<?php echo KunenaRoute::_('index.php?option=com_kunena&view=topic&catid=' . $row->getTopic()->category_id . '&id=' . $row->getTopic()->id . '&mesid=' . $row->id . '&Itemid=' . $itemid . '#' . $row->id); ?>"
  205. target="_blank"><?php echo $this->escape($row->subject); ?></a></td>
  206. <td>
  207. <a href="<?php echo KunenaRoute::_('index.php?option=com_kunena&view=topic&catid=' . $row->getTopic()->category_id . '&id=' . $row->getTopic()->id . '&Itemid=' . $itemid); ?>"
  208. target="_blank"><?php echo $this->escape($row->getTopic()->subject); ?></a>
  209. </td>
  210. <td><?php echo $this->escape($row->getCategory()->name); ?></td>
  211. <td><?php echo $this->escape($row->getAuthor()->getName()); ?></td>
  212. <td><?php echo $this->escape($row->ip); ?></td>
  213. <td><?php echo Factory::getDate($row->time)->format('%Y-%m-%d %H:%M:%S', $row->time); ?></td>
  214. </tr>
  215. <?php
  216. endforeach;
  217. else:
  218. ?>
  219. <tr>
  220. <td colspan="10">
  221. <div class="card card-block bg-faded p-2 center filter-state">
  222. <span><?php echo Text::_('COM_KUNENA_FILTERACTIVE'); ?>
  223. <?php
  224. if ($this->filterActive || $this->pagination->total > 0)
  225. :
  226. ?>
  227. <button class="btn btn-outline-primary" type="button"
  228. onclick="document.getElements('.filter').set('value', '');this.form.submit();"><?php echo Text::_('COM_KUNENA_FIELD_LABEL_FILTERCLEAR'); ?></button>
  229. <?php endif; ?>
  230. </span>
  231. </div>
  232. </td>
  233. </tr>
  234. <?php endif; ?>
  235. </tbody>
  236. </table>
  237. </fieldset>
  238. </form>
  239. <div class="clearfix"></div>
  240. </div>
  241. </div>
  242. </div>
  243. <div class="pull-right small">
  244. <?php echo KunenaVersion::getLongVersionHTML(); ?>
  245. </div>
  246. </div>