Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php |
— | — | @@ -31,44 +31,56 @@ |
32 | 32 | * @return true |
33 | 33 | */ |
34 | 34 | function enableSemantics( $namespace = null, $complete = false ) { |
35 | | - global $wgVersion, $wgFooterIcons, $wgExtensionFunctions, $wgAutoloadClasses, $wgSpecialPages; |
36 | | - global $wgSpecialPageGroups, $wgHooks, $wgExtensionMessagesFiles; |
37 | | - global $smwgIP, $smwgNamespace, $wgJobClasses, $wgExtensionAliasesFiles, $wgServer; |
38 | | - global $wgResourceModules, $smwgScriptPath, $wgAPIModules; |
39 | | - |
| 35 | + global $smwgIP, $wgFooterIcons, $wgExtensionFunctions, |
| 36 | + $wgExtensionMessagesFiles, $wgExtensionAliasesFiles, |
| 37 | + $smwgNamespace, $wgServer, $wgAPIModules; |
| 38 | + |
| 39 | + $wgExtensionFunctions[] = 'smwfSetupExtension'; |
| 40 | + $wgExtensionMessagesFiles['SemanticMediaWiki'] = $smwgIP . 'languages/SMW_Messages.php'; |
| 41 | + $wgExtensionAliasesFiles['SemanticMediaWiki'] = $smwgIP . 'languages/SMW_Aliases.php'; |
| 42 | + |
| 43 | + smwfRegisterHooks(); |
| 44 | + smwfRegisterResourceLoaderModules(); |
| 45 | + smwfRegisterClasses(); |
| 46 | + smwfRegisterSpecialPages(); |
| 47 | + |
| 48 | + $wgAPIModules['smwinfo'] = 'ApiSMWInfo'; |
| 49 | + |
40 | 50 | $wgFooterIcons['poweredby']['semanticmediawiki'] = array( |
41 | 51 | 'src' => null, |
42 | 52 | 'url' => 'http://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki', |
43 | 53 | 'alt' => 'Powered by Semantic MediaWiki', |
44 | 54 | ); |
45 | | - |
46 | | - // The dot tells that the domain is not complete. It will be completed |
47 | | - // in the Export since we do not want to create a title object here when |
48 | | - // it is not needed in many cases. |
49 | | - if ( $namespace === null ) { |
| 55 | + |
| 56 | + // Initialize base namespace for URIs in data exports: |
| 57 | + if ( $namespace === null ) { // fallback (bad because data URL will change depending on client URL) |
50 | 58 | wfWarn( 'You should be providing the domain name to enableSemantics()' ); |
51 | 59 | $namespace = parse_url( $wgServer, PHP_URL_HOST ); |
52 | 60 | } |
53 | 61 | if ( !$complete && ( $smwgNamespace !== '' ) ) { |
| 62 | + // The dot tells that the domain is not complete. It will be completed |
| 63 | + // in the Export since we do not want to create a title object here when |
| 64 | + // it is not needed in many cases. |
54 | 65 | $smwgNamespace = '.' . $namespace; |
55 | 66 | } else { |
56 | 67 | $smwgNamespace = $namespace; |
57 | 68 | } |
58 | 69 | |
59 | | - $wgExtensionFunctions[] = 'smwfSetupExtension'; |
60 | | - // FIXME: Can be removed when new style magic words are used (introduced in r52503) |
61 | | - $wgHooks['PageSchemasGetObject'][] = 'smwfCreatePageSchemasObject' ; //Hook for returning PageSchema(extension) object from a given xml |
62 | | - $wgHooks['PageSchemasGeneratePages'][] = 'smwfGeneratePages' ; //Hook for creating Pages |
63 | | - $wgHooks['getHtmlTextForFieldInputs'][] = 'smwfgetHtmlTextForPS' ; //Hook for retuning html text to PS schema |
64 | | - $wgHooks['getFilledHtmlTextForFieldInputs'][] = 'smwfgetFilledHtmlTextForPS' ; //Hook for retuning html text to PS schema |
65 | | - $wgHooks['getXmlTextForFieldInputs'][] = 'smwfgetXMLTextForPS' ; //Hook for retuning html text to PS schema |
66 | | - $wgHooks['PSParseFieldElements'][] = 'smwfParseFieldElements' ; //Hook for creating Pages |
67 | | - $wgHooks['PageSchemasGetPageList'][] = 'smwfGetPageList' ; //Hook for creating Pages |
68 | | - $wgHooks['LanguageGetMagic'][] = 'smwfAddMagicWords'; // setup names for parser functions (needed here) |
69 | | - $wgExtensionMessagesFiles['SemanticMediaWiki'] = $smwgIP . 'languages/SMW_Messages.php'; // register messages (requires MW=>1.11) |
| 70 | + return true; |
| 71 | +} |
70 | 72 | |
71 | | - $wgHooks['ParserTestTables'][] = 'smwfOnParserTestTables'; |
72 | | - $wgHooks['AdminLinks'][] = 'smwfAddToAdminLinks'; |
| 73 | +/** |
| 74 | + * Register all SMW hooks with MediaWiki. |
| 75 | + */ |
| 76 | +function smwfRegisterHooks() { |
| 77 | + global $wgHooks, $wgVersion; |
| 78 | + |
| 79 | + // FIXME: The following can be removed when new style magic words are used (introduced in r52503) |
| 80 | + $wgHooks['LanguageGetMagic'][] = 'smwfAddMagicWords'; // setup names for parser functions (needed here) |
| 81 | + $wgHooks['ParserTestTables'][] = 'smwfOnParserTestTables'; |
| 82 | + $wgHooks['AdminLinks'][] = 'smwfAddToAdminLinks'; |
| 83 | + $wgHooks['ParserFirstCallInit'][] = 'SMWSMWDoc::staticInit'; |
| 84 | + $wgHooks['LanguageGetMagic'][] = 'SMWSMWDoc::staticMagic'; |
73 | 85 | |
74 | 86 | if ( version_compare( $wgVersion, '1.17alpha', '>=' ) ) { |
75 | 87 | // For MediaWiki 1.17 alpha and later. |
— | — | @@ -78,7 +90,23 @@ |
79 | 91 | $wgHooks['SpecialVersionExtensionTypes'][] = 'smwfOldAddSemanticExtensionType'; |
80 | 92 | } |
81 | 93 | |
82 | | - // Register client-side modules |
| 94 | + /* Hooks related to Pageschemas extension. TODO: Should be moved to separate file. */ |
| 95 | + $wgHooks['PageSchemasGetObject'][] = 'smwfCreatePageSchemasObject' ; // Hook for returning PageSchema(extension) object from a given xml |
| 96 | + $wgHooks['PageSchemasGeneratePages'][] = 'smwfGeneratePages' ; // Hook for creating Pages |
| 97 | + $wgHooks['getHtmlTextForFieldInputs'][] = 'smwfgetHtmlTextForPS' ; // Hook for retuning html text to PS schema |
| 98 | + $wgHooks['getFilledHtmlTextForFieldInputs'][] = 'smwfgetFilledHtmlTextForPS' ; //Hook for retuning html text to PS schema |
| 99 | + $wgHooks['getXmlTextForFieldInputs'][] = 'smwfgetXMLTextForPS' ; // Hook for retuning html text to PS schema |
| 100 | + $wgHooks['PSParseFieldElements'][] = 'smwfParseFieldElements' ; // Hook for creating Pages |
| 101 | + $wgHooks['PageSchemasGetPageList'][] = 'smwfGetPageList' ; //Hook for creating Pages |
| 102 | + /* End: Hooks related to Pageschemas extension */ |
| 103 | +} |
| 104 | + |
| 105 | +/** |
| 106 | + * Register all SMW modules with the MediaWiki Resource Loader. |
| 107 | + */ |
| 108 | +function smwfRegisterResourceLoaderModules() { |
| 109 | + global $wgResourceModules, $smwgIP, $smwgScriptPath; |
| 110 | + |
83 | 111 | $moduleTemplate = array( |
84 | 112 | 'localBasePath' => $smwgIP . '/skins', |
85 | 113 | 'remoteBasePath' => $smwgScriptPath . '/skins', |
— | — | @@ -94,11 +122,14 @@ |
95 | 123 | 'ext.smw.style' |
96 | 124 | ) |
97 | 125 | ); |
| 126 | +} |
98 | 127 | |
99 | | - // Register special pages aliases file |
100 | | - $wgExtensionAliasesFiles['SemanticMediaWiki'] = $smwgIP . 'languages/SMW_Aliases.php'; |
| 128 | +/** |
| 129 | + * Register all SMW classes with the MediaWiki autoloader. |
| 130 | + */ |
| 131 | +function smwfRegisterClasses() { |
| 132 | + global $smwgIP, $wgAutoloadClasses, $wgJobClasses; |
101 | 133 | |
102 | | - // Set up autoloading; essentially all classes should be autoloaded! |
103 | 134 | $incDir = $smwgIP . 'includes/'; |
104 | 135 | $wgAutoloadClasses['SMWCompatibilityHelpers'] = $incDir . 'SMW_CompatibilityHelpers.php'; |
105 | 136 | $wgAutoloadClasses['SMWDataValueFactory'] = $incDir . 'SMW_DataValueFactory.php'; |
— | — | @@ -185,14 +216,14 @@ |
186 | 217 | |
187 | 218 | // Parser hooks |
188 | 219 | $phDir = $smwgIP . 'includes/parserhooks/'; |
189 | | - $wgAutoloadClasses['SMWAsk'] = $phDir . 'SMW_Ask.php'; |
190 | | - $wgAutoloadClasses['SMWShow'] = $phDir . 'SMW_Show.php'; |
191 | | - $wgAutoloadClasses['SMWInfo'] = $phDir . 'SMW_Info.php'; |
192 | | - $wgAutoloadClasses['SMWConcept'] = $phDir . 'SMW_Concept.php'; |
193 | | - $wgAutoloadClasses['SMWSet'] = $phDir . 'SMW_Set.php'; |
| 220 | + $wgAutoloadClasses['SMWAsk'] = $phDir . 'SMW_Ask.php'; |
| 221 | + $wgAutoloadClasses['SMWShow'] = $phDir . 'SMW_Show.php'; |
| 222 | + $wgAutoloadClasses['SMWInfo'] = $phDir . 'SMW_Info.php'; |
| 223 | + $wgAutoloadClasses['SMWConcept'] = $phDir . 'SMW_Concept.php'; |
| 224 | + $wgAutoloadClasses['SMWSet'] = $phDir . 'SMW_Set.php'; |
194 | 225 | $wgAutoloadClasses['SMWSetRecurringEvent'] = $phDir . 'SMW_SetRecurringEvent.php'; |
195 | | - $wgAutoloadClasses['SMWDeclare'] = $phDir . 'SMW_Declare.php'; |
196 | | - $wgAutoloadClasses['SMWSMWDoc'] = $phDir . 'SMW_SMWDoc.php'; |
| 226 | + $wgAutoloadClasses['SMWDeclare'] = $phDir . 'SMW_Declare.php'; |
| 227 | + $wgAutoloadClasses['SMWSMWDoc'] = $phDir . 'SMW_SMWDoc.php'; |
197 | 228 | |
198 | 229 | // Stores & queries |
199 | 230 | $wgAutoloadClasses['SMWQueryProcessor'] = $smwgIP . 'includes/SMW_QueryProcessor.php'; |
— | — | @@ -226,85 +257,88 @@ |
227 | 258 | $wgAutoloadClasses['SMWSQLHelpers'] = $stoDir . 'SMW_SQLHelpers.php'; |
228 | 259 | $wgAutoloadClasses['SMWSparqlStore'] = $stoDir . 'SMW_SparqlStore.php'; |
229 | 260 | $wgAutoloadClasses['SMWSparqlStoreQueryEngine'] = $stoDir . 'SMW_SparqlStoreQueryEngine.php'; |
| 261 | + $wgAutoloadClasses['SMWTestStore'] = $stoDir . 'SMW_TestStore.php'; |
230 | 262 | |
231 | 263 | // To ensure SMW remains compatible with pre 1.16. |
232 | 264 | if ( !class_exists( 'Html' ) ) { |
233 | 265 | $wgAutoloadClasses['Html'] = $smwgIP . 'compat/Html.php'; |
234 | 266 | } |
235 | 267 | |
236 | | - $wgHooks['ParserFirstCallInit'][] = 'SMWSMWDoc::staticInit'; |
237 | | - $wgHooks['LanguageGetMagic'][] = 'SMWSMWDoc::staticMagic'; |
238 | | - |
239 | | - $wgAutoloadClasses['SMWTestStore'] = $smwgIP . 'includes/storage/SMW_TestStore.php'; |
| 268 | + // Special pages and closely related helper classes |
| 269 | + $specDir = $smwgIP . 'specials/'; |
| 270 | + $wgAutoloadClasses['SMWQueryPage'] = $specDir . 'QueryPages/SMW_QueryPage.php'; |
| 271 | + $wgAutoloadClasses['SMWAskPage'] = $specDir . 'AskSpecial/SMW_SpecialAsk.php'; |
| 272 | + $wgAutoloadClasses['SMWQueryUIHelper'] = $specDir . 'AskSpecial/SMW_QueryUIHelper.php'; |
| 273 | + $wgAutoloadClasses['SMWQueryUI'] = $specDir . 'AskSpecial/SMW_QueryUI.php'; |
| 274 | + $wgAutoloadClasses['SMWQueryCreatorPage'] = $specDir . 'AskSpecial/SMW_SpecialQueryCreator.php'; |
| 275 | + $wgAutoloadClasses['SMWSpecialBrowse'] = $specDir . 'SearchTriple/SMW_SpecialBrowse.php'; |
| 276 | + $wgAutoloadClasses['SMWPageProperty'] = $specDir . 'SearchTriple/SMW_SpecialPageProperty.php'; |
| 277 | + $wgAutoloadClasses['SMWSearchByProperty'] = $specDir . 'SearchTriple/SMW_SpecialSearchByProperty.php'; |
| 278 | + $wgAutoloadClasses['SMWURIResolver'] = $specDir . 'URIResolver/SMW_SpecialURIResolver.php'; |
| 279 | + $wgAutoloadClasses['SMWAdmin'] = $specDir . 'SMWAdmin/SMW_SpecialSMWAdmin.php'; |
| 280 | + $wgAutoloadClasses['SMWSpecialSemanticStatistics'] = $specDir . 'Statistics/SMW_SpecialStatistics.php'; |
| 281 | + $wgAutoloadClasses['SMWSpecialOWLExport'] = $specDir . 'Export/SMW_SpecialOWLExport.php'; |
| 282 | + $wgAutoloadClasses['SMWSpecialProperties'] = $specDir . 'QueryPages/SMW_SpecialProperties.php'; |
| 283 | + $wgAutoloadClasses['SMWSpecialTypes'] = $specDir . 'QueryPages/SMW_SpecialTypes.php'; |
| 284 | + $wgAutoloadClasses['SMWSpecialUnusedProperties'] = $specDir . 'QueryPages/SMW_SpecialUnusedProperties.php'; |
| 285 | + $wgAutoloadClasses['SMWSpecialWantedProperties'] = $specDir . 'QueryPages/SMW_SpecialWantedProperties.php'; |
240 | 286 | |
241 | | - ///// Register specials, do that early on in case some other extension calls "addPage" ///// |
242 | | - $wgAutoloadClasses['SMWQueryPage'] = $smwgIP . 'specials/QueryPages/SMW_QueryPage.php'; |
243 | | - $wgAutoloadClasses['SMWAskPage'] = $smwgIP . 'specials/AskSpecial/SMW_SpecialAsk.php'; |
| 287 | + // Jobs |
| 288 | + $wgJobClasses['SMWUpdateJob'] = 'SMWUpdateJob'; |
| 289 | + $wgAutoloadClasses['SMWUpdateJob'] = $smwgIP . 'includes/jobs/SMW_UpdateJob.php'; |
| 290 | + $wgJobClasses['SMWRefreshJob'] = 'SMWRefreshJob'; |
| 291 | + $wgAutoloadClasses['SMWRefreshJob'] = $smwgIP . 'includes/jobs/SMW_RefreshJob.php'; |
| 292 | + |
| 293 | + // API modules |
| 294 | + //$wgAutoloadClasses['ApiSMWQuery'] = $smwgIP . 'includes/api/ApiSMWQuery.php'; |
| 295 | + //$wgAPIModules['smwquery'] = 'ApiSMWQuery'; |
| 296 | + $wgAutoloadClasses['ApiSMWInfo'] = $smwgIP . 'includes/api/ApiSMWInfo.php'; |
| 297 | +} |
| 298 | + |
| 299 | +/** |
| 300 | + * Register all SMW special pages with MediaWiki. |
| 301 | + */ |
| 302 | +function smwfRegisterSpecialPages() { |
| 303 | + global $wgSpecialPages, $wgSpecialPageGroups; |
| 304 | + |
244 | 305 | $wgSpecialPages['Ask'] = 'SMWAskPage'; |
245 | 306 | $wgSpecialPageGroups['Ask'] = 'smw_group'; |
246 | 307 | |
247 | | - /* Query Creator disabled for release SMW 1.6 |
248 | | - $wgAutoloadClasses['SMWQueryCreatorPage'] = $smwgIP . 'specials/AskSpecial/SMW_SpecialQueryCreator.php'; |
249 | | - $wgSpecialPages['QueryCreator'] = 'SMWQueryCreatorPage'; |
250 | | - $wgSpecialPageGroups['QueryCreator'] = 'smw_group'; |
251 | | - */ |
252 | | - $wgAutoloadClasses['SMWSpecialBrowse'] = $smwgIP . 'specials/SearchTriple/SMW_SpecialBrowse.php'; |
| 308 | + /* Query Creator currently still disabled by default: */ |
| 309 | +// $wgSpecialPages['QueryCreator'] = 'SMWQueryCreatorPage'; |
| 310 | +// $wgSpecialPageGroups['QueryCreator'] = 'smw_group'; |
| 311 | + |
253 | 312 | $wgSpecialPages['Browse'] = 'SMWSpecialBrowse'; |
254 | 313 | $wgSpecialPageGroups['Browse'] = 'smw_group'; |
255 | 314 | |
256 | | - $wgAutoloadClasses['SMWPageProperty'] = $smwgIP . 'specials/SearchTriple/SMW_SpecialPageProperty.php'; |
257 | 315 | $wgSpecialPages['PageProperty'] = 'SMWPageProperty'; |
258 | 316 | $wgSpecialPageGroups['PageProperty'] = 'smw_group'; |
259 | 317 | |
260 | | - $wgAutoloadClasses['SMWSearchByProperty'] = $smwgIP . 'specials/SearchTriple/SMW_SpecialSearchByProperty.php'; |
261 | 318 | $wgSpecialPages['SearchByProperty'] = 'SMWSearchByProperty'; |
262 | 319 | $wgSpecialPageGroups['SearchByProperty'] = 'smw_group'; |
263 | 320 | |
264 | | - $wgAutoloadClasses['SMWURIResolver'] = $smwgIP . 'specials/URIResolver/SMW_SpecialURIResolver.php'; |
265 | 321 | $wgSpecialPages['URIResolver'] = 'SMWURIResolver'; |
266 | 322 | |
267 | | - $wgAutoloadClasses['SMWAdmin'] = $smwgIP . 'specials/SMWAdmin/SMW_SpecialSMWAdmin.php'; |
268 | 323 | $wgSpecialPages['SMWAdmin'] = 'SMWAdmin'; |
269 | 324 | $wgSpecialPageGroups['SMWAdmin'] = 'smw_group'; |
270 | 325 | |
271 | | - $wgAutoloadClasses['SMWSpecialSemanticStatistics'] = $smwgIP . 'specials/Statistics/SMW_SpecialStatistics.php'; |
272 | 326 | $wgSpecialPages['SemanticStatistics'] = 'SMWSpecialSemanticStatistics'; |
273 | 327 | $wgSpecialPageGroups['SemanticStatistics'] = 'wiki'; // Similar to Special:Statistics |
274 | 328 | |
275 | | - $wgAutoloadClasses['SMWSpecialOWLExport'] = $smwgIP . 'specials/Export/SMW_SpecialOWLExport.php'; |
276 | 329 | $wgSpecialPages['ExportRDF'] = 'SMWSpecialOWLExport'; |
277 | 330 | $wgSpecialPageGroups['ExportRDF'] = 'smw_group'; |
278 | 331 | |
279 | | - $wgAutoloadClasses['SMWSpecialProperties'] = $smwgIP . 'specials/QueryPages/SMW_SpecialProperties.php'; |
280 | 332 | $wgSpecialPages['Properties'] = 'SMWSpecialProperties'; |
281 | 333 | $wgSpecialPageGroups['Properties'] = 'pages'; |
282 | 334 | |
283 | | - $wgAutoloadClasses['SMWSpecialTypes'] = $smwgIP . 'specials/QueryPages/SMW_SpecialTypes.php'; |
284 | 335 | $wgSpecialPages['Types'] = 'SMWSpecialTypes'; |
285 | 336 | $wgSpecialPageGroups['Types'] = 'pages'; |
286 | 337 | |
287 | | - $wgAutoloadClasses['SMWSpecialUnusedProperties'] = $smwgIP . 'specials/QueryPages/SMW_SpecialUnusedProperties.php'; |
288 | 338 | $wgSpecialPages['UnusedProperties'] = 'SMWSpecialUnusedProperties'; |
289 | 339 | $wgSpecialPageGroups['UnusedProperties'] = 'maintenance'; |
290 | 340 | |
291 | | - $wgAutoloadClasses['SMWSpecialWantedProperties'] = $smwgIP . 'specials/QueryPages/SMW_SpecialWantedProperties.php'; |
292 | 341 | $wgSpecialPages['WantedProperties'] = 'SMWSpecialWantedProperties'; |
293 | 342 | $wgSpecialPageGroups['WantedProperties'] = 'maintenance'; |
294 | | - |
295 | | - // Register Jobs |
296 | | - $wgJobClasses['SMWUpdateJob'] = 'SMWUpdateJob'; |
297 | | - $wgAutoloadClasses['SMWUpdateJob'] = $smwgIP . 'includes/jobs/SMW_UpdateJob.php'; |
298 | | - |
299 | | - $wgJobClasses['SMWRefreshJob'] = 'SMWRefreshJob'; |
300 | | - $wgAutoloadClasses['SMWRefreshJob'] = $smwgIP . 'includes/jobs/SMW_RefreshJob.php'; |
301 | | - |
302 | | - //$wgAutoloadClasses['ApiSMWQuery'] = $smwgIP . 'includes/api/ApiSMWQuery.php'; |
303 | | - //$wgAPIModules['smwquery'] = 'ApiSMWQuery'; |
304 | | - |
305 | | - $wgAutoloadClasses['ApiSMWInfo'] = $smwgIP . 'includes/api/ApiSMWInfo.php'; |
306 | | - $wgAPIModules['smwinfo'] = 'ApiSMWInfo'; |
307 | | - |
308 | | - return true; |
309 | 343 | } |
310 | 344 | |
311 | 345 | /** |
— | — | @@ -424,11 +458,11 @@ |
425 | 459 | |
426 | 460 | |
427 | 461 | /** |
428 | | - * Register special classes for displaying semantic content on Property/Type |
429 | | - * pages. |
| 462 | + * Register special classes for displaying semantic content on Property and |
| 463 | + * Concept pages. |
430 | 464 | * |
431 | | - * @param $title: Title |
432 | | - * @param $article: Article or null |
| 465 | + * @param $title Title |
| 466 | + * @param $article Article or null |
433 | 467 | * |
434 | 468 | * @return true |
435 | 469 | */ |
— | — | @@ -528,27 +562,28 @@ |
529 | 563 | |
530 | 564 | function smwfParseFieldElements( $field_xml, &$text_object ) { |
531 | 565 | foreach ( $field_xml->children() as $tag => $child ) { |
532 | | - if ( $tag == "Property" ) { |
533 | | - $text = ""; |
534 | | - $text = PageSchemas::tableMessageRowHTML( "paramAttr", "SemanticMediaWiki", (string)$tag ); |
535 | | - $propName = $child->attributes()->name; |
536 | | - //this means object has already been initialized by some other extension. |
537 | | - $text .= PageSchemas::tableMessageRowHTML( "paramAttrMsg", "name", (string)$propName ); |
538 | | - foreach ( $child->children() as $prop => $value ) { |
539 | | - $text .= PageSchemas::tableMessageRowHTML("paramAttrMsg", $prop, (string)$value ); |
540 | | - } |
541 | | - $text_object['smw']=$text; |
542 | | - } |
| 566 | + if ( $tag == "Property" ) { |
| 567 | + $text = ""; |
| 568 | + $text = PageSchemas::tableMessageRowHTML( "paramAttr", "SemanticMediaWiki", (string)$tag ); |
| 569 | + $propName = $child->attributes()->name; |
| 570 | + //this means object has already been initialized by some other extension. |
| 571 | + $text .= PageSchemas::tableMessageRowHTML( "paramAttrMsg", "name", (string)$propName ); |
| 572 | + foreach ( $child->children() as $prop => $value ) { |
| 573 | + $text .= PageSchemas::tableMessageRowHTML("paramAttrMsg", $prop, (string)$value ); |
| 574 | + } |
| 575 | + $text_object['smw']=$text; |
543 | 576 | } |
544 | | - return true; |
| 577 | + } |
| 578 | + return true; |
545 | 579 | } |
| 580 | + |
546 | 581 | function smwfGetPageList( $psSchemaObj , &$genPageList ) { |
547 | 582 | $template_all = $psSchemaObj->getTemplates(); |
548 | 583 | foreach ( $template_all as $template ) { |
549 | 584 | $field_all = $template->getFields(); |
550 | 585 | $field_count = 0; //counts the number of fields |
551 | 586 | foreach( $field_all as $field ) { //for each Field, retrieve smw properties and fill $prop_name , $prop_type |
552 | | - $field_count++; |
| 587 | + $field_count++; |
553 | 588 | $smw_array = $field->getObject('Property'); //this returns an array with property values filled |
554 | 589 | $prop_array = $smw_array['smw']; |
555 | 590 | if($prop_array != null){ |
— | — | @@ -559,6 +594,7 @@ |
560 | 595 | } |
561 | 596 | return true; |
562 | 597 | } |
| 598 | + |
563 | 599 | function smwfgetXMLTextForPS( $wgRequest, &$text_extensions ){ |
564 | 600 | |
565 | 601 | $Xmltext = ""; |