r41807 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41806‎ | r41807 | r41808 >
Date:14:11, 7 October 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
new propery data value, will be used for all properties at some point
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Property.php (added) (history)
  • /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
@@ -117,7 +117,10 @@
118118 case SMW_SP_CONVERSION_FACTOR: case SMW_SP_POSSIBLE_VALUE:
119119 $result = SMWDataValueFactory::newTypeIDValue('_str', $value, $caption);
120120 break;
121 - case SMW_SP_SUBPROPERTY_OF: case SMW_SP_SUBCLASS_OF: case SMW_SP_REDIRECTS_TO:
 121+ case SMW_SP_SUBPROPERTY_OF:
 122+ $result = SMWDataValueFactory::newTypeIDValue('_pro', $value, $caption);
 123+ break;
 124+ case SMW_SP_SUBCLASS_OF: case SMW_SP_REDIRECTS_TO:
122125 case SMW_SP_INSTANCE_OF:
123126 $result = SMWDataValueFactory::newTypeIDValue('_wpg', $value, $caption);
124127 break;
@@ -272,6 +275,7 @@
273276 '_uri' => 'SMWURIValue',
274277 '_anu' => 'SMWURIValue',
275278 '_wpg' => 'SMWWikiPageValue',
 279+ '_pro' => 'SMWPropertyValue',
276280 '_num' => 'SMWNumberValue',
277281 '_tem' => 'SMWTemperatureValue',
278282 '_dat' => 'SMWTimeValue',
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Property.php
@@ -0,0 +1,19 @@
 2+<?php
 3+/**
 4+ * @file
 5+ * @ingroup SMWDataValues
 6+ */
 7+
 8+/**
 9+ * Objects of this class represent properties in SMW.
 10+ *
 11+ * @author Markus Krötzsch
 12+ * @ingroup SMWDataValues
 13+ */
 14+class SMWPropertyValue extends SMWWikiPageValue {
 15+
 16+ public function __construct($typeid) {
 17+ parent::__construct($typeid);
 18+ $this->m_fixNamespace = SMW_NS_PROPERTY;
 19+ }
 20+}
Property changes on: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Property.php
___________________________________________________________________
Added: svn:eol-style
121 + native
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php
@@ -145,6 +145,7 @@
146146 $wgAutoloadClasses['SMWErrorvalue'] = $smwgIP . '/includes/SMW_DV_Error.php';
147147 $wgAutoloadClasses['SMWStringValue'] = $smwgIP . '/includes/SMW_DV_String.php';
148148 $wgAutoloadClasses['SMWWikiPageValue'] = $smwgIP . '/includes/SMW_DV_WikiPage.php';
 149+ $wgAutoloadClasses['SMWPropertyValue'] = $smwgIP . '/includes/SMW_DV_Property.php';
149150 $wgAutoloadClasses['SMWURIValue'] = $smwgIP . '/includes/SMW_DV_URI.php';
150151 $wgAutoloadClasses['SMWTypesValue'] = $smwgIP . '/includes/SMW_DV_Types.php';
151152 $wgAutoloadClasses['SMWNAryValue'] = $smwgIP . '/includes/SMW_DV_NAry.php';

Status & tagging log