Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php |
— | — | @@ -13,6 +13,8 @@ |
14 | 14 | abstract class SMWQueryUI extends SpecialPage { |
15 | 15 | protected $m_ui_helper; |
16 | 16 | private $autocompleteenabled = false; |
| 17 | + const ENABLE_AUTO_SUGGEST = true; |
| 18 | + const DISABLE_AUTO_SUGGEST = false; |
17 | 19 | |
18 | 20 | protected function addAutocompletionJavascriptAndCSS() { |
19 | 21 | global $wgOut, $smwgScriptPath, $smwgJQueryIncluded, $smwgJQueryUIIncluded; |
— | — | @@ -244,7 +246,7 @@ |
245 | 247 | // $result.= getQueryFormBox($contents, $errors); |
246 | 248 | // $result.= getPOFormBox($content, $enableAutoComplete); |
247 | 249 | // $result.= getParamBox($content); //avoid ajax, load form elements in the UI by default |
248 | | - $result = "<br>Stub: The Form elements come here<br><br>"; |
| 250 | + $result = "<br>Stub: The Form elements come here<br><br>"; |
249 | 251 | return $result; |
250 | 252 | } |
251 | 253 | protected function makeHtmlResult() { |
— | — | @@ -289,7 +291,7 @@ |
290 | 292 | * @param boolean $enableAutocomplete If set to true, adds the relevant JS and CSS to the page |
291 | 293 | * @return string The HTML code |
292 | 294 | */ |
293 | | - protected function getPOFormBox( $content, $enableAutocomplete = true ) { |
| 295 | + protected function getPOFormBox( $content, $enableAutocomplete = SMWQueryUI::ENABLE_AUTO_SUGGEST ) { |
294 | 296 | if ( $enableAutocomplete ) { |
295 | 297 | global $wgOut; |
296 | 298 | |
— | — | @@ -673,7 +675,9 @@ |
674 | 676 | * @return boolean |
675 | 677 | */ |
676 | 678 | protected function usesNavigationBar() { |
677 | | - return true; |
| 679 | + //hide if no results are found |
| 680 | + if($this->m_ui_helper->getResultCount()==0) return false; |
| 681 | + else return true; |
678 | 682 | } |
679 | 683 | |
680 | 684 | } |
Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php |
— | — | @@ -39,8 +39,8 @@ |
40 | 40 | * @param string $p |
41 | 41 | */ |
42 | 42 | public function execute( $p ) { |
43 | | - global $wgOut, $wgRequest, $smwgQEnabled; |
44 | | - |
| 43 | + global $wgOut, $wgRequest, $smwgQEnabled, $smwgIgnoreQueryErrors; |
| 44 | + $smwgIgnoreQueryErrors= false; |
45 | 45 | $this->setHeaders(); |
46 | 46 | |
47 | 47 | if ( !$smwgQEnabled ) { |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | * Adds the input query form. Overloaded from SMWQueryUI |
85 | 85 | */ |
86 | 86 | protected function makeResults( $p ) { |
87 | | - global $wgOut, $smwgQSortingSupport, $smwgResultFormats, $smwgAutocompleteInSpecialAsk; |
| 87 | + global $wgOut, $smwgQSortingSupport; |
88 | 88 | $result = ""; |
89 | 89 | $spectitle = $this->getTitle(); |
90 | 90 | $result .= '<form name="ask" action="' . $spectitle->escapeLocalURL() . '" method="get">' . "\n" . |
— | — | @@ -109,7 +109,7 @@ |
110 | 110 | $result .= '<div id="additional_options" style="display:none">'; |
111 | 111 | $result .= '<p><strong>' . wfMsg( 'smw_ask_printhead' ) . "</strong></p>\n" . |
112 | 112 | '<span style="font-weight: normal;">' . wfMsg( 'smw_ask_printdesc' ) . '</span>' . "\n" . |
113 | | - '<p>' . $this->getPOFormBox( $this->getPOStrings(), true ) . '</p>' . "\n"; |
| 113 | + '<p>' . $this->getPOFormBox( $this->getPOStrings(), SMWQueryUI::ENABLE_AUTO_SUGGEST ) . '</p>' . "\n"; |
114 | 114 | |
115 | 115 | // sorting inputs |
116 | 116 | if ( $smwgQSortingSupport ) { |