X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHTMLForm.php;h=5de34d6712a91e1ef3e6cf7b137f23fd2740c130;hb=ae6e6edcca46dff2f367a782500f761c3ef0ac1d;hp=e06a934d761ae7b71ad4f71ae9b106e7ef438733;hpb=542460e194f2344358363089722ce1eb755e104c;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php
index e06a934d76..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;
}
@@ -968,9 +985,10 @@ class HTMLForm extends ContextSource {
* @param $fields array[]|HTMLFormField[] array of fields (either arrays or objects)
* @param string $sectionName ID attribute of the "
" tag for this section, ignored if empty
* @param string $fieldsetIDPrefix ID prefix for the "