aboutsummaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorLeo Koppelkamm <diebuche@users.mediawiki.org>2011-07-08 21:12:10 +0000
committerLeo Koppelkamm <diebuche@users.mediawiki.org>2011-07-08 21:12:10 +0000
commit42d5c3f64d8a6266c116e0dddb8584b90bb09c2f (patch)
treeb335a33d9f909806bf8d8f0523e40bcab519cb11 /includes
parent52102598e2ee5767137650f63f57fa6c7ad072bc (diff)
downloadmediawikicore-42d5c3f64d8a6266c116e0dddb8584b90bb09c2f.tar.gz
mediawikicore-42d5c3f64d8a6266c116e0dddb8584b90bb09c2f.zip
HTMLForm: Add option to output a title for a fieldset & activate it for Special:Pref. Preliminary work for Bug 29672
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91757
Diffstat (limited to 'includes')
-rw-r--r--includes/HTMLForm.php8
-rw-r--r--includes/Preferences.php6
2 files changed, 12 insertions, 2 deletions
diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php
index f560590635ec..c73d536185b8 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 b1274d182604..e36117a3ee86 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 );
+ }
}