| Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.preferences.js |
| — | — | @@ -28,7 +28,7 @@ |
| 29 | 29 | }); |
| 30 | 30 | var $a = $( '<a/>', { |
| 31 | 31 | text : $legend.text(), |
| 32 | | - id : ident.replace('prefsection', 'preftab'), |
| | 32 | + id : ident.replace( 'mw-prefsection', 'preftab' ), |
| 33 | 33 | href : '#' + ident |
| 34 | 34 | }).click( function( e ) { |
| 35 | 35 | e.preventDefault(); |
| — | — | @@ -52,8 +52,8 @@ |
| 53 | 53 | // On document ready: |
| 54 | 54 | $( function() { |
| 55 | 55 | var hash = window.location.hash; |
| 56 | | - if( hash.match( /^#prefsection-[\w-]+/ ) ) { |
| 57 | | - var $tab = $( hash.replace('prefsection', 'preftab') ); |
| | 56 | + if( hash.match( /^#mw-prefsection-[\w-]+/ ) ) { |
| | 57 | + var $tab = $( hash.replace( 'mw-prefsection', 'preftab' ) ); |
| 58 | 58 | $tab.click(); |
| 59 | 59 | } |
| 60 | 60 | } ); |
| Index: trunk/phase3/includes/Preferences.php |
| — | — | @@ -1535,6 +1535,6 @@ |
| 1536 | 1536 | * Get the whole body of the form. |
| 1537 | 1537 | */ |
| 1538 | 1538 | function getBody() { |
| 1539 | | - return $this->displaySection( $this->mFieldTree, '', true ); |
| | 1539 | + return $this->displaySection( $this->mFieldTree, '', 'mw-prefsection-' ); |
| 1540 | 1540 | } |
| 1541 | 1541 | } |
| Index: trunk/phase3/includes/HTMLForm.php |
| — | — | @@ -681,9 +681,11 @@ |
| 682 | 682 | |
| 683 | 683 | /** |
| 684 | 684 | * TODO: Document |
| 685 | | - * @param $fields |
| | 685 | + * @param $fields array of fields (either arrays or objects) |
| | 686 | + * @param $sectionName string ID attribute of the <table> tag for this section, ignored if empty |
| | 687 | + * @param $fieldsetIDPrefix string ID prefix for the <fieldset> tag of each subsection, ignored if empty |
| 686 | 688 | */ |
| 687 | | - function displaySection( $fields, $sectionName = '', $displayTitle = false ) { |
| | 689 | + function displaySection( $fields, $sectionName = '', $fieldsetIDPrefix = '' ) { |
| 688 | 690 | $tableHtml = ''; |
| 689 | 691 | $subsectionHtml = ''; |
| 690 | 692 | $hasLeftColumn = false; |
| — | — | @@ -708,8 +710,8 @@ |
| 709 | 711 | $section .= $this->mSectionFooters[$key]; |
| 710 | 712 | } |
| 711 | 713 | $attributes = array(); |
| 712 | | - if ( $displayTitle ) { |
| 713 | | - $attributes["id"] = 'prefsection-' . Sanitizer::escapeId( $key, 'noninitial' ); |
| | 714 | + if ( $fieldsetIDPrefix ) { |
| | 715 | + $attributes['id'] = Sanitizer::escapeId( "$fieldsetIDPrefix$key" ); |
| 714 | 716 | } |
| 715 | 717 | $subsectionHtml .= Xml::fieldset( $legend, $section, $attributes ) . "\n"; |
| 716 | 718 | } |