From b1dd860b954b0fbdf5391ff44b26102a77b29275 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Thu, 24 Mar 2011 22:46:07 +0000 Subject: [PATCH] Refactor the get-legend-for-section-fieldset logic out into its own function so it can be overridden. --- includes/HTMLForm.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index cc2446d9e5..7af1f56d7c 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -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 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" ); + } } /** -- 2.20.1