HTMLUserTextField: Enable suggestions for non-OOUI mode
[lhc/web/wiklou.git] / includes / htmlform / HTMLUserTextField.php
index 9617c0a..8816d37 100644 (file)
@@ -44,4 +44,13 @@ class HTMLUserTextField extends HTMLTextField {
 
                return new UserInputWidget( $params );
        }
+
+       public function getInputHtml( $value ) {
+               // add the required module and css class for user suggestions in non-OOUI mode
+               $this->mParent->getOutput()->addModules( 'mediawiki.userSuggest' );
+               $this->mClass .= ' mw-autocomplete-user';
+
+               // return parent html
+               return parent::getInputHtml( $value );
+       }
 }