Index: trunk/extensions/WikiObjectModel/includes/models/WOM_OM_Property.php |
— | — | @@ -37,7 +37,11 @@ |
38 | 38 | $value = "{$value}|{$caption}"; |
39 | 39 | $caption = ''; |
40 | 40 | } else { |
41 | | - $smwdatavalue = SMWDataValueFactory::newPropertyObjectValue( $user_property, $value, $caption ); |
| 41 | + if ( version_compare ( SMW_VERSION, '1.6', '>=' ) ) { |
| 42 | + $smwdatavalue = SMWDataValueFactory::newPropertyObjectValue( $user_property->getDataItem(), $value, $caption ); |
| 43 | + } else { |
| 44 | + $smwdatavalue = SMWDataValueFactory::newPropertyObjectValue( $user_property, $value, $caption ); |
| 45 | + } |
42 | 46 | } |
43 | 47 | |
44 | 48 | $this->m_user_property = $user_property; |
Index: trunk/extensions/WikiObjectModel/includes/apis/WOM_OutputProcessor.php |
— | — | @@ -207,21 +207,38 @@ |
208 | 208 | // fill in semantic properties |
209 | 209 | $properties = array(); |
210 | 210 | foreach ( $semdata->getProperties() as $property ) { |
| 211 | + $label = ''; |
211 | 212 | if ( !$property->isShown() ) { // showing this is not desired, hide |
212 | 213 | continue; |
213 | 214 | } elseif ( $property->isUserDefined() ) { // user defined property |
214 | | - $property->setCaption( preg_replace( '/[ ]/u', ' ', $property->getWikiValue(), 2 ) ); |
215 | | - // / NOTE: the preg_replace is a slight hack to ensure that the left column does not get too narrow |
216 | | - $properties[$property->getWikiValue()] = array(); |
217 | | - } elseif ( $property->isVisible() ) { // predefined property |
218 | | - $properties[$property->getWikiValue()] = array(); |
219 | | - } else { // predefined, internal property |
220 | | - continue; |
| 215 | + if ( version_compare ( SMW_VERSION, '1.6', '>=' ) ) { |
| 216 | + $label = $property->getLabel(); |
| 217 | + } else { |
| 218 | + $property->setCaption( preg_replace( '/[ ]/u', ' ', $property->getWikiValue(), 2 ) ); |
| 219 | + // / NOTE: the preg_replace is a slight hack to ensure that the left column does not get too narrow |
| 220 | + $label = $property->getWikiValue(); |
| 221 | + } |
| 222 | + } else { |
| 223 | + if ( version_compare ( SMW_VERSION, '1.6', '>=' ) ) { |
| 224 | + $label = $property->getLabel(); |
| 225 | + } else { |
| 226 | + if ( $property->isVisible() ) { // predefined property |
| 227 | + $label = $property->getWikiValue(); |
| 228 | + } else { // predefined, internal property |
| 229 | + continue; |
| 230 | + } |
| 231 | + } |
221 | 232 | } |
| 233 | + $properties[$label] = array(); |
222 | 234 | |
223 | 235 | $propvalues = $semdata->getPropertyValues( $property ); |
224 | 236 | foreach ( $propvalues as $propvalue ) { |
225 | | - $properties[$property->getWikiValue()][$propvalue->getWikiValue()] = false; |
| 237 | + if ( version_compare ( SMW_VERSION, '1.6', '>=' ) ) { |
| 238 | + if ( $propvalue->getDIType() == SMWDataItem::TYPE_ERROR ) continue; |
| 239 | + $properties[$label][$propvalue->getSerialization()] = false; |
| 240 | + } else { |
| 241 | + $properties[$label][$propvalue->getWikiValue()] = false; |
| 242 | + } |
226 | 243 | } |
227 | 244 | } |
228 | 245 | $props = $wom->getObjectsByTypeID( WOM_TYPE_PROPERTY ); |