default.php
3 KB
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
<?php
/**
* @package Joomla.Administrator
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
/** @var array $displayData */
$data = $displayData;
// Receive overridable options
$data['options'] = !empty($data['options']) ? $data['options'] : array();
if ($data['view'] instanceof MenusViewItems || $data['view'] instanceof MenusViewMenus)
{
$doc = JFactory::getDocument();
$doc->addStyleDeclaration("
/* Fixed filter field in search bar */
.js-stools .js-stools-menutype,
.js-stools .js-stools-client_id {
float: left;
margin-right: 10px;
min-width: 220px;
}
html[dir=rtl] .js-stools .js-stools-menutype,
html[dir=rtl] .js-stools .js-stools-client_id {
float: right;
margin-left: 10px
margin-right: 0;
}
.js-stools .js-stools-container-bar .js-stools-field-filter .chzn-container {
padding: 3px 0;
}
");
// Client selector doesn't have to activate the filter bar.
unset($data['view']->activeFilters['client_id']);
// Menutype filter doesn't have to activate the filter bar
unset($data['view']->activeFilters['menutype']);
}
// Set some basic options
$customOptions = array(
'filtersHidden' => isset($data['options']['filtersHidden']) ? $data['options']['filtersHidden'] : empty($data['view']->activeFilters),
'defaultLimit' => isset($data['options']['defaultLimit']) ? $data['options']['defaultLimit'] : JFactory::getApplication()->get('list_limit', 20),
'searchFieldSelector' => '#filter_search',
'orderFieldSelector' => '#list_fullordering',
'totalResults' => isset($data['options']['totalResults']) ? $data['options']['totalResults'] : -1,
'noResultsText' => isset($data['options']['noResultsText']) ? $data['options']['noResultsText'] : JText::_('JGLOBAL_NO_MATCHING_RESULTS'),
);
$data['options'] = array_merge($customOptions, $data['options']);
$formSelector = !empty($data['options']['formSelector']) ? $data['options']['formSelector'] : '#adminForm';
// Load search tools
JHtml::_('searchtools.form', $formSelector, $data['options']);
$filtersClass = isset($data['view']->activeFilters) && $data['view']->activeFilters ? ' js-stools-container-filters-visible' : '';
?>
<div class="js-stools clearfix">
<div class="clearfix">
<div class="js-stools-container-bar">
<?php echo JLayoutHelper::render('joomla.searchtools.default.bar', $data); ?>
</div>
<div class="js-stools-container-list hidden-phone hidden-tablet">
<?php echo JLayoutHelper::render('joomla.searchtools.default.list', $data); ?>
</div>
</div>
<!-- Filters div -->
<div class="js-stools-container-filters hidden-phone clearfix<?php echo $filtersClass; ?>">
<?php echo JLayoutHelper::render('joomla.searchtools.default.filters', $data); ?>
</div>
</div>
<?php if ($data['options']['totalResults'] === 0) : ?>
<?php echo JLayoutHelper::render('joomla.searchtools.default.noitems', $data); ?>
<?php endif; ?>