r89255 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89254‎ | r89255 | r89256 >
Date:13:44, 1 June 2011
Author:yaron
Status:deferred
Tags:
Comment:
Modifed getSemanticProperties() to also work with SMW 1.6
Modified paths:
  • /trunk/extensions/SemanticDrilldown/includes/SD_Utils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticDrilldown/includes/SD_Utils.php
@@ -84,11 +84,24 @@
8585 $options->limit = 10000;
8686 $used_properties = smwfGetStore()->getPropertiesSpecial( $options );
8787 foreach ( $used_properties as $property ) {
88 - $all_properties[] = $property[0]->getWikiValue();
 88+ if ( $property[0] instanceof SMWDIProperty ) {
 89+ // SMW 1.6+
 90+ $propName = $property[0]->getKey();
 91+ if ( $propName{0} != '_' ) {
 92+ $all_properties[] = str_replace( '_', ' ', $propName );
 93+ }
 94+ } else {
 95+ $all_properties[] = $property[0]->getWikiValue();
 96+ }
8997 }
9098 $unused_properties = smwfGetStore()->getUnusedPropertiesSpecial( $options );
9199 foreach ( $unused_properties as $property ) {
92 - $all_properties[] = $property->getWikiValue();
 100+ if ( $property instanceof SMWDIProperty ) {
 101+ // SMW 1.6+
 102+ $all_properties[] = str_replace( '_', ' ', $property->getKey() );
 103+ } else {
 104+ $all_properties[] = $property->getWikiValue();
 105+ }
93106 }
94107 // remove the special properties of Semantic Drilldown from this list...
95108 global $sdgContLang;

Status & tagging log