- $htmlForm->setSubmitCallback( [ 'Preferences', 'tryUISubmit' ] );
-
- $prefTabs = [];
- foreach ( $htmlForm->getPreferenceSections() as $key ) {
- $prefTabs[] = [
- 'name' => $key,
- 'label' => $htmlForm->getLegend( $key ),
- ];
+ $sectionTitles = $htmlForm->getPreferenceSections();
+
+ $prefTabs = '';
+ foreach ( $sectionTitles as $key ) {
+ $prefTabs .= Html::rawElement( 'li',
+ [
+ 'role' => 'presentation',
+ 'class' => ( $key === 'personal' ) ? 'selected' : null
+ ],
+ Html::rawElement( 'a',
+ [
+ '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 )
+ )
+ );