r57983 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57982‎ | r57983 | r57984 >
Date:17:58, 21 October 2009
Author:yaron
Status:deferred
Tags:
Comment:
Added support for 'mainlabel' parameter in "Has display parameters"
Modified paths:
  • /trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php
@@ -866,7 +866,12 @@
867867 $format = $params['format'];
868868 else
869869 $format = 'category';
870 - $r = $this->addSemanticResultWrapper($dbr, $res, $num, $printouts);
 870+ if (array_key_exists('mainlabel', $params)) {
 871+ $mainlabel = $params['mainlabel'];
 872+ } else {
 873+ $mainlabel = '';
 874+ }
 875+ $r = $this->addSemanticResultWrapper($dbr, $res, $num, $mainlabel, $printouts);
871876 $printer = SMWQueryProcessor::getResultPrinter($format, SMWQueryProcessor::SPECIAL_PAGE, $r);
872877
873878 $prresult = $printer->getResult($r, $params, SMW_OUTPUT_HTML);
@@ -923,7 +928,7 @@
924929 // semantic result printers.
925930 // Code stolen largely from SMWSQLStore2QueryEngine->getInstanceQueryResult() method.
926931 // (does this mean it will only work with certain semantic SQL stores?)
927 - function addSemanticResultWrapper($dbr, $res, $num, $printouts) {
 932+ function addSemanticResultWrapper($dbr, $res, $num, $mainlabel, $printouts) {
928933 $qr = array();
929934 $count = 0;
930935 $store = smwfGetStore();
@@ -938,7 +943,7 @@
939944 }
940945 $dbr->freeResult($res);
941946
942 - $printrequest = new SMWPrintRequest(SMWPrintRequest::PRINT_THIS, '');
 947+ $printrequest = new SMWPrintRequest(SMWPrintRequest::PRINT_THIS, $mainlabel);
943948 $main_printout = array();
944949 $main_printout[$printrequest->getHash()] = $printrequest;
945950 $printouts = array_merge($main_printout, $printouts);

Status & tagging log