mediawiki-skins-Vector/includes/CentralAuthHooks.php
gerritbot febf3e635e Update UserOptionsLookup's FQN
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
2023-11-29 12:42:02 +00:00

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;
}
}
}