From c1f9b1f7b1b77776192048005dcc66dcf3df2bfb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 27 Dec 2014 15:41:37 +0100 Subject: Update to MediaWiki 1.24.1 --- includes/htmlform/HTMLSelectField.php | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 includes/htmlform/HTMLSelectField.php (limited to 'includes/htmlform/HTMLSelectField.php') diff --git a/includes/htmlform/HTMLSelectField.php b/includes/htmlform/HTMLSelectField.php new file mode 100644 index 00000000..a198037a --- /dev/null +++ b/includes/htmlform/HTMLSelectField.php @@ -0,0 +1,44 @@ +getOptions() ); + + if ( in_array( strval( $value ), $validOptions, true ) ) { + return true; + } else { + return $this->msg( 'htmlform-select-badoption' )->parse(); + } + } + + function getInputHTML( $value ) { + $select = new XmlSelect( $this->mName, $this->mID, strval( $value ) ); + + if ( !empty( $this->mParams['disabled'] ) ) { + $select->setAttribute( 'disabled', 'disabled' ); + } + + $allowedParams = array( 'tabindex', 'size' ); + $customParams = $this->getAttributes( $allowedParams ); + foreach ( $customParams as $name => $value ) { + $select->setAttribute( $name, $value ); + } + + if ( $this->mClass !== '' ) { + $select->setAttribute( 'class', $this->mClass ); + } + + $select->addOptions( $this->getOptions() ); + + return $select->getHTML(); + } +} -- cgit v1.2.3-54-g00ecf