* @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Config\Administrator\Field; use Joomla\CMS\Factory; use Joomla\CMS\Form\FormField; use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Text Filters form field. * * @since 1.6 */ class FiltersField extends FormField { /** * The form field type. * * @var string * @since 1.6 */ public $type = 'Filters'; /** * Method to get the field input markup. * * @todo: Add access check. * * @return string The field input markup. * * @since 1.6 */ protected function getInput() { // Add translation string for notification Text::script('COM_CONFIG_TEXT_FILTERS_NOTE'); // Add Javascript Factory::getDocument()->getWebAssetManager()->useScript('com_config.filters'); // Get the available user groups. $groups = $this->getUserGroups(); // Build the form control. $html = array(); // Open the table. $html[] = '
'; $html[] = ' ' . Text::_('JGLOBAL_FILTER_GROUPS_LABEL') . ''; $html[] = ' | '; $html[] = ''; $html[] = ' ' . Text::_('JGLOBAL_FILTER_TYPE_LABEL') . ''; $html[] = ' | '; $html[] = ''; $html[] = ' ' . Text::_('JGLOBAL_FILTER_TAGS_LABEL') . ''; $html[] = ' | '; $html[] = ''; $html[] = ' ' . Text::_('JGLOBAL_FILTER_ATTRIBUTES_LABEL') . ''; $html[] = ' | '; $html[] = '
---|---|---|---|
'; $html[] = ' ' . LayoutHelper::render('joomla.html.treeprefix', array('level' => $group->level + 1)) . $group->text; $html[] = ' | '; $html[] = ''; $html[] = ' '; $html[] = ' '; $html[] = ' | '; $html[] = ''; $html[] = ' '; $html[] = ' '; $html[] = ' | '; $html[] = ''; $html[] = ' '; $html[] = ' '; $html[] = ' | '; $html[] = '