X-Git-Url: http://git.cyclocoop.org/%28%28?a=blobdiff_plain;ds=sidebyside;f=includes%2FHTMLForm.php;h=5de34d6712a91e1ef3e6cf7b137f23fd2740c130;hb=3ca7f919e01617c4685efce285299aa351ff1dac;hp=84e7874d6ef20c2db43c869a611229a7246f1863;hpb=66cf8a6310536c21511b0f1d5faf53af37c474a8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 84e7874d6e..5de34d6712 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -574,6 +574,21 @@ class HTMLForm extends ContextSource { return $this; } + /** + * Add an array of hidden fields to the output + * + * @since 1.22 + * @param array $fields Associative array of fields to add; + * mapping names to their values + * @return HTMLForm $this for chaining calls + */ + public function addHiddenFields( array $fields ) { + foreach ( $fields as $name => $value ) { + $this->mHiddenFields[] = array( $value, array( 'name' => $name ) ); + } + return $this; + } + /** * Add a button to the form * @param string $name field name. @@ -685,7 +700,7 @@ class HTMLForm extends ContextSource { * @return String HTML. */ function getButtons() { - $html = ''; + $html = ''; if ( $this->mShowSubmit ) { $attribs = array(); @@ -735,6 +750,8 @@ class HTMLForm extends ContextSource { $html .= Html::element( 'input', $attrs ); } + $html .= ''; + return $html; }