Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php |
— | — | @@ -500,7 +500,6 @@ |
501 | 501 | protected function getInputForm( $printoutstring, $urltail ) { |
502 | 502 | global $smwgQSortingSupport, $smwgResultFormats; |
503 | 503 | |
504 | | - $skin = $this->getSkin(); |
505 | 504 | $result = ''; |
506 | 505 | |
507 | 506 | if ( $this->m_editquery ) { |
— | — | @@ -547,8 +546,8 @@ |
548 | 547 | } |
549 | 548 | |
550 | 549 | $printer = SMWQueryProcessor::getResultPrinter( 'broadtable', SMWQueryProcessor::SPECIAL_PAGE ); |
551 | | - $url = $skin->makeSpecialUrl( 'Ask', "showformatoptions=' + this.value + '" ); |
552 | | - |
| 550 | + $url = SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL( "showformatoptions=' + this.value + '" ); |
| 551 | + |
553 | 552 | foreach ( $this->m_params as $param => $value ) { |
554 | 553 | if ( $param !== 'format' ) { |
555 | 554 | $url .= '¶ms[' . Xml::escapeJsString( $param ) . ']=' . Xml::escapeJsString( $value ); |
— | — | @@ -584,14 +583,32 @@ |
585 | 584 | |
586 | 585 | $result .= '<br /><input type="submit" value="' . wfMsg( 'smw_ask_submit' ) . '"/>' . |
587 | 586 | '<input type="hidden" name="eq" value="yes"/>' . |
588 | | - ' <a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'Ask', $urltail ) ) . '" rel="nofollow">' . wfMsg( 'smw_ask_hidequery' ) . '</a> ' . |
| 587 | + Html::element( |
| 588 | + 'a', |
| 589 | + array( |
| 590 | + 'href' => SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL( $urltail ), |
| 591 | + 'rel' => 'nofollow' |
| 592 | + ), |
| 593 | + wfMsg( 'smw_ask_hidequery' ) |
| 594 | + ) . |
589 | 595 | '| ' . SMWAskPage::getEmbedToggle() . |
590 | 596 | '| <a href="' . htmlspecialchars( wfMsg( 'smw_ask_doculink' ) ) . '">' . wfMsg( 'smw_ask_help' ) . '</a>' . |
591 | 597 | "\n</form>"; |
592 | 598 | } else { // if $this->m_editquery == false |
593 | 599 | $urltail = str_replace( '&eq=no', '', $urltail ) . '&eq=yes'; |
594 | | - $result .= '<p><a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'Ask', $urltail ) ) . '" rel="nofollow">' . wfMsg( 'smw_ask_editquery' ) . '</a> ' . |
595 | | - '| ' . SMWAskPage::getEmbedToggle() . '</p>'; |
| 600 | + $result .= '<p>' . |
| 601 | + Html::element( |
| 602 | + 'a', |
| 603 | + array( |
| 604 | + 'href' => SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL( $urltail ), |
| 605 | + 'rel' => 'nofollow' |
| 606 | + ), |
| 607 | + wfMsg( 'smw_ask_editquery' ) |
| 608 | + ) . |
| 609 | + '| ' . SMWAskPage::getEmbedToggle() . |
| 610 | + '</p>'; |
| 611 | + |
| 612 | + // FIXME: this is not used, wtf? |
596 | 613 | '<input type="hidden" name="eq" value="yes"/>' . |
597 | 614 | ' <a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'Ask', $urltail ) ) . '" rel="nofollow">' . wfMsg( 'smw_ask_hidequery' ) . '</a> ' . |
598 | 615 | '| ' . SMWAskPage::getEmbedToggle() . |
— | — | @@ -645,21 +662,46 @@ |
646 | 663 | protected function getNavigationBar( SMWQueryResult $res, $urltail ) { |
647 | 664 | global $smwgQMaxInlineLimit; |
648 | 665 | |
649 | | - $skin = $this->getSkin(); |
650 | 666 | $offset = $this->m_params['offset']; |
651 | 667 | $limit = $this->m_params['limit']; |
652 | 668 | |
653 | 669 | // Prepare navigation bar. |
654 | 670 | if ( $offset > 0 ) { |
655 | | - $navigation = '<a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'Ask', 'offset=' . max( 0, $offset - $limit ) . '&limit=' . $limit . $urltail ) ) . '" rel="nofollow">' . wfMsg( 'smw_result_prev' ) . '</a>'; |
| 671 | + $navigation = Html::element( |
| 672 | + 'a', |
| 673 | + array( |
| 674 | + 'href' => SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL( |
| 675 | + 'offset=' . max( 0, $offset - $limit ) . |
| 676 | + '&limit=' . $limit . $urltail |
| 677 | + ), |
| 678 | + 'rel' => 'nofollow' |
| 679 | + ), |
| 680 | + wfMsg( 'smw_result_prev' ) |
| 681 | + ); |
| 682 | + |
656 | 683 | } else { |
657 | 684 | $navigation = wfMsg( 'smw_result_prev' ); |
658 | 685 | } |
659 | 686 | |
660 | | - $navigation .= '     <b>' . wfMsg( 'smw_result_results' ) . ' ' . ( $offset + 1 ) . '– ' . ( $offset + $res->getCount() ) . '</b>    '; |
| 687 | + $navigation .= |
| 688 | + '     <b>' . |
| 689 | + wfMsg( 'smw_result_results' ) . ' ' . ( $offset + 1 ) . |
| 690 | + '– ' . |
| 691 | + ( $offset + $res->getCount() ) . |
| 692 | + '</b>    '; |
661 | 693 | |
662 | 694 | if ( $res->hasFurtherResults() ) { |
663 | | - $navigation .= ' <a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'Ask', 'offset=' . ( $offset + $limit ) . '&limit=' . $limit . $urltail ) ) . '" rel="nofollow">' . wfMsg( 'smw_result_next' ) . '</a>'; |
| 695 | + $navigation .= Html::element( |
| 696 | + 'a', |
| 697 | + array( |
| 698 | + 'href' => SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL( |
| 699 | + 'offset=' . ( $offset + $limit ) . |
| 700 | + '&limit=' . $limit . $urltail |
| 701 | + ), |
| 702 | + 'rel' => 'nofollow' |
| 703 | + ), |
| 704 | + wfMsg( 'smw_result_next' ) |
| 705 | + ); |
664 | 706 | } else { |
665 | 707 | $navigation .= wfMsg( 'smw_result_next' ); |
666 | 708 | } |
— | — | @@ -677,7 +719,17 @@ |
678 | 720 | } |
679 | 721 | |
680 | 722 | if ( $limit != $l ) { |
681 | | - $navigation .= '<a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'Ask', 'offset=' . $offset . '&limit=' . $l . $urltail ) ) . '" rel="nofollow">' . $l . '</a>'; |
| 723 | + $navigation .= Html::element( |
| 724 | + 'a', |
| 725 | + array( |
| 726 | + 'href' => SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL( |
| 727 | + 'offset=' . $offset . |
| 728 | + '&limit=' . $l . $urltail |
| 729 | + ), |
| 730 | + 'rel' => 'nofollow' |
| 731 | + ), |
| 732 | + $l |
| 733 | + ); |
682 | 734 | } else { |
683 | 735 | $navigation .= '<b>' . $l . '</b>'; |
684 | 736 | } |