r52973 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52972‎ | r52973 | r52974 >
Date:13:41, 9 July 2009
Author:yaron
Status:deferred
Tags:
Comment:
"Has XML grouping" now gets initialized as a special SMW property
Modified paths:
  • /trunk/extensions/DataTransfer/includes/DT_GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DataTransfer/includes/DT_GlobalFunctions.php
@@ -7,7 +7,7 @@
88
99 if (!defined('MEDIAWIKI')) die();
1010
11 -define('DT_VERSION','0.3.1');
 11+define('DT_VERSION','0.3.2');
1212
1313 // constants for special properties
1414 define('DT_SP_HAS_XML_GROUPING', 1);
@@ -36,6 +36,7 @@
3737 $wgAutoloadClasses['DTImportJob'] = $dtgIP . '/includes/DT_ImportJob.php';
3838 $wgAutoloadClasses['DTXMLParser'] = $dtgIP . '/includes/DT_XMLParser.php';
3939 $wgHooks['AdminLinks'][] = 'dtfAddToAdminLinks';
 40+$wgHooks['smwInitProperties'][] = 'dtfInitProperties';
4041
4142 require_once($dtgIP . '/languages/DT_Language.php');
4243 $wgExtensionMessagesFiles['DataTransfer'] = $dtgIP . '/languages/DT_Messages.php';
@@ -100,6 +101,15 @@
101102 /***** other global helpers *****/
102103 /**********************************************/
103104
 105+function dtfInitProperties() {
 106+ global $dtgContLang;
 107+ $dt_props = $dtgContLang->getPropertyLabels();
 108+ SMWPropertyValue::registerProperty('_DT_XG', '_str', $dt_props[DT_SP_HAS_XML_GROUPING], true);
 109+ // TODO - this should set a "backup" English value as well,
 110+ // so that the phrase "Has XML grouping" works in all languages
 111+ return true;
 112+}
 113+
104114 /**
105115 * Add links to the 'AdminLinks' special page, defined by the Admin Links
106116 * extension

Status & tagging log