From: Happy-melon Date: Sat, 13 Mar 2010 15:33:18 +0000 (+0000) Subject: HTMLSubmitField is more useful as an inline button than an alias for HTMLForm::addBut... X-Git-Tag: 1.31.0-rc.0~37472 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=eb002b00c12b0f4be9b5934991b5cc49676785e4;p=lhc%2Fweb%2Fwiklou.git HTMLSubmitField is more useful as an inline button than an alias for HTMLForm::addButton(). --- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index a6c7946356..008f0ec35e 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1362,18 +1362,31 @@ class HTMLHiddenField extends HTMLFormField { public function getInputHTML( $value ){ return ''; } } +/** + * Add a submit button inline in the form (as opposed to + * HTMLForm::addButton(), which will add it at the end). + */ class HTMLSubmitField extends HTMLFormField { - public function getTableRow( $value ){ - $this->mParent->addButton( - $this->mParams['name'], - $this->mParams['default'], - isset($this->mParams['id']) ? $this->mParams['id'] : null, - $this->getTooltipAndAccessKey() + function __construct( $info ) { + $info['nodata'] = true; + parent::__construct( $info ); + } + + function getInputHTML( $value ) { + return Xml::submitButton( + $value, + array( + 'class' => 'mw-htmlform-submit', + 'name' => $this->mName, + 'id' => $this->mID, + ) ); } - - public function getInputHTML( $value ){ return ''; } + + protected function needsLabel() { + return false; + } } class HTMLEditTools extends HTMLFormField {