mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-14 19:26:42 +00:00
0bb02c9c57
This brings in CentralAuth for phan analysis, using config patch 8063720d68ee1d2db2c37c1ad55da3fbef688bce in CI. Bug: T345112 Change-Id: Iddd94b38f04a34dc18df8978c2bf45e8e204a85c
32 lines
797 B
PHP
32 lines
797 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Skins\Vector;
|
|
|
|
use MediaWiki\Extension\CentralAuth\Hooks\CentralAuthIsUIReloadRecommendedHook;
|
|
use MediaWiki\User\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;
|
|
}
|
|
}
|
|
|
|
}
|