10 defined(
'JPATH_PLATFORM') or die;
29 protected $type =
'File';
48 public function __get($name)
56 return parent::__get($name);
69 public function __set($name, $value)
74 $this->$accept = (string) $value;
78 parent::__set($name, $value);
96 public function setup(SimpleXMLElement $element, $value, $group = null)
98 $return = parent::setup($element, $value, $group);
102 $this->accept = (string) $this->element[
'accept'];
119 protected function getInput()
122 $accept = !empty($this->accept) ?
' accept="' . $this->accept .
'"' :
'';
123 $size = !empty($this->size) ?
' size="' . $this->size .
'"' :
'';
124 $class = !empty($this->
class) ?
' class="' . $this->
class . '"' : '';
125 $disabled = $this->disabled ? ' disabled' : '';
126 $required = $this->required ? ' required aria-required="true"' : '';
127 $autofocus = $this->autofocus ? ' autofocus' : '';
128 $multiple = $this->multiple ? ' multiple' : '';
131 $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : '';
134 JHtml::_('jquery.framework');
135 JHtml::_('script', 'system/html5fallback.js', false, true);
137 return '<input type="file" name="' . $this->name . '" id="' . $this->id . '" value=""' . $accept
138 . $disabled . $class . $size . $onchange . $required . $autofocus . $multiple . ' />';