Skip to content

Commit

Permalink
Merge pull request #1 from pastakhov/mainlabel
Browse files Browse the repository at this point in the history
Allow to hide the main result column by 'mainlabel=-' parameter
  • Loading branch information
pastakhov authored Feb 10, 2023
2 parents 1982089 + 15b5f97 commit 6a4df8a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions includes/Specials/BrowseData/SemanticResultPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
};
}
Expand Down

0 comments on commit 6a4df8a

Please sign in to comment.