mediawiki-extensions-Cite/src/ServiceWiring.php
Adam Wight c7b60735fe Move Reference Previews user preference into the Cite extension
This seems to play well with Popups with and without
Ie8fa1672b9fd .  However, it's not clear to me why this still works
and even gives priority to the Popups implementation when present,
regardless of the order the extensions are loaded in.  Happily, this
is the desired behavior.

Bug: T363162
Change-Id: Ic479c0a381ee16d1abcecfdd5ee48f0afccc1d3f
2024-09-10 15:33:50 +02:00

28 lines
852 B
PHP

<?php
use Cite\ReferencePreviews\ReferencePreviewsContext;
use Cite\ReferencePreviews\ReferencePreviewsGadgetsIntegration;
use MediaWiki\MediaWikiServices;
use MediaWiki\Registration\ExtensionRegistry;
/**
* @codeCoverageIgnore
*/
return [
'Cite.GadgetsIntegration' => static function ( MediaWikiServices $services ): ReferencePreviewsGadgetsIntegration {
return new ReferencePreviewsGadgetsIntegration(
$services->getMainConfig(),
ExtensionRegistry::getInstance()->isLoaded( 'Gadgets' ) ?
$services->getService( 'GadgetsRepo' ) :
null
);
},
'Cite.ReferencePreviewsContext' => static function ( MediaWikiServices $services ): ReferencePreviewsContext {
return new ReferencePreviewsContext(
$services->getMainConfig(),
$services->getService( 'Cite.GadgetsIntegration' ),
$services->getUserOptionsLookup()
);
},
];