Refactor the get-legend-for-section-fieldset logic out into its own function so it...
authorHappy-melon <happy-melon@users.mediawiki.org>
Thu, 24 Mar 2011 22:46:07 +0000 (22:46 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Thu, 24 Mar 2011 22:46:07 +0000 (22:46 +0000)
includes/HTMLForm.php

index cc2446d..7af1f56 100644 (file)
@@ -648,7 +648,7 @@ class HTMLForm {
                                        $hasLeftColumn = true;
                        } elseif ( is_array( $value ) ) {
                                $section = $this->displaySection( $value, $key );
-                               $legend = wfMsg( "{$this->mMessagePrefix}-$key" );
+                               $legend = $this->getLegend( $key );
                                if ( isset( $this->mSectionHeaders[$key] ) ) {
                                        $section = $this->mSectionHeaders[$key] . $section;
                                } 
@@ -725,6 +725,16 @@ class HTMLForm {
        function filterDataForSubmit( $data ) {
                return $data;
        }
+
+       /**
+        * Get a string to go in the <legend> of a section fieldset.  Override this if you
+        * want something more complicated
+        * @param $key String
+        * @return String
+        */
+       public function getLegend( $key ) {
+               return wfMsg( "{$this->mMessagePrefix}-$key" );
+       }
 }
 
 /**