* @link https://www.tassos.gr * @copyright Copyright © 2024 Tassos All Rights Reserved * @license GNU GPLv3 or later */ // No direct access to this file defined('_JEXEC') or die; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; require_once dirname(__DIR__) . '/helpers/field.php'; class JFormFieldTFEcommRangeField extends NRFormField { /** * Method to render the input field * * @return string */ protected function getInput() { $prefixLabel = isset($this->element['prefixLabel']) ? (string) $this->element['prefixLabel'] : false; $mainName = (string) $this->element['name']; $showIsAnyOption = isset($this->element['showIsAnyOption']) ? (string) $this->element['showIsAnyOption'] === 'true' : false; $isAnyOption = $showIsAnyOption ? '' : ''; $showIsNotEqualOption = isset($this->element['showIsNotEqualOption']) ? (string) $this->element['showIsNotEqualOption'] === 'true' : false; $isNotEqualOption = $showIsNotEqualOption ? '' : ''; $xml = new SimpleXMLElement('
' . $isAnyOption . ' ' . $isNotEqualOption . '
'); $this->form->setField($xml); foreach ($xml->field as $key => $field) { $name = (string) $field->attributes()->name; $type = (string) $field->attributes()->type; $value = isset($this->value[$name]) ? $this->value[$name] : null; $this->form->setValue($name, null, $value); } $html = $this->form->renderFieldset($mainName); HTMLHelper::stylesheet('plg_system_nrframework/tf-ecomm-range-field.css', ['relative' => true, 'version' => 'auto']); $prefix = $prefixLabel ? '' . Text::_($prefixLabel) . '' : ''; return '
' . $prefix . $html . '
'; } }