| Server IP : 104.21.84.107 / Your IP : 104.23.243.196 Web Server : Apache/2.4.63 (Ubuntu) System : Linux adminpruebas-Virtual-Machine 6.14.0-37-generic #37-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 22:10:32 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 8.4.5 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/pregrados/contaduria-publica/libraries/regularlabs/src/Form/Field/ |
Upload File : |
<?php
/**
* @package Regular Labs Library
* @version 23.12.10783
*
* @author Peter van Westen <[email protected]>
* @link https://regularlabs.com
* @copyright Copyright © 2023 Regular Labs All Rights Reserved
* @license GNU General Public License version 2 or later
*/
namespace RegularLabs\Library\Form\Field;
defined('_JEXEC') or die;
class RangeField extends \Joomla\CMS\Form\Field\RangeField
{
/**
* @var string
*/
protected $layout = 'regularlabs.form.field.range';
/**
* @return string The field input markup.
*/
protected function getInput()
{
$this->value = (float) ($this->value ?: $this->default);
if ( ! empty($this->max))
{
$this->value = min($this->value, $this->max);
}
if ( ! empty($this->min))
{
$this->value = max($this->value, $this->min);
}
return $this->getRenderer($this->layout)->render($this->getLayoutData());
}
/**
* @return array
*/
protected function getLayoutData()
{
$data = parent::getLayoutData();
// Initialize some field attributes.
$extraData = [
'prepend' => (string) ($this->element['prepend'] ?? ''),
'append' => (string) ($this->element['append'] ?? ''),
'class_range' => (string) ($this->element['class_range'] ?? ''),
];
return [...$data, ...$extraData];
}
protected function getLayoutPaths()
{
$paths = parent::getLayoutPaths();
$paths[] = JPATH_LIBRARIES . '/regularlabs/layouts';
return $paths;
}
}