Add CollationFa
[lhc/web/wiklou.git] / includes / htmlform / HTMLAutoCompleteSelectField.php
index fc19d9a..76a88d5 100644 (file)
  *   other - Raw text to use for the 'other' message
  */
 class HTMLAutoCompleteSelectField extends HTMLTextField {
-       protected $autocomplete = array();
+       protected $autocomplete = [];
 
        function __construct( $params ) {
-               $params += array(
+               $params += [
                        'require-match' => false,
-               );
+               ];
 
                parent::__construct( $params );
 
@@ -53,7 +53,7 @@ class HTMLAutoCompleteSelectField extends HTMLTextField {
                $this->getOptions();
                if ( $this->mOptions && !in_array( 'other', $this->mOptions, true ) ) {
                        if ( isset( $params['other-message'] ) ) {
-                               $msg = wfMessage( $params['other-message'] )->text();
+                               $msg = $this->getMessage( $params['other-message'] )->text();
                        } elseif ( isset( $params['other'] ) ) {
                                $msg = $params['other'];
                        } else {
@@ -101,15 +101,15 @@ class HTMLAutoCompleteSelectField extends HTMLTextField {
        }
 
        // FIXME Ewww, this shouldn't be adding any attributes not requested in $list :(
-       public function getAttributes( array $list, array $mappings = null ) {
-               $attribs = array(
+       public function getAttributes( array $list ) {
+               $attribs = [
                        'type' => 'text',
                        'data-autocomplete' => FormatJson::encode( array_keys( $this->autocomplete ) ),
-               ) + parent::getAttributes( $list, $mappings );
+               ] + parent::getAttributes( $list );
 
                if ( $this->getOptions() ) {
                        $attribs['data-hide-if'] = FormatJson::encode(
-                               array( '!==', $this->mName . '-select', 'other' )
+                               [ '!==', $this->mName . '-select', 'other' ]
                        );
                }