33 if ( isset( $params[
'autocomplete'] ) && is_bool( $params[
'autocomplete'] ) ) {
34 $params[
'autocomplete'] = $params[
'autocomplete'] ?
'on' :
'off';
37 parent::__construct( $params );
39 if ( isset( $params[
'placeholder-message'] ) ) {
40 $this->mPlaceholder = $this->
getMessage( $params[
'placeholder-message'] )->text();
41 } elseif ( isset( $params[
'placeholder'] ) ) {
42 $this->mPlaceholder = $params[
'placeholder'];
45 $this->mAccept = $params[
'accept'] ??
null;
46 $this->mMultiple = !empty( $params[
'multiple'] );
60 if ( $this->mClass !==
'' ) {
63 if ( $this->mAccept ) {
64 $attribs[
'accept'] = implode(
',', $this->mAccept );
66 if ( $this->mMultiple ) {
67 $attribs[
'multiple'] =
'';
82 return Html::input( $this->mName, $value,
'file', $attribs );
92 if ( $this->mClass !==
'' ) {
95 if ( $this->mPlaceholder !==
'' ) {
98 if ( $this->mAccept ) {
101 if ( $this->mMultiple ) {
102 $attribs[
'multiple'] =
true;
105 # @todo Enforce pattern, step, required, readonly on the server side as
116 $attribs += OOUI\Element::configFromHtmlAttributes(
122 'name' => $this->mName,
123 'dir' => $this->mDir,
135 return new OOUI\SelectFileInputWidget( $params );
getInputOOUI( $value)
Same as getInputHTML, but returns an OOUI object.Defaults to false, which getOOUI will interpret as "...
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself....
shouldInfuseOOUI()
Whether the field should be automatically infused.Note that all OOUI HTMLForm fields are infusable (y...