Removing Wikitravel from the default interwiki list
[mediawiki.git] / includes / htmlform / HTMLButtonField.php
blobf8d017c68590ac9ce099215f8737cadf55b73fcb
1 <?php
3 /**
4 * Adds a generic button inline to the form. Does not do anything, you must add
5 * click handling code in JavaScript. Use a HTMLSubmitField if you merely
6 * wish to add a submit button to a form.
8 * @since 1.22
9 */
10 class HTMLButtonField extends HTMLFormField {
11 protected $buttonType = 'button';
13 public function __construct( $info ) {
14 $info['nodata'] = true;
15 parent::__construct( $info );
18 public function getInputHTML( $value ) {
19 $attr = array(
20 'class' => 'mw-htmlform-submit ' . $this->mClass,
21 'id' => $this->mID,
22 ) + $this->getAttributes( array( 'disabled', 'tabindex' ) );
24 return Html::input( $this->mName, $value, $this->buttonType, $attr );
27 protected function needsLabel() {
28 return false;
31 /**
32 * Button cannot be invalid
34 * @param $value String
35 * @param $alldata Array
37 * @return Bool
39 public function validate( $value, $alldata ) {
40 return true;