-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDFRawFunctions.php
More file actions
58 lines (48 loc) · 1.97 KB
/
DFRawFunctions.php
File metadata and controls
58 lines (48 loc) · 1.97 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
<?php
/*
* DFRawFunctions extension by Quietust
* Dwarf Fortress Raw parser functions
*/
if (!defined('MEDIAWIKI'))
{
echo "This file is an extension of the MediaWiki software and cannot be used standalone\n";
die(1);
}
/*
* Configuration
* These may be overridden in LocalSettings.php
*/
// Whether or not to allow loading raws from disk
$wgDFRawEnableDisk = false;
// The directory which contains the raw folders and files
$wgDFRawPath = dirname(__FILE__) .'/raws';
/*
* Extension Logic - do not change anything below this line
*/
$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'DFRawFunctions',
'author' => 'Quietust',
'url' => 'http://dwarffortresswiki.org/index.php/User:Quietust',
'description' => 'Dwarf Fortress Raw parser functions',
'version' => '1.7.4',
);
$wgAutoloadClasses['DFRawFunctions'] = dirname(__FILE__) . '/DFRawFunctions.body.php';
$wgHooks['ParserFirstCallInit'][] = 'efDFRawFunctions_Initialize';
$wgExtensionMessagesFiles['DFRawFunctions'] = dirname(__FILE__) . '/DFRawFunctions.i18n.magic.php';
function efDFRawFunctions_Initialize (&$parser)
{
$parser->setFunctionHook('df_raw', 'DFRawFunctions::raw');
$parser->setFunctionHook('df_tag', 'DFRawFunctions::tag');
$parser->setFunctionHook('df_tagentry', 'DFRawFunctions::tagentry');
$parser->setFunctionHook('df_tagvalue', 'DFRawFunctions::tagvalue');
$parser->setFunctionHook('df_foreachtag', 'DFRawFunctions::foreachtag');
$parser->setFunctionHook('df_foreachtoken', 'DFRawFunctions::foreachtoken');
$parser->setFunctionHook('df_makelist', 'DFRawFunctions::makelist');
$parser->setFunctionHook('df_statedesc', 'DFRawFunctions::statedesc');
$parser->setFunctionHook('df_cvariation', 'DFRawFunctions::cvariation');
$parser->setFunctionHook('mreplace', 'DFRawFunctions::mreplace');
$parser->setFunctionHook('delay', 'DFRawFunctions::delay');
$parser->setFunctionHook('eval', 'DFRawFunctions::evaluate');
return true;
}