r84717 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84716‎ | r84717 | r84718 >
Date:22:46, 24 March 2011
Author:happy-melon
Status:ok
Tags:
Comment:
Refactor the get-legend-for-section-fieldset logic out into its own function so it can be overridden.
Modified paths:
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HTMLForm.php
@@ -648,7 +648,7 @@
649649 $hasLeftColumn = true;
650650 } elseif ( is_array( $value ) ) {
651651 $section = $this->displaySection( $value, $key );
652 - $legend = wfMsg( "{$this->mMessagePrefix}-$key" );
 652+ $legend = $this->getLegend( $key );
653653 if ( isset( $this->mSectionHeaders[$key] ) ) {
654654 $section = $this->mSectionHeaders[$key] . $section;
655655 }
@@ -725,6 +725,16 @@
726726 function filterDataForSubmit( $data ) {
727727 return $data;
728728 }
 729+
 730+ /**
 731+ * Get a string to go in the <legend> of a section fieldset. Override this if you
 732+ * want something more complicated
 733+ * @param $key String
 734+ * @return String
 735+ */
 736+ public function getLegend( $key ) {
 737+ return wfMsg( "{$this->mMessagePrefix}-$key" );
 738+ }
729739 }
730740
731741 /**

Status & tagging log