diff --git a/administrator/components/com_associations/View/Associations/HtmlView.php b/administrator/components/com_associations/View/Associations/HtmlView.php index a729e03d2bbe8..1f6c3851be5a6 100644 --- a/administrator/components/com_associations/View/Associations/HtmlView.php +++ b/administrator/components/com_associations/View/Associations/HtmlView.php @@ -124,11 +124,6 @@ public function display($tpl = null) $this->typeFields = $fields; } - // Dynamic filter form. - // This selectors doesn't have to activate the filter bar. - unset($this->activeFilters['itemtype']); - unset($this->activeFilters['language']); - // Remove filters options depending on selected type. if (empty($support['state'])) { diff --git a/administrator/components/com_associations/forms/filter_associations.xml b/administrator/components/com_associations/forms/filter_associations.xml index e5f25f9ff1e52..15e2e34b28820 100644 --- a/administrator/components/com_associations/forms/filter_associations.xml +++ b/administrator/components/com_associations/forms/filter_associations.xml @@ -23,7 +23,6 @@ name="search" type="text" label="COM_ASSOCIATIONS_FILTER_SEARCH_LABEL" - description="COM_ASSOCIATIONS_FILTER_SEARCH_DESC" hint="JSEARCH_FILTER" /> diff --git a/administrator/components/com_associations/layouts/joomla/searchtools/default.php b/administrator/components/com_associations/layouts/joomla/searchtools/default.php new file mode 100644 index 0000000000000..66422f58ebb57 --- /dev/null +++ b/administrator/components/com_associations/layouts/joomla/searchtools/default.php @@ -0,0 +1,87 @@ +activeFilters['itemtype']); + + // Menutype filter doesn't have to activate the filter bar + unset($data['view']->activeFilters['language']); +} + +// Check if the no results message should appear. +if (isset($data['view']->total) && (int) $data['view']->total === 0) +{ + $noResults = $data['view']->filterForm->getFieldAttribute('search', 'noresults', '', 'filter'); + + if (!empty($noResults)) + { + $noResultsText = JText::_($noResults); + } +} + +// Set some basic options +$customOptions = array( + 'filtersHidden' => $data['options']['filtersHidden'] ?? empty($data['view']->activeFilters), + 'defaultLimit' => $data['options']['defaultLimit'] ?? JFactory::getApplication()->get('list_limit', 20), + 'searchFieldSelector' => '#filter_search', + 'orderFieldSelector' => '#list_fullordering', + 'showNoResults' => !empty($noResultsText) ? true : false, + 'noResultsText' => !empty($noResultsText) ? $noResultsText : '', + 'formSelector' => !empty($data['options']['formSelector']) ? $data['options']['formSelector'] : '#adminForm', +); + +$data['options'] = array_merge($customOptions, $data['options']); + +// Load search tools +JHtml::_('searchtools.form', $data['options']['formSelector'], $data['options']); + +$filtersClass = isset($data['view']->activeFilters) && $data['view']->activeFilters ? ' js-stools-container-filters-visible' : ''; +?> +