X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialPreferences.php;h=7f257e65e4227ed3d6d5022377de1ef4402a9017;hb=9ee6461287f5d2d6fae719ec62ae6465e0a3809d;hp=3fa5fd526cb219c2d59a295a50d723b2671be70f;hpb=de193359ce79cb5ff4a602f9e737ff03cc9f85e6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index 3fa5fd526c..7f257e65e4 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -31,6 +31,10 @@ class SpecialPreferences extends SpecialPage { parent::__construct( 'Preferences' ); } + public function doesWrites() { + return true; + } + public function execute( $par ) { $this->setHeaders(); $this->outputHeader(); @@ -57,11 +61,11 @@ class SpecialPreferences extends SpecialPage { $out->wrapWikiMsg( Html::rawElement( 'div', - array( + [ 'class' => 'mw-preferences-messagebox successbox', 'id' => 'mw-preferences-success' - ), - Html::element( 'p', array(), '$1' ) + ], + Html::element( 'p', [], '$1' ) ), 'savedprefs' ); @@ -73,25 +77,25 @@ class SpecialPreferences extends SpecialPage { $user = $this->getUser()->getInstanceForUpdate() ?: $this->getUser(); $htmlForm = Preferences::getFormObject( $user, $this->getContext() ); - $htmlForm->setSubmitCallback( array( 'Preferences', 'tryUISubmit' ) ); + $htmlForm->setSubmitCallback( [ '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 ) ) ); @@ -99,10 +103,10 @@ class SpecialPreferences extends SpecialPage { $out->addHTML( Html::rawElement( 'ul', - array( + [ 'id' => 'preftoc', 'role' => 'tablist' - ), + ], $prefTabs ) ); $htmlForm->show(); @@ -117,11 +121,11 @@ class SpecialPreferences extends SpecialPage { $context = new DerivativeContext( $this->getContext() ); $context->setTitle( $this->getPageTitle( 'reset' ) ); // Reset subpage - $htmlForm = new HTMLForm( array(), $context, 'prefs-restore' ); + $htmlForm = new HTMLForm( [], $context, 'prefs-restore' ); $htmlForm->setSubmitTextMsg( 'restoreprefs' ); $htmlForm->setSubmitDestructive(); - $htmlForm->setSubmitCallback( array( $this, 'submitReset' ) ); + $htmlForm->setSubmitCallback( [ $this, 'submitReset' ] ); $htmlForm->suppressReset(); $htmlForm->show();