* @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Categories\Categories; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); $app = Factory::getApplication(); $user = Factory::getUser(); $userId = $user->get('id'); $context = $this->escape($this->state->get('filter.context')); $component = $this->state->get('filter.component'); $section = $this->state->get('filter.section'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $ordering = ($listOrder == 'a.ordering'); $saveOrder = ($listOrder == 'a.ordering' && strtolower($listDirn) == 'asc'); // The category object of the component $category = Categories::getInstance(str_replace('com_', '', $component) . '.' . $section); // If there is no category for the component and section, then check the component only if (!$category) { $category = Categories::getInstance(str_replace('com_', '', $component)); } if ($saveOrder && !empty($this->items)) { $saveOrderingUrl = 'index.php?option=com_fields&task=fields.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1'; HTMLHelper::_('draggablelist.draggable'); } $searchToolsOptions = []; // Only show field contexts filter if there are more than one option if (count($this->filterForm->getField('context')->options) > 1) { $searchToolsOptions['selectorFieldName'] = 'context'; } ?>