Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php |
— | — | @@ -10,6 +10,8 @@ |
11 | 11 | |
12 | 12 | global $IP; |
13 | 13 | require_once( "$IP/includes/SpecialPage.php" ); |
| 14 | +global $smwgIP; |
| 15 | +require_once( "$smwgIP/includes/SMW_QueryProcessor.php" ); |
14 | 16 | |
15 | 17 | function doSpecialAsk() { |
16 | 18 | SMW_AskPage::execute(); |
— | — | @@ -53,17 +55,20 @@ |
54 | 56 | |
55 | 57 | // print results if any |
56 | 58 | if ($smwgIQEnabled && ('' != $query) ) { |
57 | | - $iq = new SMWInlineQuery(array('offset' => $offset, 'limit' => $limit, 'format' => 'broadtable', 'mainlabel' => ' ', 'link' => 'all', 'default' => wfMsg('smw_result_noresults'), 'sort' => $sort, 'order' => $order), false); |
58 | | - $result = $iq->getHTMLResult($query); |
| 59 | + $params = array('offset' => $offset, 'limit' => $limit, 'format' => 'broadtable', 'mainlabel' => ' ', 'link' => 'all', 'default' => wfMsg('smw_result_noresults'), 'sort' => $sort, 'order' => $order); |
| 60 | + $queryobj = SMWQueryProcessor::createQuery($query, $params, false); |
| 61 | + $res = smwfGetStore()->getQueryResult($queryobj); |
| 62 | + $printer = new SMWTableResultPrinter('broadtable',false); |
| 63 | + $result = $printer->getResultHTML($res, $params); |
59 | 64 | |
60 | 65 | // prepare navigation bar |
61 | 66 | if ($offset > 0) |
62 | 67 | $navigation = '<a href="' . htmlspecialchars($skin->makeSpecialUrl('Ask','offset=' . max(0,$offset-$limit) . '&limit=' . $limit . '&query=' . urlencode($query) . '&sort=' . urlencode($sort) .'&order=' . urlencode($order))) . '">' . wfMsg('smw_result_prev') . '</a>'; |
63 | 68 | else $navigation = wfMsg('smw_result_prev'); |
64 | 69 | |
65 | | - $navigation .= ' <b>' . wfMsg('smw_result_results') . ' ' . ($offset+1) . '– ' . ($offset + $iq->getDisplayCount()) . '</b> '; |
| 70 | + $navigation .= ' <b>' . wfMsg('smw_result_results') . ' ' . ($offset+1) . '– ' . ($offset + $res->getCount()) . '</b> '; |
66 | 71 | |
67 | | - if ($iq->hasFurtherResults()) |
| 72 | + if ($res->hasFurtherResults()) |
68 | 73 | $navigation .= ' <a href="' . htmlspecialchars($skin->makeSpecialUrl('Ask','offset=' . ($offset+$limit) . '&limit=' . $limit . '&query=' . urlencode($query) . '&sort=' . urlencode($sort) .'&order=' . urlencode($order))) . '">' . wfMsg('smw_result_next') . '</a>'; |
69 | 74 | else $navigation .= wfMsg('smw_result_next'); |
70 | 75 | |