Move Special:ChangeContentModel to the pagetools special page group
[lhc/web/wiklou.git] / includes / specials / SpecialPreferences.php
index f2a315e..3b5b9c9 100644 (file)
@@ -47,13 +47,17 @@ class SpecialPreferences extends SpecialPage {
                }
 
                $out->addModules( 'mediawiki.special.preferences' );
+               $out->addModuleStyles( 'mediawiki.special.preferences.styles' );
 
                if ( $this->getRequest()->getCheck( 'success' ) ) {
                        $out->wrapWikiMsg(
-                               Xml::tags(
+                               Html::rawElement(
                                        'div',
-                                       array( 'class' => 'successbox', 'id' => 'mw-preferences-success' ),
-                                       '$1'
+                                       array(
+                                               'class' => 'mw-preferences-messagebox successbox',
+                                               'id' => 'mw-preferences-success'
+                                       ),
+                                       Html::element( 'p', array(), '$1' )
                                ),
                                'savedprefs'
                        );
@@ -63,7 +67,37 @@ class SpecialPreferences extends SpecialPage {
 
                $htmlForm = Preferences::getFormObject( $this->getUser(), $this->getContext() );
                $htmlForm->setSubmitCallback( array( 'Preferences', 'tryUISubmit' ) );
+               $sectionTitles = $htmlForm->getPreferenceSections();
+
+               $prefTabs = '';
+               foreach ( $sectionTitles as $key ) {
+                       $prefTabs .= Html::rawElement( 'li',
+                               array(
+                                       'role' => 'presentation',
+                                       'class' => ( $key === 'personal' ) ? 'selected' : null
+                               ),
+                               Html::rawElement( 'a',
+                                       array(
+                                               'id' => 'preftab-' . $key,
+                                               'role' => 'tab',
+                                               'href' => '#mw-prefsection-' . $key,
+                                               'aria-controls' => 'mw-prefsection-' . $key,
+                                               'aria-selected' => ( $key === 'personal' ) ? 'true' : 'false',
+                                               'tabIndex' => ( $key === 'personal' ) ? 0 : -1,
+                                       ),
+                                       $htmlForm->getLegend( $key )
+                               )
+                       );
+               }
 
+               $out->addHTML(
+                       Html::rawElement( 'ul',
+                               array(
+                                       'id' => 'preftoc',
+                                       'role' => 'tablist'
+                               ),
+                               $prefTabs )
+               );
                $htmlForm->show();
        }