r35865 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35864‎ | r35865 | r35866 >
Date:16:04, 4 June 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
relabelling of new constant, add SUBCLASS_OF relations from parserOutput
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_DataValueFactory.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValueFactory.php
@@ -112,7 +112,7 @@
113113 case SMW_SP_CONVERSION_FACTOR: case SMW_SP_POSSIBLE_VALUE:
114114 $result = SMWDataValueFactory::newTypeIDValue('_str', $value, $caption);
115115 break;
116 - case SMW_SP_SUBPROPERTY_OF: case SMW_SP_SUBCATEGORY_OF: case SMW_SP_REDIRECTS_TO:
 116+ case SMW_SP_SUBPROPERTY_OF: case SMW_SP_SUBCLASS_OF: case SMW_SP_REDIRECTS_TO:
117117 case SMW_SP_INSTANCE_OF:
118118 $result = SMWDataValueFactory::newTypeIDValue('_wpg', $value, $caption);
119119 break;
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php
@@ -20,7 +20,7 @@
2121 define('SMW_SP_POSSIBLE_VALUE', 14);
2222 define('SMW_SP_REDIRECTS_TO', 15);
2323 define('SMW_SP_SUBPROPERTY_OF',17);
24 -define('SMW_SP_SUBCATEGORY_OF',18);
 24+define('SMW_SP_SUBCLASS_OF',18);
2525
2626 // old names, will be removed *two* releases after given version
2727 // SMW 1.1.1
@@ -300,6 +300,9 @@
301301 $dv = SMWDataValueFactory::newSpecialValue(SMW_SP_INSTANCE_OF);
302302 $dv->setValues($name,NS_CATEGORY);
303303 SMWFactbox::$semdata->addSpecialValue(SMW_SP_INSTANCE_OF,$dv);
 304+ if (SMWFactbox::$semdata->getSubject()->getNamespace() == NS_CATEGORY) {
 305+ SMWFactbox::$semdata->addSpecialValue(SMW_SP_SUBCLASS_OF,$dv);
 306+ }
304307 }
305308 return true;
306309 }

Status & tagging log