r91757 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91756‎ | r91757 | r91758 >
Date:21:12, 8 July 2011
Author:diebuche
Status:ok (Comments)
Tags:
Comment:
HTMLForm: Add option to output a title for a fieldset & activate it for Special:Pref. Preliminary work for Bug 29672
Modified paths:
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)
  • /trunk/phase3/includes/Preferences.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HTMLForm.php
@@ -676,7 +676,7 @@
677677 * TODO: Document
678678 * @param $fields
679679 */
680 - function displaySection( $fields, $sectionName = '' ) {
 680+ function displaySection( $fields, $sectionName = '', $displayTitle = false ) {
681681 $tableHtml = '';
682682 $subsectionHtml = '';
683683 $hasLeftColumn = false;
@@ -699,7 +699,11 @@
700700 if ( isset( $this->mSectionFooters[$key] ) ) {
701701 $section .= $this->mSectionFooters[$key];
702702 }
703 - $subsectionHtml .= Xml::fieldset( $legend, $section ) . "\n";
 703+ $attributes = array();
 704+ if ( $displayTitle ) {
 705+ $attributes["title"] = $key;
 706+ }
 707+ $subsectionHtml .= Xml::fieldset( $legend, $section, $attributes ) . "\n";
704708 }
705709 }
706710
Index: trunk/phase3/includes/Preferences.php
@@ -1520,4 +1520,10 @@
15211521
15221522 return $data;
15231523 }
 1524+ /**
 1525+ * Get the whole body of the form.
 1526+ */
 1527+ function getBody() {
 1528+ return $this->displaySection( $this->mFieldTree, '', true );
 1529+ }
15241530 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r91869use tab name, not tab index for anchors on Special:Preferences. Bug 29672 . P...diebuche09:54, 11 July 2011

Comments

#Comment by Jarry1250 (talk | contribs)   17:02, 9 July 2011

Might it be worth passing $key through Sanitizer::escapeId() ?

Status & tagging log