r104060 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104059‎ | r104060 | r104061 >
Date:18:16, 23 November 2011
Author:yaron
Status:deferred
Tags:
Comment:
Removed support for SMW < 1.5 from addSemanticResultWrapper()
Modified paths:
  • /trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php
@@ -1178,51 +1178,7 @@
11791179 $main_printout[$printrequest->getHash()] = $printrequest;
11801180 $printouts = array_merge( $main_printout, $printouts );
11811181
1182 - // for SMW 1.5+, handling is quite easy
1183 - if ( ! class_exists( 'SMWTemplateResultPrinter' ) ) {
1184 - return new SMWQueryResult( $printouts, $query, $qr, $store, ( $count > $num ) );
1185 - }
1186 - $result = new SMWQueryResult( $printouts, $query, ( $count > $num ) );
1187 - foreach ( $qr as $qt ) {
1188 - $row = array();
1189 - $cats = false;
1190 - foreach ( $printouts as $pr ) {
1191 - switch ( $pr->getMode() ) {
1192 - case SMWPrintRequest::PRINT_THIS:
1193 - $row[] = new SMWResultArray( array( $qt ), $pr );
1194 - break;
1195 - case SMWPrintRequest::PRINT_CATS:
1196 - if ( $cats === false ) {
1197 - $cats = $store->getPropertyValues( $qt, SMWPropertyValue::makeProperty( '_INST' ) );
1198 - }
1199 - $row[] = new SMWResultArray( $cats, $pr );
1200 - break;
1201 - case SMWPrintRequest::PRINT_PROP:
1202 - $row[] = new SMWResultArray( $store->getPropertyValues( $qt, $pr->getData(), null, $pr->getOutputFormat() ), $pr );
1203 - break;
1204 - case SMWPrintRequest::PRINT_CCAT:
1205 - if ( $cats === false ) {
1206 - $cats = $store->getPropertyValues( $qt, SMWPropertyValue::makeProperty( '_INST' ) );
1207 - }
1208 - $found = '0';
1209 - $prkey = $pr->getData()->getDBkey();
1210 - foreach ( $cats as $cat ) {
1211 - if ( $cat->getDBkey() == $prkey ) {
1212 - $found = '1';
1213 - break;
1214 - }
1215 - }
1216 - $dv = SMWDataValueFactory::newTypeIDValue( '_boo' );
1217 - $dv->setOutputFormat( $pr->getOutputFormat() );
1218 - $dv->setDBkeys( array( $found ) );
1219 - $row[] = new SMWResultArray( array( $dv ), $pr );
1220 - break;
1221 - }
1222 - }
1223 - $result->addRow( $row );
1224 - }
1225 - wfProfileOut( 'SMWSQLStore2Queries::getInstanceQueryResult (SMW)' );
1226 - return $result;
 1182+ return new SMWQueryResult( $printouts, $query, $qr, $store, ( $count > $num ) );
12271183 }
12281184
12291185 function openList( $offset ) {