http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89255

Revision: 89255
Author:   yaron
Date:     2011-06-01 13:44:29 +0000 (Wed, 01 Jun 2011)
Log Message:
-----------
Modifed getSemanticProperties() to also work with SMW 1.6

Modified Paths:
--------------
    trunk/extensions/SemanticDrilldown/includes/SD_Utils.php

Modified: trunk/extensions/SemanticDrilldown/includes/SD_Utils.php
===================================================================
--- trunk/extensions/SemanticDrilldown/includes/SD_Utils.php    2011-06-01 
13:43:38 UTC (rev 89254)
+++ trunk/extensions/SemanticDrilldown/includes/SD_Utils.php    2011-06-01 
13:44:29 UTC (rev 89255)
@@ -84,11 +84,24 @@
                $options->limit = 10000;
                $used_properties = smwfGetStore()->getPropertiesSpecial( 
$options );
                foreach ( $used_properties as $property ) {
-                       $all_properties[] = $property[0]->getWikiValue();
+                       if ( $property[0] instanceof SMWDIProperty ) {
+                               // SMW 1.6+
+                               $propName = $property[0]->getKey();
+                               if ( $propName{0} != '_' ) {
+                                       $all_properties[] = str_replace( '_', ' 
', $propName );
+                               }
+                       } else {
+                               $all_properties[] = 
$property[0]->getWikiValue();
+                       }
                }
                $unused_properties = 
smwfGetStore()->getUnusedPropertiesSpecial( $options );
                foreach ( $unused_properties as $property ) {
-                       $all_properties[] = $property->getWikiValue();
+                       if ( $property instanceof SMWDIProperty ) {
+                               // SMW 1.6+
+                               $all_properties[] = str_replace( '_', ' ', 
$property->getKey() );
+                       } else {
+                               $all_properties[] = $property->getWikiValue();
+                       }
                }
                // remove the special properties of Semantic Drilldown from 
this list...
                global $sdgContLang;


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to