Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -92,6 +92,8 @@ |
93 | 93 | protected $mPre = ''; |
94 | 94 | protected $mHeader = ''; |
95 | 95 | protected $mFooter = ''; |
| 96 | + protected $mSectionHeaders = array(); |
| 97 | + protected $mSectionFooters = array(); |
96 | 98 | protected $mPost = ''; |
97 | 99 | protected $mId; |
98 | 100 | |
— | — | @@ -309,13 +311,31 @@ |
310 | 312 | * Add header text, inside the form. |
311 | 313 | * @param $msg String complete text of message to display |
312 | 314 | */ |
313 | | - function addHeaderText( $msg ) { $this->mHeader .= $msg; } |
| 315 | + function addHeaderText( $msg, $section = null ) { |
| 316 | + if ( is_null( $section ) ) { |
| 317 | + $this->mHeader .= $msg; |
| 318 | + } else { |
| 319 | + if ( !isset( $this->mSectionHeaders[$section] ) ) { |
| 320 | + $this->mSectionHeaders[$section] = ''; |
| 321 | + } |
| 322 | + $this->mSectionHeaders[$section] .= $msg; |
| 323 | + } |
| 324 | + } |
314 | 325 | |
315 | 326 | /** |
316 | 327 | * Add footer text, inside the form. |
317 | 328 | * @param $msg String complete text of message to display |
318 | 329 | */ |
319 | | - function addFooterText( $msg ) { $this->mFooter .= $msg; } |
| 330 | + function addFooterText( $msg, $section = null ) { |
| 331 | + if ( is_null( $section ) ) { |
| 332 | + $this->mFooter .= $msg; |
| 333 | + } else { |
| 334 | + if ( !isset( $this->mSectionFooters[$section] ) ) { |
| 335 | + $this->mSectionFooters[$section] = ''; |
| 336 | + } |
| 337 | + $this->mSectionFooters[$section] .= $msg; |
| 338 | + } |
| 339 | + } |
320 | 340 | |
321 | 341 | /** |
322 | 342 | * Add text to the end of the display. |
— | — | @@ -633,7 +653,13 @@ |
634 | 654 | } elseif ( is_array( $value ) ) { |
635 | 655 | $section = $this->displaySection( $value, $key ); |
636 | 656 | $legend = wfMsg( "{$this->mMessagePrefix}-$key" ); |
637 | | - $subsectionHtml .= Xml::fieldset( $legend, $section ) . "\n"; |
| 657 | + if ( isset( $this->mSectionHeaders[$key] ) ) { |
| 658 | + $section = $this->mSectionHeaders[$key] . $section; |
| 659 | + } |
| 660 | + if ( isset( $this->mSectionFooters[$key] ) ) { |
| 661 | + $section .= $this->mSectionFooters[$key]; |
| 662 | + } |
| 663 | + $subsectionHtml .= Xml::fieldset( $legend, $section ) . "\n"; |
638 | 664 | } |
639 | 665 | } |
640 | 666 | |