Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php |
— | — | @@ -321,7 +321,8 @@ |
322 | 322 | $params = func_get_args(); |
323 | 323 | array_shift( $params ); // we already know the $parser ... |
324 | 324 | $concept_input = array_shift( $params ); // use first parameter as concept (query) string |
325 | | - $query = SMWQueryProcessor::createQuery($concept_input, array('limit' => -1), SMWQueryProcessor::CONCEPT_DESC); |
| 325 | +// $query = SMWQueryProcessor::createQuery($concept_input, array('limit' => -1), SMWQueryProcessor::CONCEPT_DESC); |
| 326 | + $query = SMWQueryProcessor::createQuery($concept_input, array('limit' => 20, 'format' => 'list'), SMWQueryProcessor::CONCEPT_DESC); |
326 | 327 | $concept_text = $query->getDescription()->getQueryString(); |
327 | 328 | $concept_docu = array_shift( $params ); // second parameter, if any, might be a description |
328 | 329 | |
— | — | @@ -331,14 +332,16 @@ |
332 | 333 | |
333 | 334 | // display concept box: |
334 | 335 | $qresult = smwfGetStore()->getQueryResult($query); |
335 | | - $printer = new SMWListResultPrinter('list',true); |
336 | | - $resultlink = $printer->getResult($qresult, array('searchlabel' => wfMsgForContent('smw_concept_preview')), SMW_OUTPUT_WIKI); |
| 336 | + $printer = SMWQueryProcessor::getResultPrinter('list', SMWQueryProcessor::CONCEPT_DESC, $qresult); |
| 337 | + $printer->setShowErrors(false); |
| 338 | + $resultlink = $printer->getResult($qresult, array('sep' => ',_'), SMW_OUTPUT_WIKI); |
337 | 339 | smwfRequireHeadItem(SMW_HEADER_STYLE); |
338 | 340 | $result = '<div class="smwfact"><span class="smwfactboxhead">' . wfMsgForContent('smw_concept_description',$title->getText()) . |
339 | | - //(count($query->getErrors())>0?' ' . smwfEncodeMessages($query->getErrors()):'') . // errors are shown by $resultlink anyway |
340 | | - '</span> ' . $resultlink . '<br />' . |
| 341 | + (count($query->getErrors())>0?' ' . smwfEncodeMessages($query->getErrors()):'') . |
| 342 | + '</span><br />' . |
341 | 343 | ($concept_docu?"<p>$concept_docu</p>":'') . |
342 | | - '<pre>' . str_replace('[', '[', $concept_text) . '</pre></div>'; |
| 344 | + '<pre>' . str_replace('[', '[', $concept_text) . "</pre>\n" . |
| 345 | + $resultlink . '</div>'; |
343 | 346 | return $result; |
344 | 347 | } |
345 | 348 | |