-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
list_items.php
128 lines (120 loc) · 5.33 KB
/
list_items.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/**
* @package Joomla.Site
* @subpackage com_tags
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('com_tags.tag-list');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
<form action="<?php echo htmlspecialchars(Uri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm" class="com-tags-tag-list__items">
<?php if ($this->params->get('filter_field') || $this->params->get('show_pagination_limit')) : ?>
<fieldset class="com-tags-tag-list__filters filters d-flex justify-content-between mb-3">
<?php if ($this->params->get('filter_field')) : ?>
<div class="input-group">
<label class="filter-search-lbl sr-only" for="filter-search">
<?php echo Text::_('COM_TAGS_TITLE_FILTER_LABEL') . ' '; ?>
</label>
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="form-control" title="<?php echo Text::_('COM_TAGS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo Text::_('COM_TAGS_TITLE_FILTER_LABEL'); ?>">
<span class="input-group-append">
<button type="submit" name="filter-search-button" title="<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>" class="btn btn-secondary">
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'search']); ?>
</button>
<button type="reset" name="filter-clear-button" title="<?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?>" class="btn btn-secondary">
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'times']); ?>
</button>
</span>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="btn-group float-right">
<label for="limit" class="sr-only">
<?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
<input type="hidden" name="filter_order" value="">
<input type="hidden" name="filter_order_Dir" value="">
<input type="hidden" name="limitstart" value="">
<input type="hidden" name="task" value="">
</fieldset>
<?php endif; ?>
<?php if (empty($this->items)) : ?>
<p><?php echo Text::_('COM_TAGS_NO_ITEMS'); ?></p>
<?php else : ?>
<table class="com-tags-tag-list__category category table table-striped table-bordered table-hover">
<?php if ($this->params->get('show_headings')) : ?>
<thead>
<tr>
<th id="categorylist_header_title">
<?php echo HTMLHelper::_('grid.sort', 'JGLOBAL_TITLE', 'c.core_title', $listDirn, $listOrder); ?>
</th>
<?php if ($date = $this->params->get('tag_list_show_date')) : ?>
<th id="categorylist_header_date">
<?php if ($date === 'created') : ?>
<?php echo HTMLHelper::_('grid.sort', 'COM_TAGS_' . $date . '_DATE', 'c.core_created_time', $listDirn, $listOrder); ?>
<?php elseif ($date === 'modified') : ?>
<?php echo HTMLHelper::_('grid.sort', 'COM_TAGS_' . $date . '_DATE', 'c.core_modified_time', $listDirn, $listOrder); ?>
<?php elseif ($date === 'published') : ?>
<?php echo HTMLHelper::_('grid.sort', 'COM_TAGS_' . $date . '_DATE', 'c.core_publish_up', $listDirn, $listOrder); ?>
<?php endif; ?>
</th>
<?php endif; ?>
</tr>
</thead>
<?php endif; ?>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<?php if ($item->core_state == 0) : ?>
<tr class="table-danger">
<?php else : ?>
<tr>
<?php endif; ?>
<td <?php if ($this->params->get('show_headings')) echo "headers=\"categorylist_header_title\""; ?> class="list-title">
<a href="<?php echo Route::_($item->link); ?>">
<?php echo $this->escape($item->core_title); ?>
</a>
<?php if ($item->core_state == 0) : ?>
<span class="list-published badge badge-warning">
<?php echo Text::_('JUNPUBLISHED'); ?>
</span>
<?php endif; ?>
</td>
<?php if ($this->params->get('tag_list_show_date')) : ?>
<td headers="categorylist_header_date" class="list-date small">
<?php
echo HTMLHelper::_(
'date', $item->displayDate,
$this->escape($this->params->get('date_format', Text::_('DATE_FORMAT_LC3')))
); ?>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php // Add pagination links ?>
<?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
<div class="com-tags-tag-list__pagination w-100">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter float-right pt-3 pr-2">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
</form>