X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLFormField.php;h=6e5d6569f56aafcc806920ef5a8a88e799371997;hb=a5aecf3b880e0ca2370ff675dfa3a4942dabb7fc;hp=ebbe3233ee0d8fdf95434f3bc506ef33e7e6ec50;hpb=96906168cac0e9a7748511b48c369cf22c8406d5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php index ebbe3233ee..6e5d6569f5 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -912,45 +912,23 @@ abstract class HTMLFormField { return Linker::tooltipAndAccesskeyAttribs( $this->mParams['tooltip'] ); } - /** - * Get a translated key if necessary. - * @param array|null $mappings Array of mappings, 'original' => 'translated' - * @param string $key - * @return string - */ - protected function getMappedKey( $mappings, $key ) { - if ( !is_array( $mappings ) ) { - return $key; - } - - if ( !empty( $mappings[$key] ) ) { - return $mappings[$key]; - } - - return $key; - } - /** * Returns the given attributes from the parameters * * @param array $list List of attributes to get - * @param array $mappings Optional - Key/value map of attribute names to use - * instead of the ones passed in. * @return array Attributes */ - public function getAttributes( array $list, array $mappings = null ) { + public function getAttributes( array $list ) { static $boolAttribs = [ 'disabled', 'required', 'autofocus', 'multiple', 'readonly' ]; $ret = []; foreach ( $list as $key ) { - $mappedKey = $this->getMappedKey( $mappings, $key ); - if ( in_array( $key, $boolAttribs ) ) { if ( !empty( $this->mParams[$key] ) ) { - $ret[$mappedKey] = $mappedKey; + $ret[$key] = ''; } } elseif ( isset( $this->mParams[$key] ) ) { - $ret[$mappedKey] = $this->mParams[$key]; + $ret[$key] = $this->mParams[$key]; } }