[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_modules/layouts/joomla/form/field/ -> modulespositionedit.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_modules
   6   *
   7   * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\Factory;
  14  use Joomla\CMS\HTML\HTMLHelper;
  15  use Joomla\CMS\Language\Text;
  16  
  17  extract($displayData);
  18  
  19  /**
  20   * Layout variables
  21   * -----------------
  22   * @var   string   $autocomplete    Autocomplete attribute for the field.
  23   * @var   boolean  $autofocus       Is autofocus enabled?
  24   * @var   string   $class           Classes for the input.
  25   * @var   string   $description     Description of the field.
  26   * @var   boolean  $disabled        Is this field disabled?
  27   * @var   string   $group           Group the field belongs to. <fields> section in form XML.
  28   * @var   boolean  $hidden          Is this field hidden in the form?
  29   * @var   string   $hint            Placeholder for the field.
  30   * @var   string   $id              DOM id of the field.
  31   * @var   string   $label           Label of the field.
  32   * @var   string   $labelclass      Classes to apply to the label.
  33   * @var   boolean  $multiple        Does this field support multiple values?
  34   * @var   string   $name            Name of the input field.
  35   * @var   string   $onchange        Onchange attribute for the field.
  36   * @var   string   $onclick         Onclick attribute for the field.
  37   * @var   string   $pattern         Pattern (Reg Ex) of value of the form field.
  38   * @var   boolean  $readonly        Is this field read only?
  39   * @var   boolean  $repeat          Allows extensions to duplicate elements.
  40   * @var   boolean  $required        Is this field required?
  41   * @var   integer  $size            Size attribute of the input.
  42   * @var   boolean  $spellcheck      Spellcheck state for the form field.
  43   * @var   string   $validate        Validation rules to apply.
  44   * @var   string   $value           Value attribute of the field.
  45   * @var   array    $checkedOptions  Options that will be set as checked.
  46   * @var   boolean  $hasValue        Has this field a value assigned?
  47   * @var   array    $options         Options available for this field.
  48   * @var   array    $inputType       Options available for this field.
  49   * @var   string   $accept          File types that are accepted.
  50   * @var   array    $positions       Array of the positions
  51   */
  52  
  53  $attributes = array(
  54      'class="' . $class . '"',
  55      ' allow-custom',
  56      ' search-placeholder="' . $this->escape(Text::_('JGLOBAL_TYPE_OR_SELECT_SOME_OPTIONS')) . '" ',
  57  );
  58  
  59  $selectAttr = array(
  60      $disabled ? 'disabled' : '',
  61      $readonly ? 'readonly' : '',
  62      strlen($hint) ? 'placeholder="' . $this->escape($hint) . '"' : '',
  63      $onchange ? ' onchange="' . $onchange . '"' : '',
  64      $autofocus ? ' autofocus' : '',
  65  );
  66  
  67  if ($required) {
  68      $selectAttr[] = ' required class="required"';
  69      $attributes[] = ' required';
  70  }
  71  
  72  Text::script('JGLOBAL_SELECT_NO_RESULTS_MATCH');
  73  Text::script('JGLOBAL_SELECT_PRESS_TO_SELECT');
  74  
  75  Factory::getDocument()->getWebAssetManager()
  76      ->usePreset('choicesjs')
  77      ->useScript('webcomponent.field-fancy-select');
  78  
  79  ?>
  80  <joomla-field-fancy-select <?php echo implode(' ', $attributes); ?>><?php
  81      echo HTMLHelper::_('select.groupedlist', $positions, $name, array(
  82              'id'          => $id,
  83              'list.select' => $value,
  84              'list.attr'   => implode(' ', $selectAttr),
  85          ));
  86      ?></joomla-field-fancy-select>
  87  


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer