r89415 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89414‎ | r89415 | r89416 >
Date:14:45, 3 June 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
replace skin by linker
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php
@@ -500,7 +500,6 @@
501501 protected function getInputForm( $printoutstring, $urltail ) {
502502 global $smwgQSortingSupport, $smwgResultFormats;
503503
504 - $skin = $this->getSkin();
505504 $result = '';
506505
507506 if ( $this->m_editquery ) {
@@ -547,8 +546,8 @@
548547 }
549548
550549 $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+
553552 foreach ( $this->m_params as $param => $value ) {
554553 if ( $param !== 'format' ) {
555554 $url .= '&params[' . Xml::escapeJsString( $param ) . ']=' . Xml::escapeJsString( $value );
@@ -584,14 +583,32 @@
585584
586585 $result .= '<br /><input type="submit" value="' . wfMsg( 'smw_ask_submit' ) . '"/>' .
587586 '<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+ ) .
589595 '| ' . SMWAskPage::getEmbedToggle() .
590596 '| <a href="' . htmlspecialchars( wfMsg( 'smw_ask_doculink' ) ) . '">' . wfMsg( 'smw_ask_help' ) . '</a>' .
591597 "\n</form>";
592598 } else { // if $this->m_editquery == false
593599 $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?
596613 '<input type="hidden" name="eq" value="yes"/>' .
597614 ' <a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'Ask', $urltail ) ) . '" rel="nofollow">' . wfMsg( 'smw_ask_hidequery' ) . '</a> ' .
598615 '| ' . SMWAskPage::getEmbedToggle() .
@@ -645,21 +662,46 @@
646663 protected function getNavigationBar( SMWQueryResult $res, $urltail ) {
647664 global $smwgQMaxInlineLimit;
648665
649 - $skin = $this->getSkin();
650666 $offset = $this->m_params['offset'];
651667 $limit = $this->m_params['limit'];
652668
653669 // Prepare navigation bar.
654670 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+
656683 } else {
657684 $navigation = wfMsg( 'smw_result_prev' );
658685 }
659686
660 - $navigation .= '&#160;&#160;&#160;&#160; <b>' . wfMsg( 'smw_result_results' ) . ' ' . ( $offset + 1 ) . '&#150; ' . ( $offset + $res->getCount() ) . '</b>&#160;&#160;&#160;&#160;';
 687+ $navigation .=
 688+ '&#160;&#160;&#160;&#160; <b>' .
 689+ wfMsg( 'smw_result_results' ) . ' ' . ( $offset + 1 ) .
 690+ '&#150; ' .
 691+ ( $offset + $res->getCount() ) .
 692+ '</b>&#160;&#160;&#160;&#160;';
661693
662694 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+ );
664706 } else {
665707 $navigation .= wfMsg( 'smw_result_next' );
666708 }
@@ -677,7 +719,17 @@
678720 }
679721
680722 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+ );
682734 } else {
683735 $navigation .= '<b>' . $l . '</b>';
684736 }

Status & tagging log