-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCarousel.php
48 lines (39 loc) · 1.4 KB
/
Carousel.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
# Alert the user that this is not a valid access point to MediaWiki if they try to access the special pages file directly.
if ( !defined( 'MEDIAWIKI' ) ) {
exit( 1 );
}
$dir = dirname( __FILE__ );
$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'Carousel',
'descriptionmsg' => 'carousel-desc',
'version' => '1.0',
'author' => array( 'Pierre Boutet' ),
'url' => 'https://www.wikifab.org'
);
$wgResourceModules['ext.carousel.js'] = array(
'scripts' => 'carousel.js',
'styles' => array(),
'messages' => array(
),
'dependencies' => array(
'jquery.ui.core'
),
'position' => 'bottom',
'localBasePath' => __DIR__ . '/resources',
'remoteExtPath' => 'Carousel/resources',
);
$wgHooks['ParserFirstCallInit'][] = 'wfCarouselFunctions';
//$wgHooks['ParserAfterTidy'][] = 'wfCarouselFunctions';
# Parser function to insert a link changing a tab.
function wfCarouselFunctions( $parser ) {
$parser->setFunctionHook( 'carousel', array('Carousel', 'addParser' ));
//$parser->setFunctionTagHook('displayTutorialsList', array('Carousel', 'addSampleParser' ), array());
return true;
}
require_once(__DIR__ . "/includes/Carousel.php");
$wgAutoloadClasses['Carousel'] = __DIR__ . "/includes/Carousel.php";
//$wgMessagesDirs['Carousel'][] = __DIR__ . "/i18n";
// Allow translation of the parser function name
$wgExtensionMessagesFiles['Carousel'] = __DIR__ . '/Carousel.i18n.php';