Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php |
— | — | @@ -59,9 +59,7 @@ |
60 | 60 | $format_options_requested = $this->processFormatOptions( $wgRequest ); // handling ajax for format options |
61 | 61 | if ( !$format_options_requested ) { |
62 | 62 | // Checking if a query string has been sent by using the form |
63 | | - // the 'q' is dependent from the form parameter set by getQueryFormBox() |
64 | | - // and processQueryFormBox() |
65 | | - if ( $wgRequest->getCheck( 'q' ) ) { |
| 63 | + if ( !( $this->processQueryFormBox( $wgRequest ) === false ) ) { |
66 | 64 | $params = $this->processParams(); |
67 | 65 | $this->uiCore = SMWQueryUIHelper::makeForUI( |
68 | 66 | $this->processQueryFormBox( $wgRequest ), |
— | — | @@ -354,7 +352,7 @@ |
355 | 353 | $result .= '</div>'; |
356 | 354 | $this->enableJQuery(); |
357 | 355 | $wgOut->addScriptFile( "$smwgScriptPath/skins/elastic/jquery.elastic.source.js" ); |
358 | | - |
| 356 | + |
359 | 357 | /* |
360 | 358 | * Compatibity function for disabling elastic textboxes for IE. This may |
361 | 359 | * be removed when jQuery 1.4 or above is supported. |
— | — | @@ -381,12 +379,15 @@ |
382 | 380 | * parameters. |
383 | 381 | * |
384 | 382 | * @param WebRequest $wgRequest |
385 | | - * @return string |
| 383 | + * @return mixed returns the querystring if possible, false if no querystring is set |
386 | 384 | */ |
387 | 385 | protected function processQueryFormBox( WebRequest $wgRequest ) { |
388 | | - $query = ''; |
389 | | - if ( $wgRequest->getCheck( 'q' ) ) $query = $wgRequest->getVal( 'q' ); |
390 | | - return $query; |
| 386 | + if ( $wgRequest->getCheck( 'q' ) ) { |
| 387 | + $query = $wgRequest->getVal( 'q' ); |
| 388 | + return $query; |
| 389 | + } else { |
| 390 | + return false; |
| 391 | + } |
391 | 392 | } |
392 | 393 | |
393 | 394 | /** |
— | — | @@ -675,7 +676,7 @@ |
676 | 677 | */ |
677 | 678 | $result .= Html::openElement( 'div', array( 'id' => "sort_div_$i", 'class' => 'smwsort' ) ); |
678 | 679 | $result .= '<span class="smwquisortlabel"><span class="smw-remove"><a href="javascript:removePOInstance(\'sort_div_' . $i . '\')"><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>'; |
679 | | - $result .= wfMsg( 'smw_qui_property' ).'</span>'; |
| 680 | + $result .= wfMsg( 'smw_qui_property' ) . '</span>'; |
680 | 681 | $result .= Html::input( 'property[' . $i . ']', $propertyValues[$key], 'text', array( 'size' => '35', 'id' => "property$i" ) ) . "\n"; |
681 | 682 | $result .= Html::openElement( 'select', array( 'name' => "order[$i]" ) ); |
682 | 683 | |
— | — | @@ -722,7 +723,7 @@ |
723 | 724 | */ |
724 | 725 | $result .= Html::openElement( 'div', array( 'id' => "sort_div_$i", 'class' => 'smwsort' ) ); |
725 | 726 | $result .= '<span class="smwquisortlabel"><span class="smw-remove"><a href="javascript:removePOInstance(\'sort_div_' . $i . '\')"><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' . |
726 | | - wfMsg( 'smw_qui_category' ) .'</span>'. |
| 727 | + wfMsg( 'smw_qui_category' ) . '</span>' . |
727 | 728 | Xml::input( "category[$i]", '25', $categoryValues[$key], array( 'id' => "category$i" ) ) . " " . |
728 | 729 | Html::hidden( "cat_label[$i]", $categoryLabelValues[$key], array( 'id' => "cat_label$i" ) ) . |
729 | 730 | Html::hidden( "cat_yes[$i]", $categoryYesValues[$key], array( 'id' => "cat_yes$i" ) ) . |
— | — | @@ -737,7 +738,7 @@ |
738 | 739 | */ |
739 | 740 | $result .= Html::openElement( 'div', array( 'id' => "sort_div_$i", 'class' => 'smwsort' ) ) . |
740 | 741 | '<span class="smwquisortlabel"><span class="smw-remove"><a href="javascript:removePOInstance(\'sort_div_' . $i . '\')"><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' . |
741 | | - wfMsg( 'smw_qui_rescol' ) .'</span>'. |
| 742 | + wfMsg( 'smw_qui_rescol' ) . '</span>' . |
742 | 743 | Xml::input( "maincol_label[$i]", '20', $mainColumnLabels[$key], array ( 'id' => "maincol_label$i" ) ) . " " . |
743 | 744 | Xml::closeElement( 'div' ); |
744 | 745 | $i++; |
— | — | @@ -748,8 +749,8 @@ |
749 | 750 | |
750 | 751 | // create hidden form elements to be cloned later |
751 | 752 | $hiddenProperty = Html::openElement( 'div', array( 'id' => 'property_starter', 'class' => 'smwsort', 'style' => 'display:none' ) ) . |
752 | | - '<span class="smwquisortlabel">'.'<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' . |
753 | | - wfMsg( 'smw_qui_property' ).'</span>'. |
| 753 | + '<span class="smwquisortlabel">' . '<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' . |
| 754 | + wfMsg( 'smw_qui_property' ) . '</span>' . |
754 | 755 | Xml::input( 'property_num', '25' ) . " " . |
755 | 756 | Html::openElement( 'select', array( 'name' => 'order_num' ) ) . |
756 | 757 | Xml::option( wfMsg( 'smw_qui_nosort' ), 'NONE' ) . |
— | — | @@ -764,8 +765,8 @@ |
765 | 766 | $hiddenProperty = json_encode( $hiddenProperty ); |
766 | 767 | |
767 | 768 | $hiddenCategory = Html::openElement( 'div', array( 'id' => 'category_starter', 'class' => 'smwsort', 'style' => 'display:none' ) ) . |
768 | | - '<span class="smwquisortlabel">'.'<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' . |
769 | | - wfMsg( 'smw_qui_category' ) .'</span>'. |
| 769 | + '<span class="smwquisortlabel">' . '<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' . |
| 770 | + wfMsg( 'smw_qui_category' ) . '</span>' . |
770 | 771 | Xml::input( "category_num", '25' ) . " " . |
771 | 772 | '<input type="hidden" name="cat_label_num" />' . |
772 | 773 | '<input type="hidden" name="cat_yes_num" />' . |
— | — | @@ -774,8 +775,8 @@ |
775 | 776 | $hiddenCategory = json_encode( $hiddenCategory ); |
776 | 777 | |
777 | 778 | $hiddenMainColumn = Html::openElement( 'div', array( 'id' => 'maincol_starter', 'class' => 'smwsort', 'style' => 'display:none' ) ) . |
778 | | - '<span class="smwquisortlabel">'.'<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' . |
779 | | - wfMsg( 'smw_qui_rescol' ) .'</span>'. |
| 779 | + '<span class="smwquisortlabel">' . '<span class="smw-remove"><a><img src="' . $smwgScriptPath . '/skins/images/close-button.png" alt="' . wfMsg( 'smw_qui_delete' ) . '"></a></span>' . |
| 780 | + wfMsg( 'smw_qui_rescol' ) . '</span>' . |
780 | 781 | Xml::input( "maincol_label_num", '25' ) . " " . |
781 | 782 | Xml::closeElement( 'div' ); |
782 | 783 | $hiddenMainColumn = json_encode( $hiddenMainColumn ); |