mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 06:24:22 +00:00
Disable core search module using search config
This commit is contained in:
parent
0b87fa8641
commit
331d7c9508
|
@ -26,6 +26,7 @@ use ConfigException;
|
|||
use Exception;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use RequestContext;
|
||||
use ResourceLoaderContext;
|
||||
use ThumbnailImage;
|
||||
|
||||
/**
|
||||
|
@ -66,6 +67,29 @@ class CitizenHooks {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* SkinPageReadyConfig hook handler
|
||||
*
|
||||
* Replace searchModule provided by skin.
|
||||
*
|
||||
* @since 1.35
|
||||
* @param ResourceLoaderContext $context
|
||||
* @param mixed[] &$config Associative array of configurable options
|
||||
* @return void This hook must not abort, it must return no value
|
||||
*/
|
||||
public static function onSkinPageReadyConfig(
|
||||
ResourceLoaderContext $context,
|
||||
array &$config
|
||||
) {
|
||||
// It's better to exit before any additional check
|
||||
if ( $context->getSkin() !== 'citizen' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Tell the `mediawiki.page.ready` module not to wire up search.
|
||||
$config['search'] = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lazyload images
|
||||
* Modified from the Lazyload extension
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
},
|
||||
"Hooks": {
|
||||
"ResourceLoaderGetConfigVars": "Citizen\\CitizenHooks::onResourceLoaderGetConfigVars",
|
||||
"SkinPageReadyConfig": "Citizen\\CitizenHooks::onSkinPageReadyConfig",
|
||||
"ThumbnailBeforeProduceHTML": "Citizen\\CitizenHooks::onThumbnailBeforeProduceHTML"
|
||||
},
|
||||
"ResourceModules": {
|
||||
|
|
Loading…
Reference in a new issue