mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-13 17:57:06 +00:00
aa13694fea
Thanks to T321527, MediaWiki makes it possible for default values of user properties to vary by user. Depends-On: I1549c3137e66801c85e03e46427e27da333d68e2 Bug: T354329 Change-Id: Ib7c80f0b065617f9e76315eb4a652486681247cc
35 lines
835 B
PHP
35 lines
835 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Skins\Vector;
|
|
|
|
use MediaWiki\Extension\CentralAuth\Hooks\CentralAuthIsUIReloadRecommendedHook;
|
|
use MediaWiki\User\Options\UserOptionsLookup;
|
|
use MediaWiki\User\User;
|
|
|
|
/**
|
|
* @package Vector
|
|
* @internal
|
|
*/
|
|
class CentralAuthHooks implements CentralAuthIsUIReloadRecommendedHook {
|
|
|
|
private UserOptionsLookup $userOptionsLookup;
|
|
|
|
public function __construct( UserOptionsLookup $userOptionsLookup ) {
|
|
$this->userOptionsLookup = $userOptionsLookup;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function onCentralAuthIsUIReloadRecommended( User $user, bool &$recommendReload ) {
|
|
if (
|
|
$this->userOptionsLookup->getDefaultOption( 'skin', $user ) ===
|
|
Constants::SKIN_NAME_MODERN
|
|
) {
|
|
// Vector 2022 does not support updating the UI without reloading the page (T345112)
|
|
$recommendReload = true;
|
|
}
|
|
}
|
|
|
|
}
|