-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegistration.php
More file actions
65 lines (54 loc) · 2.07 KB
/
Registration.php
File metadata and controls
65 lines (54 loc) · 2.07 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/*
* @(#)Registration.php 0.00 Aug 13, 2009
* Author: Jim Steinberger
*
* Copyright (c) 2009 University of Michigan
* Ann Arbor, MI, 48109, USA
* All Rights Reserved.
*
* This software is the proprietary information of the University of Michigan
* ("Proprietary Information"). You shall use it only in accordance with the
* terms of the license agreement you entered into with the University of
* Michigan.
*/
//require_once( __DIR__ . "/tags/EntityInfoTag.php" );
use ModelDoc\Tags;
require_once( __DIR__ . "/tags/DataSourceListTag.php" );
require_once( __DIR__ . "/tags/EntityInfoTag.php" );
require_once( __DIR__ . "/tags/EntityListTag.php" );
require_once( __DIR__ . "/tags/PreventCacheTag.php" );
require_once( __DIR__ . "/tags/RefreshEntityTag.php" );
require_once( __DIR__ . "/tags/TestTag.php" );
require_once( __DIR__ . "/tags/DemoFieldTag.php" );
require_once( __DIR__ . "/Configuration.php" );
$wgHooks['ParserFirstCallInit'][] = 'registerDBWikiTags';
/**
* Registers the tags and their implementations
*/
function registerDBWikiTags(&$parser) {
global $mdConfiguration;
$mdConfiguration = new \ModelDoc\Configuration( __DIR__ . "/config.xml" );
$mdConfiguration->loadDatasourcesFromWiki();
$parser->setHook('entity-list',
array(new Tags\EntityListTag(), "mediaWikiHook"));
$parser->setHook('datasource-list',
array(new Tags\DataSourceListTag(), "mediaWikiHook"));
$parser->setHook('entity-info',
array(new Tags\EntityInfoTag(), "mediaWikiHook"));
$parser->setHook('prevent-caching',
array(new Tags\PreventCacheTag(), "mediaWikiHook"));
$parser->setHook('test-tag',
array(new Tags\TestTag(), 'mediaWikiHook'));
$parser->setHook('refresh-entity',
array(new Tags\RefreshEntityTag(), 'mediaWikiHook'));
// Tags for demo
$parser->setHook('demo-field',
array(new Tags\DemoFieldTag(), "mediaWikiHook"));
return true;
}
//$wgExtensionFunctions[] = 'registerDBWikiTags';
$wgExtensionCredits['parserHook'][] = array(
'name' => 'ModelDoc',
'author' => 'U of M',
'url' => 'http://www.eecs.umich.edu');