From: Leo Koppelkamm Date: Fri, 8 Jul 2011 21:12:10 +0000 (+0000) Subject: HTMLForm: Add option to output a title for a fieldset & activate it for Special:Pref... X-Git-Tag: 1.31.0-rc.0~28977 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=42d5c3f64d8a6266c116e0dddb8584b90bb09c2f;p=lhc%2Fweb%2Fwiklou.git HTMLForm: Add option to output a title for a fieldset & activate it for Special:Pref. Preliminary work for Bug 29672 --- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index f560590635..c73d536185 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -676,7 +676,7 @@ class HTMLForm { * TODO: Document * @param $fields */ - function displaySection( $fields, $sectionName = '' ) { + function displaySection( $fields, $sectionName = '', $displayTitle = false ) { $tableHtml = ''; $subsectionHtml = ''; $hasLeftColumn = false; @@ -699,7 +699,11 @@ class HTMLForm { if ( isset( $this->mSectionFooters[$key] ) ) { $section .= $this->mSectionFooters[$key]; } - $subsectionHtml .= Xml::fieldset( $legend, $section ) . "\n"; + $attributes = array(); + if ( $displayTitle ) { + $attributes["title"] = $key; + } + $subsectionHtml .= Xml::fieldset( $legend, $section, $attributes ) . "\n"; } } diff --git a/includes/Preferences.php b/includes/Preferences.php index b1274d1826..e36117a3ee 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1520,4 +1520,10 @@ class PreferencesForm extends HTMLForm { return $data; } + /** + * Get the whole body of the form. + */ + function getBody() { + return $this->displaySection( $this->mFieldTree, '', true ); + } }