mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-12-18 00:30:40 +00:00
Use "optional_services" in skin.json
Change-Id: Idab8a934e4c8f547d018907cb427effcab1d0f3f
This commit is contained in:
parent
6d50ae266b
commit
b9eca74ff0
|
@ -44,10 +44,10 @@ use MediaWiki\SpecialPage\Hook\SpecialPageBeforeExecuteHook;
|
||||||
use MediaWiki\SpecialPage\SpecialPage;
|
use MediaWiki\SpecialPage\SpecialPage;
|
||||||
use MediaWiki\User\Options\UserOptionsLookup;
|
use MediaWiki\User\Options\UserOptionsLookup;
|
||||||
use MediaWiki\User\User;
|
use MediaWiki\User\User;
|
||||||
|
use MobileContext;
|
||||||
use OldChangesList;
|
use OldChangesList;
|
||||||
use Skin;
|
use Skin;
|
||||||
use Wikimedia\Rdbms\ConfiguredReadOnlyMode;
|
use Wikimedia\Rdbms\ConfiguredReadOnlyMode;
|
||||||
use Wikimedia\Services\NoSuchServiceException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook handlers for Minerva skin.
|
* Hook handlers for Minerva skin.
|
||||||
|
@ -71,13 +71,16 @@ class Hooks implements
|
||||||
|
|
||||||
private ConfiguredReadOnlyMode $configuredReadOnlyMode;
|
private ConfiguredReadOnlyMode $configuredReadOnlyMode;
|
||||||
private UserOptionsLookup $userOptionsLookup;
|
private UserOptionsLookup $userOptionsLookup;
|
||||||
|
private ?MobileContext $mobileContext;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ConfiguredReadOnlyMode $configuredReadOnlyMode,
|
ConfiguredReadOnlyMode $configuredReadOnlyMode,
|
||||||
UserOptionsLookup $userOptionsLookup
|
UserOptionsLookup $userOptionsLookup,
|
||||||
|
?MobileContext $mobileContext
|
||||||
) {
|
) {
|
||||||
$this->configuredReadOnlyMode = $configuredReadOnlyMode;
|
$this->configuredReadOnlyMode = $configuredReadOnlyMode;
|
||||||
$this->userOptionsLookup = $userOptionsLookup;
|
$this->userOptionsLookup = $userOptionsLookup;
|
||||||
|
$this->mobileContext = $mobileContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -210,12 +213,9 @@ class Hooks implements
|
||||||
* @param string $oldName
|
* @param string $oldName
|
||||||
*/
|
*/
|
||||||
public function onUserLogoutComplete( $user, &$inject_html, $oldName ) {
|
public function onUserLogoutComplete( $user, &$inject_html, $oldName ) {
|
||||||
try {
|
if ( $this->mobileContext ) {
|
||||||
$ctx = MediaWikiServices::getInstance()->getService( 'MobileFrontend.Context' );
|
|
||||||
$skinOptions = MediaWikiServices::getInstance()->getService( 'Minerva.SkinOptions' );
|
$skinOptions = MediaWikiServices::getInstance()->getService( 'Minerva.SkinOptions' );
|
||||||
$skinOptions->setMinervaSkinOptions( $ctx, $ctx->getSkin() );
|
$skinOptions->setMinervaSkinOptions( $this->mobileContext, $this->mobileContext->getSkin() );
|
||||||
} catch ( NoSuchServiceException $ex ) {
|
|
||||||
// MobileFrontend not installed. Not important.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue