Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_setup.php |
— | — | @@ -20,6 +20,7 @@ |
21 | 21 | require_once($smwgIP . '/includes/SMW_GlobalFunctions.php'); |
22 | 22 | |
23 | 23 | smwfGetStore()->setup(); |
| 24 | +wfRunHooks('smwInitializeTables'); |
24 | 25 | |
25 | 26 | print "\n\nDone.\n"; |
26 | 27 | |
Index: trunk/extensions/SemanticMediaWiki/specials/SMWAdmin/SMW_SpecialSMWAdmin.php |
— | — | @@ -53,6 +53,7 @@ |
54 | 54 | print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\" dir=\"ltr\">\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Setting up Storage for Semantic MediaWiki</title></head><body><p><pre>"; |
55 | 55 | header( "Content-type: text/html; charset=UTF-8" ); |
56 | 56 | $result = smwfGetStore()->setup(); |
| 57 | + wfRunHooks('smwInitializeTables'); |
57 | 58 | print '</pre></p>'; |
58 | 59 | if ($result === true) { |
59 | 60 | print '<p><b>The storage engine was set up successfully.</b></p>'; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValueFactory.php |
— | — | @@ -113,8 +113,12 @@ |
114 | 114 | case SMW_SP_SUBPROPERTY_OF: |
115 | 115 | $result = SMWDataValueFactory::newTypeIDValue('_wpg', $value, $caption); |
116 | 116 | break; |
117 | | - default: // special property was created but not added here; this is bad but we still are nice |
118 | | - $result = SMWDataValueFactory::newTypeIDValue('_str', $value, $caption); |
| 117 | + default: |
| 118 | + /// NOTE: unstable hook, future versions might have better ways of enabling extensions to add properties |
| 119 | + wfRunHooks('smwNewSpecialValue', array($specialprop, $value, $caption, &$result)); |
| 120 | + if (!isset($result)) { // special property was created but not added here; this is bad but we still are nice |
| 121 | + $result = SMWDataValueFactory::newTypeIDValue('_str', $value, $caption); |
| 122 | + } |
119 | 123 | } |
120 | 124 | |
121 | 125 | if ($value !== false) { |