Index: trunk/extensions/SemanticMediaWiki/includes/SMW_PageSchemas.php |
— | — | @@ -11,6 +11,11 @@ |
12 | 12 | */ |
13 | 13 | |
14 | 14 | class SMWPageSchemas extends PSExtensionHandler { |
| 15 | + public static function registerClass() { |
| 16 | + global $wgPageSchemasHandlerClasses; |
| 17 | + $wgPageSchemasHandlerClasses[] = 'SMWPageSchemas'; |
| 18 | + return true; |
| 19 | + } |
15 | 20 | |
16 | 21 | public static function getDisplayColor() { |
17 | 22 | return '#DEF'; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php |
— | — | @@ -73,11 +73,6 @@ |
74 | 74 | return true; |
75 | 75 | } |
76 | 76 | |
77 | | -// Register class with the Page Schemas extension |
78 | | -if ( isset( $wgPageSchemasHandlerClasses ) ) { |
79 | | - $wgPageSchemasHandlerClasses[] = 'SMWPageSchemas'; |
80 | | -} |
81 | | - |
82 | 77 | /** |
83 | 78 | * Register all SMW hooks with MediaWiki. |
84 | 79 | */ |
— | — | @@ -88,6 +83,7 @@ |
89 | 84 | $wgHooks['LanguageGetMagic'][] = 'smwfAddMagicWords'; // setup names for parser functions (needed here) |
90 | 85 | $wgHooks['ParserTestTables'][] = 'smwfOnParserTestTables'; |
91 | 86 | $wgHooks['AdminLinks'][] = 'smwfAddToAdminLinks'; |
| 87 | + $wgHooks['PageSchemasRegisterHandlers'][] = 'SMWPageSchemas::registerClass'; |
92 | 88 | $wgHooks['ParserFirstCallInit'][] = 'SMWSMWDoc::staticInit'; |
93 | 89 | $wgHooks['LanguageGetMagic'][] = 'SMWSMWDoc::staticMagic'; |
94 | 90 | |
Index: trunk/extensions/SemanticForms/SemanticForms.php |
— | — | @@ -90,12 +90,8 @@ |
91 | 91 | $wgHooks['ParserBeforeStrip'][] = 'SFUtils::cacheFormDefinition'; |
92 | 92 | $wgHooks['ParserFirstCallInit'][] = 'SFParserFunctions::registerFunctions'; |
93 | 93 | $wgHooks['MakeGlobalVariablesScript'][] = 'SFFormUtils::setGlobalJSVariables'; |
| 94 | +$wgHooks['PageSchemasRegisterHandlers'][] = 'SFPageSchemas::registerClass'; |
94 | 95 | |
95 | | -// Register class with the Page Schemas extension |
96 | | -if ( isset( $wgPageSchemasHandlerClasses ) ) { |
97 | | - $wgPageSchemasHandlerClasses[] = 'SFPageSchemas'; |
98 | | -} |
99 | | - |
100 | 96 | $wgAPIModules['sfautocomplete'] = 'SFAutocompleteAPI'; |
101 | 97 | $wgAPIModules['sfautoedit'] = 'SFAutoeditAPI'; |
102 | 98 | |
Index: trunk/extensions/SemanticForms/includes/SF_PageSchemas.php |
— | — | @@ -10,6 +10,11 @@ |
11 | 11 | */ |
12 | 12 | |
13 | 13 | class SFPageSchemas extends PSExtensionHandler { |
| 14 | + public static function registerClass() { |
| 15 | + global $wgPageSchemasHandlerClasses; |
| 16 | + $wgPageSchemasHandlerClasses[] = 'SFPageSchemas'; |
| 17 | + return true; |
| 18 | + } |
14 | 19 | |
15 | 20 | /** |
16 | 21 | * Creates an object to hold form-wide information, based on an XML |
Index: trunk/extensions/SemanticDrilldown/includes/SD_PageSchemas.php |
— | — | @@ -8,6 +8,11 @@ |
9 | 9 | */ |
10 | 10 | |
11 | 11 | class SDPageSchemas extends PSExtensionHandler { |
| 12 | + public static function registerClass() { |
| 13 | + global $wgPageSchemasHandlerClasses; |
| 14 | + $wgPageSchemasHandlerClasses[] = 'SDPageSchemas'; |
| 15 | + return true; |
| 16 | + } |
12 | 17 | |
13 | 18 | /** |
14 | 19 | * Returns an object containing information on a filter, based on XML |
Index: trunk/extensions/SemanticDrilldown/SemanticDrilldown.php |
— | — | @@ -65,12 +65,8 @@ |
66 | 66 | $wgHooks['MagicWordwgVariableIDs'][] = 'SDUtils::addMagicWordVariableIDs'; |
67 | 67 | $wgHooks['LanguageGetMagic'][] = 'SDUtils::addMagicWordLanguage'; |
68 | 68 | $wgHooks['ParserBeforeTidy'][] = 'SDUtils::handleShowAndHide'; |
| 69 | +$wgHooks['PageSchemasRegisterHandlers'][] = 'SDPageSchemas::registerClass'; |
69 | 70 | |
70 | | -// Register class with the Page Schemas extension |
71 | | -if ( isset( $wgPageSchemasHandlerClasses ) ) { |
72 | | - $wgPageSchemasHandlerClasses[] = 'SDPageSchemas'; |
73 | | -} |
74 | | - |
75 | 71 | $wgPageProps['hidefromdrilldown'] = 'Whether or not the page is set as HIDEFROMDRILLDOWN'; |
76 | 72 | $wgPageProps['showindrilldown'] = 'Whether or not the page is set as SHOWINDRILLDOWN'; |
77 | 73 | |
Index: trunk/extensions/PageSchemas/PageSchemas.hooks.php |
— | — | @@ -12,6 +12,8 @@ |
13 | 13 | public static function register( &$parser ) { |
14 | 14 | // Register the hook with the parser |
15 | 15 | $parser->setHook( 'PageSchema', array( 'PageSchemasHooks', 'render' ) ); |
| 16 | + // Initialize the global array of "handler" classes |
| 17 | + wfRunHooks( 'PageSchemasRegisterHandlers' ); |
16 | 18 | return true; |
17 | 19 | } |
18 | 20 | |
Index: trunk/extensions/SemanticInternalObjects/SIO_PageSchemas.php |
— | — | @@ -10,6 +10,11 @@ |
11 | 11 | */ |
12 | 12 | |
13 | 13 | class SIOPageSchemas extends PSExtensionHandler { |
| 14 | + public static function registerClass() { |
| 15 | + global $wgPageSchemasHandlerClasses; |
| 16 | + $wgPageSchemasHandlerClasses[] = 'SIOPageSchemas'; |
| 17 | + return true; |
| 18 | + } |
14 | 19 | |
15 | 20 | public static function getDisplayColor() { |
16 | 21 | return '#FF8'; |
Index: trunk/extensions/SemanticInternalObjects/SemanticInternalObjects.php |
— | — | @@ -29,12 +29,8 @@ |
30 | 30 | $wgHooks['TitleMoveComplete'][] = 'SIOHandler::handlePageMove'; |
31 | 31 | $wgHooks['smwRefreshDataJobs'][] = 'SIOHandler::handleRefreshingOfInternalObjects'; |
32 | 32 | $wgHooks['smwAddToRDFExport'][] = 'SIOSQLStore::createRDF'; |
| 33 | +$wgHooks['PageSchemasRegisterHandlers'][] = 'SIOPageSchemas::registerClass'; |
33 | 34 | |
34 | | -// Register class with the Page Schemas extension |
35 | | -if ( isset( $wgPageSchemasHandlerClasses ) ) { |
36 | | - $wgPageSchemasHandlerClasses[] = 'SIOPageSchemas'; |
37 | | -} |
38 | | - |
39 | 35 | $siogIP = dirname( __FILE__ ); |
40 | 36 | $wgExtensionMessagesFiles['SemanticInternalObjects'] = $siogIP . '/SemanticInternalObjects.i18n.php'; |
41 | 37 | $wgAutoloadClasses['SIOHandler'] = $siogIP . '/SemanticInternalObjects_body.php'; |