http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84717

Revision: 84717
Author:   happy-melon
Date:     2011-03-24 22:46:07 +0000 (Thu, 24 Mar 2011)
Log Message:
-----------
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: trunk/phase3/includes/HTMLForm.php
===================================================================
--- trunk/phase3/includes/HTMLForm.php  2011-03-24 22:00:25 UTC (rev 84716)
+++ trunk/phase3/includes/HTMLForm.php  2011-03-24 22:46:07 UTC (rev 84717)
@@ -648,7 +648,7 @@
                                        $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 @@
        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" );
+       }
 }
 
 /**


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to