Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | * does not adhere to the naming conventions. |
46 | 46 | */ |
47 | 47 | function enableSemantics($namespace = '', $complete = false) { |
48 | | - global $smwgNamespace, $wgExtensionFunctions; |
| 48 | + global $smwgNamespace, $wgExtensionFunctions, $wgSpecialPages, $wgAutoloadClasses, $smwgIP; |
49 | 49 | // The dot tells that the domain is not complete. It will be completed |
50 | 50 | // in the Export since we do not want to create a title object here when |
51 | 51 | // it is not needed in many cases. |
— | — | @@ -54,34 +54,7 @@ |
55 | 55 | $smwgNamespace = $namespace; |
56 | 56 | } |
57 | 57 | $wgExtensionFunctions[] = 'smwfSetupExtension'; |
58 | | - return true; |
59 | | -} |
60 | 58 | |
61 | | -/** |
62 | | - * Do the actual intialisation of the extension. This is just a delayed init that makes sure |
63 | | - * MediaWiki is set up properly before we add our stuff. |
64 | | - */ |
65 | | -function smwfSetupExtension() { |
66 | | - wfProfileIn('smwfSetupExtension (SMW)'); |
67 | | - global $smwgIP, $smwgStoreActive, $wgHooks, $wgExtensionCredits, $smwgEnableTemplateSupport, $smwgMasterStore, $wgSpecialPages, $wgAutoloadClasses; |
68 | | - |
69 | | - /** |
70 | | - * Setting this to false prevents any new data from being stored in |
71 | | - * the static SMWSemanticData store, and disables printing of the |
72 | | - * factbox, and clearing of the existing data. |
73 | | - * This is a hack to enable parsing of included articles in a save |
74 | | - * way without importing their annotations. Unfortunately, there |
75 | | - * appears to be no way for finding out whether the current parse |
76 | | - * is the "main" parse, or whether some intro, docu, or whatever |
77 | | - * text is parsed. Using the hook mechanism, we have to rely on |
78 | | - * globals/static fields -- so we cannot somehow differentiate this |
79 | | - * store between parsers. |
80 | | - */ |
81 | | - $smwgStoreActive = true; |
82 | | - |
83 | | - $smwgMasterStore = NULL; |
84 | | - smwfInitContentMessages(); |
85 | | - |
86 | 59 | ///// setup some autoloading ///// |
87 | 60 | $wgAutoloadClasses['SMWResultPrinter'] = $smwgIP . '/includes/SMW_QueryPrinter.php'; |
88 | 61 | $wgAutoloadClasses['SMWTableResultPrinter'] = $smwgIP . '/includes/SMW_QP_Table.php'; |
— | — | @@ -90,7 +63,7 @@ |
91 | 64 | $wgAutoloadClasses['SMWEmbeddedResultPrinter'] = $smwgIP . '/includes/SMW_QP_Embedded.php'; |
92 | 65 | $wgAutoloadClasses['SMWTemplateResultPrinter'] = $smwgIP . '/includes/SMW_QP_Template.php'; |
93 | 66 | |
94 | | - ///// register specials ///// |
| 67 | + ///// register specials, do that early on in case some other extension calls "addPage" ///// |
95 | 68 | $wgAutoloadClasses['SMWAskPage'] = $smwgIP . '/specials/AskSpecial/SMW_SpecialAsk.php'; |
96 | 69 | $wgSpecialPages['Ask'] = array('SMWAskPage'); |
97 | 70 | $wgAutoloadClasses['SMWSpecialBrowse'] = $smwgIP . '/specials/SearchTriple/SMW_SpecialBrowse.php'; |
— | — | @@ -112,8 +85,34 @@ |
113 | 86 | $wgSpecialPages['SemanticStatistics'] = array('SMWSpecialPage','SemanticStatistics', 'smwfExecuteSemanticStatistics', $smwgIP . '/specials/Statistics/SMW_SpecialStatistics.php'); |
114 | 87 | $wgSpecialPages['Types'] = array('SMWSpecialPage','Types', 'smwfDoSpecialTypes', $smwgIP . '/specials/QueryPages/SMW_SpecialTypes.php'); |
115 | 88 | |
116 | | - //require_once($smwgIP . '/specials/OntologyImport/SMW_SpecialOntologyImport.php'); // broken, TODO: fix or delete |
| 89 | + return true; |
| 90 | +} |
117 | 91 | |
| 92 | +/** |
| 93 | + * Do the actual intialisation of the extension. This is just a delayed init that makes sure |
| 94 | + * MediaWiki is set up properly before we add our stuff. |
| 95 | + */ |
| 96 | +function smwfSetupExtension() { |
| 97 | + wfProfileIn('smwfSetupExtension (SMW)'); |
| 98 | + global $smwgIP, $smwgStoreActive, $wgHooks, $wgExtensionCredits, $smwgEnableTemplateSupport, $smwgMasterStore; |
| 99 | + |
| 100 | + /** |
| 101 | + * Setting this to false prevents any new data from being stored in |
| 102 | + * the static SMWSemanticData store, and disables printing of the |
| 103 | + * factbox, and clearing of the existing data. |
| 104 | + * This is a hack to enable parsing of included articles in a save |
| 105 | + * way without importing their annotations. Unfortunately, there |
| 106 | + * appears to be no way for finding out whether the current parse |
| 107 | + * is the "main" parse, or whether some intro, docu, or whatever |
| 108 | + * text is parsed. Using the hook mechanism, we have to rely on |
| 109 | + * globals/static fields -- so we cannot somehow differentiate this |
| 110 | + * store between parsers. |
| 111 | + */ |
| 112 | + $smwgStoreActive = true; |
| 113 | + |
| 114 | + $smwgMasterStore = NULL; |
| 115 | + smwfInitContentMessages(); // this really could not be done in enableSemantics() |
| 116 | + |
118 | 117 | ///// register hooks ///// |
119 | 118 | require_once($smwgIP . '/includes/SMW_Hooks.php'); |
120 | 119 | require_once($smwgIP . '/includes/SMW_RefreshTab.php'); |