Index: trunk/extensions/DataTransfer/includes/DT_GlobalFunctions.php |
— | — | @@ -13,59 +13,25 @@ |
14 | 14 | define('DT_SP_HAS_XML_GROUPING', 1); |
15 | 15 | define('DT_SP_IS_EXCLUDED_FROM_XML', 2); |
16 | 16 | |
17 | | -$wgExtensionFunctions[] = 'dtgSetupExtension'; |
| 17 | +$wgExtensionCredits['specialpage'][]= array( |
| 18 | + 'name' => 'Data Transfer', |
| 19 | + 'version' => DT_VERSION, |
| 20 | + 'author' => 'Yaron Koren', |
| 21 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:Data_Transfer', |
| 22 | + 'description' => 'Exports wiki pages as XML, using template calls as the data structure', |
| 23 | + 'descriptionmsg' => 'dt-desc', |
| 24 | +); |
18 | 25 | |
19 | 26 | $dtgIP = $IP . '/extensions/DataTransfer'; |
20 | | -require_once($dtgIP . '/languages/DT_Language.php'); |
21 | 27 | |
22 | | -if (version_compare($wgVersion, '1.11', '>=' )) { |
23 | | - $wgExtensionMessagesFiles['DataTransfer'] = $dtgIP . '/languages/DT_Messages.php'; |
24 | | -} else { |
25 | | - $wgExtensionFunctions[] = 'dtfLoadMessagesManually'; |
26 | | -} |
| 28 | +// register all special pages and other classes |
| 29 | +$wgSpecialPages['ViewXML'] = 'DTViewXML'; |
| 30 | +$wgAutoloadClasses['DTViewXML'] = $dtgIP . '/specials/DT_ViewXML.php'; |
27 | 31 | |
28 | | -/** |
29 | | - * Do the actual intialisation of the extension. This is just a delayed init that makes sure |
30 | | - * MediaWiki is set up properly before we add our stuff. |
31 | | - */ |
32 | | -function dtgSetupExtension() { |
33 | | - global $dtgIP, $dtgVersion, $dtgNamespace; |
34 | | - global $wgVersion, $wgLanguageCode, $wgExtensionCredits; |
| 32 | +require_once($dtgIP . '/languages/DT_Language.php'); |
| 33 | +$wgExtensionMessagesFiles['DataTransfer'] = $dtgIP . '/languages/DT_Messages.php'; |
35 | 34 | |
36 | | - if (version_compare($wgVersion, '1.11', '>=')) |
37 | | - wfLoadExtensionMessages('DataTransfer'); |
38 | | - |
39 | | - dtfInitContentLanguage($wgLanguageCode); |
40 | | - |
41 | | - /**********************************************/ |
42 | | - /***** register specials *****/ |
43 | | - /**********************************************/ |
44 | | - require_once($dtgIP . '/specials/DT_ViewXML.php'); |
45 | | - |
46 | | - /**********************************************/ |
47 | | - /***** register hooks *****/ |
48 | | - /**********************************************/ |
49 | | - |
50 | | - /**********************************************/ |
51 | | - /***** credits (see "Special:Version") *****/ |
52 | | - /**********************************************/ |
53 | | - $wgExtensionCredits['specialpage'][]= array( |
54 | | - 'name' => 'Data Transfer', |
55 | | - 'version' => DT_VERSION, |
56 | | - 'author' => 'Yaron Koren', |
57 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:Data_Transfer', |
58 | | - 'description' => 'Exports wiki pages as XML, using template calls as the data structure', |
59 | | - 'descriptionmsg' => 'dt-desc', |
60 | | - ); |
61 | | - |
62 | | - return true; |
63 | | -} |
64 | | - |
65 | 35 | /**********************************************/ |
66 | | -/***** namespace settings *****/ |
67 | | -/**********************************************/ |
68 | | - |
69 | | -/**********************************************/ |
70 | 36 | /***** language settings *****/ |
71 | 37 | /**********************************************/ |
72 | 38 | |
— | — | @@ -120,20 +86,6 @@ |
121 | 87 | } |
122 | 88 | } |
123 | 89 | |
124 | | -/** |
125 | | - * Setting of message cache for versions of MediaWiki that do not support |
126 | | - * wgExtensionMessagesFiles |
127 | | - */ |
128 | | -function dtfLoadMessagesManually() { |
129 | | - global $dtgIP, $wgMessageCache; |
130 | | - |
131 | | - # add messages |
132 | | - require($dtgIP . '/languages/DT_Messages.php'); |
133 | | - foreach($messages as $key => $value) { |
134 | | - $wgMessageCache->addMessages($messages[$key], $key); |
135 | | - } |
136 | | -} |
137 | | - |
138 | 90 | /**********************************************/ |
139 | 91 | /***** other global helpers *****/ |
140 | 92 | /**********************************************/ |