mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-15 03:34:25 +00:00
febf3e635e
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here. Bug: T352284 Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52 Change-Id: I084e01a29884f338fae22d7239d068823a2657c3
32 lines
805 B
PHP
32 lines
805 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Skins\Vector;
|
|
|
|
use MediaWiki\Extension\CentralAuth\Hooks\CentralAuthIsUIReloadRecommendedHook;
|
|
use MediaWiki\User\Options\UserOptionsLookup;
|
|
use 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' ) === Constants::SKIN_NAME_MODERN ) {
|
|
// Vector 2022 does not support updating the UI without reloading the page (T345112)
|
|
$recommendReload = true;
|
|
}
|
|
}
|
|
|
|
}
|