* @copyright Copyright (c) 2020 Samuel Marshall / JCH Optimize * @license GNU/GPLv3, or later. See LICENSE file * * If LICENSE file missing, see . */ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Uri\Uri; defined('_JEXEC') or die; include_once dirname(__FILE__) . '/exclude.php'; class JFormFieldExcludejspei extends JFormFieldExclude { public $type = 'excludejspei'; public string $filetype = 'js'; public string $filegroup = 'file'; protected string $valueType = 'url'; protected function getInput(): string { $this->value = array_values($this->value); $i = 0; $nextIndex = count($this->value); $field = <<
  Ignore execution order       Don't move to bottom  
HTML; foreach ($this->value as $value) { //Sanity check if (!isset($value[$this->valueType])) { continue; } $ieoChecked = isset($value['ieo']) ? 'checked' : ''; $dontMoveChecked = isset($value['dontmove']) ? 'checked' : ''; $dataValue = $this->multiSelect->{'prepare' . ucfirst($this->filegroup) . 'Values'}( $value[$this->valueType] ); $size = strlen($value[$this->valueType]); $field .= << {$dataValue} HTML; $i++; } $attributes = 'class="inputbox chzn-custom-value input-large jch-multiselect" multiple data-jch_type="' . $this->filetype . '" data-jch_param="' . $this->fieldname . '" data-jch_group="' . $this->filegroup . '"'; $select = HTMLHelper::_( 'select.genericlist', $this->getOptions(), 'jform[' . $this->fieldname . '][][' . $this->valueType . ']', $attributes, 'id', 'name', $this->value, $this->id ); $uriRoot = Uri::root(); $field .= <<
{$select}
HTML; return $field; } protected function getOptions(): array { return []; } }