Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php |
— | — | @@ -186,11 +186,11 @@ |
187 | 187 | return $query; |
188 | 188 | } |
189 | 189 | |
190 | | - protected static function addThisPrinteout( array &$printRequests, array $rawParams ) { |
191 | | - $rawParams['mainlabel'] = array_key_exists( 'mainlabel', $rawParams ) ? $rawParams['mainlabel'] : false; |
| 190 | + public static function addThisPrinteout( array &$printRequests, array $rawParams, $isShow = false ) { |
| 191 | + $rawParams['mainlabel'] = ( !$isShow && array_key_exists( 'mainlabel', $rawParams ) ) ? $rawParams['mainlabel'] : false; |
192 | 192 | $noMainlabel = $rawParams['mainlabel'] === '-'; |
193 | 193 | // !$desc->isSingleton() || count( $printRequests ) == 0 ) && ( !$noMainlabel ) |
194 | | - //var_dump($printRequests);exit; |
| 194 | + |
195 | 195 | if ( !is_null( $printRequests ) && !$noMainlabel ) { |
196 | 196 | array_unshift( $printRequests, new SMWPrintRequest( |
197 | 197 | SMWPrintRequest::PRINT_THIS, |
Index: trunk/extensions/SemanticMediaWiki/includes/api/ApiSMWQuery.php |
— | — | @@ -27,6 +27,8 @@ |
28 | 28 | * @return SMWQuery |
29 | 29 | */ |
30 | 30 | protected function getQuery( $queryString, array $printeouts ) { |
| 31 | + SMWQueryProcessor::addThisPrinteout( $printeouts, $this->parameters ); |
| 32 | + |
31 | 33 | return SMWQueryProcessor::createQuery( |
32 | 34 | $queryString, |
33 | 35 | SMWQueryProcessor::getProcessedParams( $this->parameters, $printeouts ), |