mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 15:16:50 +00:00
Get ResourceLoader from Context
Change-Id: I439266105ef18612da50a3d306b04a835c648eae
This commit is contained in:
parent
fc9c41ee05
commit
61c539d205
|
@ -25,9 +25,9 @@ use MediaWiki\Auth\Hook\LocalUserCreatedHook;
|
|||
use MediaWiki\Config\Config;
|
||||
use MediaWiki\Hook\BeforePageDisplayHook;
|
||||
use MediaWiki\Hook\MakeGlobalVariablesScriptHook;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Output\OutputPage;
|
||||
use MediaWiki\Preferences\Hook\GetPreferencesHook;
|
||||
use MediaWiki\ResourceLoader\Context;
|
||||
use MediaWiki\ResourceLoader\Hook\ResourceLoaderGetConfigVarsHook;
|
||||
use MediaWiki\User\Hook\UserGetDefaultOptionsHook;
|
||||
use MediaWiki\User\Options\UserOptionsManager;
|
||||
|
@ -83,13 +83,13 @@ class PopupsHooks implements
|
|||
|
||||
/**
|
||||
* Get custom Popups types registered by extensions
|
||||
* @param Context $context
|
||||
* @return array
|
||||
*/
|
||||
public static function getCustomPopupTypes(): array {
|
||||
$rl = MediaWikiServices::getInstance()->getService( 'ResourceLoader' );
|
||||
public static function getCustomPopupTypes( Context $context ): array {
|
||||
// FIXME: If the module ext.cite.referencePreviews does not exist register reference previews.
|
||||
// This code can be removed once T355194 is complete.
|
||||
$others = $rl->getModule( 'ext.cite.referencePreviews' ) ?
|
||||
$others = $context->getResourceLoader()->getModule( 'ext.cite.referencePreviews' ) ?
|
||||
[] : [ 'ext.popups.referencePreviews' ];
|
||||
|
||||
return array_merge( ExtensionRegistry::getInstance()->getAttribute(
|
||||
|
|
Loading…
Reference in a new issue