34 if ( isset( $params[
'autocomplete'] ) && is_bool( $params[
'autocomplete'] ) ) {
35 $params[
'autocomplete'] = $params[
'autocomplete'] ?
'on' :
'off';
38 parent::__construct( $params );
40 if ( isset( $params[
'placeholder-message'] ) ) {
41 $this->mPlaceholder = $this->
getMessage( $params[
'placeholder-message'] )->text();
42 } elseif ( isset( $params[
'placeholder'] ) ) {
43 $this->mPlaceholder = $params[
'placeholder'];
46 $this->mAccept = $params[
'accept'] ??
null;
47 $this->mMultiple = !empty( $params[
'multiple'] );
54 return $request->getUpload( $this->mName )->getName();
68 if ( $this->mClass !==
'' ) {
71 if ( $this->mAccept ) {
72 $attribs[
'accept'] = implode(
',', $this->mAccept );
74 if ( $this->mMultiple ) {
75 $attribs[
'multiple'] =
'';
90 return Html::input( $this->mName, $value ??
'',
'file', $attribs );
100 if ( $this->mClass !==
'' ) {
103 if ( $this->mPlaceholder !==
'' ) {
106 if ( $this->mAccept ) {
109 if ( $this->mMultiple ) {
110 $attribs[
'multiple'] =
true;
113 # @todo Enforce pattern, step, required, readonly on the server side as
124 $attribs += OOUI\Element::configFromHtmlAttributes(
130 'name' => $this->mName,
131 'dir' => $this->mDir,
143 return new OOUI\SelectFileInputWidget( $params );
loadDataFromRequest( $request)
Get the value that this input has been set to from a posted form, or the input's default value if it ...
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...