2015-04-27 14:05:31 +00:00
|
|
|
<?php
|
2015-08-20 12:06:01 +00:00
|
|
|
$dir = dirname( __FILE__ ) . '/';
|
2015-04-27 14:05:31 +00:00
|
|
|
|
|
|
|
$wgExtensionCredits[ 'parserhook' ][] = [
|
|
|
|
'name' => 'Portable Infobox',
|
|
|
|
'author' => [
|
|
|
|
'Adam Robak',
|
2015-06-10 17:13:45 +00:00
|
|
|
'Diana Falkowska',
|
2015-04-27 14:05:31 +00:00
|
|
|
'Jacek Jursza',
|
|
|
|
'Mateusz Rybarski',
|
|
|
|
'Rafał Leszczyński',
|
|
|
|
'Sebastian Marzjan'
|
|
|
|
],
|
|
|
|
'descriptionmsg' => 'portable-infobox-desc',
|
|
|
|
'version' => 0.1,
|
|
|
|
'url' => 'https://github.com/Wikia/app/tree/dev/extensions/wikia/PortableInfobox'
|
|
|
|
];
|
|
|
|
|
2015-11-20 20:06:46 +00:00
|
|
|
$wgAutoloadClasses[ 'PortableInfoboxQueryService' ] = $dir . 'services/PortableInfoboxQueryService.class.php';
|
2015-04-27 14:05:31 +00:00
|
|
|
$wgAutoloadClasses[ 'PortableInfoboxRenderService' ] = $dir . 'services/PortableInfoboxRenderService.class.php';
|
2016-12-28 14:14:54 +00:00
|
|
|
$wgAutoloadClasses[ 'PortableInfoboxMobileRenderService' ] = $dir . 'services/PortableInfoboxMobileRenderService.class.php';
|
2015-05-29 14:37:35 +00:00
|
|
|
$wgAutoloadClasses[ 'PortableInfoboxErrorRenderService' ] = $dir . 'services/PortableInfoboxErrorRenderService.class.php';
|
2015-04-27 14:05:31 +00:00
|
|
|
|
|
|
|
// parser
|
2015-08-20 12:06:01 +00:00
|
|
|
$wgAutoloadClasses[ 'Wikia\\PortableInfobox\\Parser\\ExternalParser' ] = $dir . 'services/Parser/ExternalParser.php';
|
|
|
|
$wgAutoloadClasses[ 'Wikia\\PortableInfobox\\Parser\\SimpleParser' ] = $dir . 'services/Parser/SimpleParser.php';
|
|
|
|
$wgAutoloadClasses[ 'Wikia\\PortableInfobox\\Parser\\XmlParser' ] = $dir . 'services/Parser/XmlParser.php';
|
|
|
|
$wgAutoloadClasses[ 'Wikia\\PortableInfobox\\Parser\\DummyParser' ] = $dir . 'services/Parser/DummyParser.php';
|
|
|
|
$wgAutoloadClasses[ 'Wikia\\PortableInfobox\\Parser\\MediaWikiParserService' ] = $dir . 'services/Parser/MediaWikiParserService.php';
|
2015-04-27 14:05:31 +00:00
|
|
|
$wgInfoboxParserNodes = [
|
|
|
|
'Node',
|
2015-07-01 14:19:31 +00:00
|
|
|
'NodeNavigation',
|
2015-04-27 14:05:31 +00:00
|
|
|
'NodeGroup',
|
|
|
|
'NodeHeader',
|
|
|
|
'NodeImage',
|
2015-06-10 15:19:40 +00:00
|
|
|
'NodeInfobox',
|
2015-05-04 10:48:57 +00:00
|
|
|
'NodeData',
|
2015-04-27 14:05:31 +00:00
|
|
|
'NodeTitle',
|
|
|
|
'NodeUnimplemented'
|
|
|
|
];
|
2015-06-10 09:28:33 +00:00
|
|
|
$wgAutoloadClasses[ 'Wikia\\PortableInfobox\\Parser\\Nodes\\NodeFactory' ] = $dir . 'services/Parser/Nodes/NodeFactory.class.php';
|
2015-04-27 14:05:31 +00:00
|
|
|
foreach ( $wgInfoboxParserNodes as $parserNode ) {
|
2015-08-20 12:06:01 +00:00
|
|
|
$wgAutoloadClasses[ 'Wikia\\PortableInfobox\\Parser\\Nodes\\' . $parserNode ] = $dir . 'services/Parser/Nodes/' . $parserNode . '.php';
|
2015-04-27 14:05:31 +00:00
|
|
|
}
|
|
|
|
|
2015-05-04 14:43:53 +00:00
|
|
|
// helpers
|
2016-02-03 11:06:44 +00:00
|
|
|
$wgAutoloadClasses[ 'Wikia\PortableInfobox\Helpers\InfoboxParamsValidator' ] = $dir . 'services/Helpers/InfoboxParamsValidator.php';
|
2015-06-19 10:31:22 +00:00
|
|
|
$wgAutoloadClasses[ 'Wikia\PortableInfobox\Helpers\PortableInfoboxDataBag' ] = $dir . 'services/Helpers/PortableInfoboxDataBag.php';
|
2016-12-27 14:58:01 +00:00
|
|
|
$wgAutoloadClasses[ 'Wikia\PortableInfobox\Helpers\PortableInfoboxMustacheEngine' ] = $dir . 'services/Helpers/PortableInfoboxMustacheEngine.php';
|
2015-07-28 11:49:17 +00:00
|
|
|
$wgAutoloadClasses[ 'Wikia\PortableInfobox\Helpers\PortableInfoboxRenderServiceHelper' ] = $dir . 'services/Helpers/PortableInfoboxRenderServiceHelper.php';
|
2015-09-22 15:48:38 +00:00
|
|
|
$wgAutoloadClasses[ 'Wikia\PortableInfobox\Helpers\PortableInfoboxTemplatesHelper' ] = $dir . 'services/Helpers/PortableInfoboxTemplatesHelper.php';
|
2015-09-23 13:51:41 +00:00
|
|
|
$wgAutoloadClasses[ 'Wikia\PortableInfobox\Helpers\PagePropsProxy' ] = $dir . 'services/Helpers/PagePropsProxy.php';
|
2015-05-04 14:43:53 +00:00
|
|
|
|
2015-12-23 14:54:03 +00:00
|
|
|
//sanitizers
|
2015-12-28 10:59:53 +00:00
|
|
|
$wgAutoloadClasses[ 'SanitizerBuilder' ] = $dir . 'services/Sanitizers/SanitizerBuilder.php';
|
2015-12-23 14:54:03 +00:00
|
|
|
$wgAutoloadClasses[ 'NodeSanitizer' ] = $dir . 'services/Sanitizers/NodeSanitizer.php';
|
2015-12-28 10:59:53 +00:00
|
|
|
$wgAutoloadClasses[ 'PassThroughSanitizer' ] = $dir . 'services/Sanitizers/PassThroughSanitizer.php';
|
2015-12-23 14:54:03 +00:00
|
|
|
$wgAutoloadClasses[ 'NodeTypeSanitizerInterface' ] = $dir . 'services/Sanitizers/NodeTypeSanitizerInterface.php';
|
|
|
|
$wgAutoloadClasses[ 'NodeDataSanitizer' ] = $dir . 'services/Sanitizers/NodeDataSanitizer.php';
|
|
|
|
$wgAutoloadClasses[ 'NodeHeroImageSanitizer' ] = $dir . 'services/Sanitizers/NodeHeroImageSanitizer.php';
|
|
|
|
$wgAutoloadClasses[ 'NodeHorizontalGroupSanitizer' ] = $dir . 'services/Sanitizers/NodeHorizontalGroupSanitizer.php';
|
|
|
|
$wgAutoloadClasses[ 'NodeImageSanitizer' ] = $dir . 'services/Sanitizers/NodeImageSanitizer.php';
|
|
|
|
$wgAutoloadClasses[ 'NodeTitleSanitizer' ] = $dir . 'services/Sanitizers/NodeTitleSanitizer.php';
|
|
|
|
|
2015-04-27 14:05:31 +00:00
|
|
|
// controller classes
|
|
|
|
$wgAutoloadClasses[ 'PortableInfoboxParserTagController' ] = $dir . 'controllers/PortableInfoboxParserTagController.class.php';
|
2015-05-29 13:04:04 +00:00
|
|
|
$wgAutoloadClasses[ 'ApiPortableInfobox' ] = $dir . 'controllers/ApiPortableInfobox.class.php';
|
2015-06-10 09:28:33 +00:00
|
|
|
$wgAutoloadClasses[ 'ApiQueryPortableInfobox' ] = $dir . 'controllers/ApiQueryPortableInfobox.class.php';
|
2015-04-27 14:05:31 +00:00
|
|
|
$wgAutoloadClasses[ 'PortableInfoboxHooks' ] = $dir . 'PortableInfoboxHooks.class.php';
|
2015-08-20 12:06:01 +00:00
|
|
|
$wgAutoloadClasses[ 'ApiQueryAllinfoboxes' ] = $dir . 'controllers/ApiQueryAllinfoboxes.class.php';
|
2015-04-27 14:05:31 +00:00
|
|
|
|
2016-12-27 14:57:14 +00:00
|
|
|
|
2015-08-20 13:14:23 +00:00
|
|
|
// query pages
|
|
|
|
$wgAutoloadClasses[ 'AllinfoboxesQueryPage' ] = $dir . 'querypage/AllinfoboxesQueryPage.php';
|
|
|
|
|
2015-04-27 14:05:31 +00:00
|
|
|
// hooks
|
2015-08-20 12:06:01 +00:00
|
|
|
$wgHooks[ 'ParserFirstCallInit' ][] = 'PortableInfoboxParserTagController::parserTagInit';
|
|
|
|
$wgHooks[ 'ParserTagHooksBeforeInvoke' ][] = 'PortableInfoboxHooks::onParserTagHooksBeforeInvoke';
|
|
|
|
$wgHooks[ 'BeforePageDisplay' ][] = 'PortableInfoboxHooks::onBeforePageDisplay';
|
|
|
|
$wgHooks[ 'ParserAfterTidy' ][] = 'PortableInfoboxParserTagController::replaceInfoboxMarkers';
|
|
|
|
$wgHooks[ 'ImageServing::buildAndGetIndex' ][] = 'PortableInfoboxHooks::onImageServingCollectImages';
|
2015-08-20 13:14:23 +00:00
|
|
|
$wgHooks[ 'wgQueryPages' ][] = 'PortableInfoboxHooks::onWgQueryPages';
|
2015-09-08 17:42:49 +00:00
|
|
|
$wgHooks[ 'AllInfoboxesQueryRecached' ][] = 'PortableInfoboxHooks::onAllInfoboxesQueryRecached';
|
2015-09-22 15:48:38 +00:00
|
|
|
$wgHooks[ 'ArticlePurge' ][] = 'PortableInfoboxHooks::onArticlePurge';
|
|
|
|
$wgHooks[ 'ArticleSave' ][] = 'PortableInfoboxHooks::onArticleSave';
|
|
|
|
$wgHooks[ 'BacklinksPurge' ][] = 'PortableInfoboxHooks::onBacklinksPurge';
|
2016-03-31 07:31:54 +00:00
|
|
|
$wgHooks[ 'ArticleInsertComplete' ][] = 'PortableInfoboxHooks::onArticleInsertComplete';
|
2016-05-09 11:56:28 +00:00
|
|
|
$wgHooks[ 'ArticleAsJsonBeforeEncode' ][] = 'PortableInfoboxHooks::onArticleAsJsonBeforeEncode';
|
2015-08-20 13:14:23 +00:00
|
|
|
|
|
|
|
// special pages
|
|
|
|
$wgSpecialPages[ 'AllInfoboxes' ] = 'AllinfoboxesQueryPage';
|
|
|
|
$wgSpecialPageGroups[ 'AllInfoboxes' ] = 'wikia';
|
2015-04-27 14:05:31 +00:00
|
|
|
|
|
|
|
// i18n mapping
|
|
|
|
$wgExtensionMessagesFiles[ 'PortableInfobox' ] = $dir . 'PortableInfobox.i18n.php';
|
2015-05-29 13:04:04 +00:00
|
|
|
|
2015-06-01 09:40:06 +00:00
|
|
|
// MW API
|
2015-08-20 12:06:01 +00:00
|
|
|
$wgAPIModules[ 'infobox' ] = 'ApiPortableInfobox';
|
2015-06-10 09:28:33 +00:00
|
|
|
$wgAPIPropModules[ 'infobox' ] = 'ApiQueryPortableInfobox';
|
2015-08-20 12:06:01 +00:00
|
|
|
$wgAPIListModules[ 'allinfoboxes' ] = 'ApiQueryAllinfoboxes';
|