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

Revision: 88195
Author:   jeroendedauw
Date:     2011-05-15 16:59:24 +0000 (Sun, 15 May 2011)
Log Message:
-----------
correctly determine if a DV is a page or not

Modified Paths:
--------------
    trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php

Modified: trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php
===================================================================
--- trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php    
2011-05-15 16:27:50 UTC (rev 88194)
+++ trunk/extensions/SemanticResultFormats/TagCloud/SRF_TagCloud.php    
2011-05-15 16:59:24 UTC (rev 88195)
@@ -127,16 +127,17 @@
                        for ( $i = 0, $n = count( $row ); $i < $n; $i++ ) { // 
Properties
                                while ( ( $obj = efSRFGetNextDV( $row[$i] ) ) 
!== false ) { // Property values
                                        
+                                       $isSubject = 
$row[$i]->getPrintRequest()->getMode() == SMWPrintRequest::PRINT_THIS;
+                                       
                                        // If the main object should not be 
included, skip it.
-                                       // The isMainObject method was added in 
SMW 1.5.6, so this can only be done correctly if it's available.
-                                       if ( $i == 0 && !$this->includeName && 
method_exists( $obj, 'isMainObject' ) && $obj->isMainObject() ) {
+                                       if ( $i == 0 && !$this->includeName && 
$isSubject ) {
                                                continue;
                                        }
                                        
                                        // Get the HTML for the tag content. 
Pages are linked, other stuff is just plaintext.
                                        if ( $obj->getTypeID() == '_wpg' ) {
                                                $value = 
$obj->getTitle()->getText();
-                                               $html = $obj->getLongText( 
$outputmode, $this->getLinker( method_exists( $obj, 'isMainObject' ) && 
$obj->isMainObject() ) );
+                                               $html = $obj->getLongText( 
$outputmode, $isSubject );
                                        }
                                        else {
                                                $html = $obj->getShortText( 
$outputmode, $this->getLinker( false ) );


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

Reply via email to