From 15b5f9784dd563348ac678114d42b08e4a8ea730 Mon Sep 17 00:00:00 2001 From: Pavel Astakhov Date: Sat, 11 Feb 2023 01:17:25 +0600 Subject: [PATCH] Allow to hide the main result column by 'mainlabel=-' parameter --- includes/Specials/BrowseData/SemanticResultPrinter.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/Specials/BrowseData/SemanticResultPrinter.php b/includes/Specials/BrowseData/SemanticResultPrinter.php index 42512c6d..b23b855a 100644 --- a/includes/Specials/BrowseData/SemanticResultPrinter.php +++ b/includes/Specials/BrowseData/SemanticResultPrinter.php @@ -69,10 +69,12 @@ private static function createGetSmwQueryResult( $res, $num ) { $furtherRes = $num !== null && $count > $num; return static function ( $query, $mainlabel, $printouts ) use ( $qr, $store, $furtherRes ) { - $printrequest = new PrintRequest( PrintRequest::PRINT_THIS, $mainlabel ); - $main_printout = []; - $main_printout[$printrequest->getHash()] = $printrequest; - $printouts = array_merge( $main_printout, $printouts ); + if ( $mainlabel !== '-' ) { + $printrequest = new PrintRequest( PrintRequest::PRINT_THIS, $mainlabel ); + $main_printout = []; + $main_printout[ $printrequest->getHash() ] = $printrequest; + $printouts = array_merge( $main_printout, $printouts ); + } return new QueryResult( $printouts, $query, $qr, $store, $furtherRes ); }; }