-
Notifications
You must be signed in to change notification settings - Fork 0
/
DocViewer.php
executable file
·34 lines (27 loc) · 1.08 KB
/
DocViewer.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
<?php
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This file is a MediaWiki extension, it is not a valid entry point' );
}
$GLOBALS['wgExtensionCredits']['parserhook'][] = array(
'path' => __FILE__,
'name' => 'DocViewer',
'version' => '0.1',
'url' => 'https://github.com/SimilisTools/mediawiki-DocViewer',
'author' => array( 'Toniher' ),
'descriptionmsg' => 'docviewer-desc',
);
$GLOBALS['wgAutoloadClasses']['DocViewer'] = __DIR__.'/DocViewer_body.php';
$GLOBALS['wgMessagesDirs']['DocViewer'] = __DIR__ . '/i18n';
$GLOBALS['wgExtensionMessagesFiles']['DocViewer'] = __DIR__ . '/DocViewer.i18n.php';
$GLOBALS['wgExtensionMessagesFiles']['DocViewerMagic'] = __DIR__ . '/DocViewer.i18n.magic.php';
$wgHooks['ParserFirstCallInit'][] = 'wfRegisterDocViewer';
// Path wrapup for ViewerJS -> This could be improved
$GLOBALS['wgDocViewerViewerJSPath'] = '/w/extensions/DocViewer/libs/ViewerJS#../../../../..';
/**
* @param $parser Parser
* @return bool
*/
function wfRegisterDocViewer( $parser ) {
$parser->setFunctionHook( 'docviewer', 'DocViewer::generateViewer', SFH_OBJECT_ARGS );
return true;
}