From a0b5676996e84f2916d32ba684fecf4f024a4899 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 7 Jun 2009 18:45:52 +0000 Subject: [PATCH] * replace use of deprecated makeKnownLinkObj() by linkKnown() in core special pages * use array type parameter instead of string to escapeLocalUrl(), getFullURL() and getFullUrl() for readability * some code readability and indentation improvements Linking this to r51559 for CodeReview as there is some discussion there, and these changes are very similar. --- includes/specials/SpecialAllmessages.php | 17 +- includes/specials/SpecialAllpages.php | 110 +++++---- includes/specials/SpecialAncientpages.php | 5 +- includes/specials/SpecialBlockip.php | 29 ++- includes/specials/SpecialBrokenRedirects.php | 21 +- includes/specials/SpecialConfirmemail.php | 8 +- includes/specials/SpecialContributions.php | 65 ++++-- .../specials/SpecialDeletedContributions.php | 85 +++++-- includes/specials/SpecialDoubleRedirects.php | 16 +- includes/specials/SpecialFewestrevisions.php | 13 +- includes/specials/SpecialImport.php | 10 +- includes/specials/SpecialLinkSearch.php | 2 +- includes/specials/SpecialListfiles.php | 2 +- includes/specials/SpecialMergeHistory.php | 32 ++- includes/specials/SpecialMostlinked.php | 2 +- includes/specials/SpecialMostrevisions.php | 9 +- includes/specials/SpecialMovepage.php | 15 +- includes/specials/SpecialNewpages.php | 21 +- includes/specials/SpecialPopularpages.php | 12 +- includes/specials/SpecialPrefixindex.php | 24 +- includes/specials/SpecialProtectedpages.php | 20 +- includes/specials/SpecialRevisiondelete.php | 24 +- includes/specials/SpecialSearch.php | 208 +++++++++++++----- includes/specials/SpecialShortpages.php | 9 +- includes/specials/SpecialSpecialpages.php | 2 +- includes/specials/SpecialUndelete.php | 53 +++-- includes/specials/SpecialUnusedtemplates.php | 13 +- includes/specials/SpecialUnwatchedpages.php | 12 +- includes/specials/SpecialUpload.php | 26 ++- includes/specials/SpecialUserlogin.php | 13 +- includes/specials/SpecialWatchlist.php | 98 +++++++-- includes/specials/SpecialWhatlinkshere.php | 36 ++- 32 files changed, 751 insertions(+), 261 deletions(-) diff --git a/includes/specials/SpecialAllmessages.php b/includes/specials/SpecialAllmessages.php index f141d96cb5..cfbe158e4a 100644 --- a/includes/specials/SpecialAllmessages.php +++ b/includes/specials/SpecialAllmessages.php @@ -52,8 +52,8 @@ function wfSpecialAllmessages() { $navText .= wfAllMessagesMakePhp( $messages ); $wgOut->addHTML( $wgLang->pipeList( array( 'PHP', - 'HTML', - 'XML' . + 'HTML', + 'XML' . '
' . htmlspecialchars( $navText ) . '
' ) ) ); } else if ( $ot == 'xml' ) { @@ -62,9 +62,9 @@ function wfSpecialAllmessages() { echo wfAllMessagesMakeXml( $messages ); } else { $wgOut->addHTML( $wgLang->pipeList( array( - 'PHP', + 'PHP', 'HTML', - 'XML' + 'XML' ) ) ); $wgOut->addWikiText( $navText ); $wgOut->addHTML( wfAllMessagesMakeHTMLText( $messages ) ); @@ -188,14 +188,17 @@ function wfAllMessagesMakeHTMLText( &$messages ) { $mw = htmlspecialchars( $m['msg'] ); if( array_key_exists( $title, $pageExists[NS_MEDIAWIKI] ) ) { - $pageLink = $sk->makeKnownLinkObj( $titleObj, "" . - htmlspecialchars( $key ) . '' ); + // FIXME: the span should be taken care of in $customAttribs, shouldn't it? + $pageLink = $sk->linkKnown( + $titleObj, + "" . htmlspecialchars( $key ) . '' + ); } else { $pageLink = $sk->makeBrokenLinkObj( $titleObj, "" . htmlspecialchars( $key ) . '' ); } if( array_key_exists( $title, $pageExists[NS_MEDIAWIKI_TALK] ) ) { - $talkLink = $sk->makeKnownLinkObj( $talkPage, htmlspecialchars( $talk ) ); + $talkLink = $sk->linkKnown( $talkPage, htmlspecialchars( $talk ) ); } else { $talkLink = $sk->makeBrokenLinkObj( $talkPage, htmlspecialchars( $talk ) ); } diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 0a78f3df6e..b3d2d51677 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -70,45 +70,45 @@ class SpecialAllpages extends IncludableSpecialPage { * @param string $to dbKey we are ending listing at. */ function namespaceForm( $namespace = NS_MAIN, $from = '', $to = '' ) { - global $wgScript; - $t = $this->getTitle(); - - $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) ); - $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); - $out .= Xml::hidden( 'title', $t->getPrefixedText() ); - $out .= Xml::openElement( 'fieldset' ); - $out .= Xml::element( 'legend', null, wfMsg( 'allpages' ) ); - $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) ); - $out .= " - " . - Xml::label( wfMsg( 'allpagesfrom' ), 'nsfrom' ) . - " - " . - Xml::input( 'from', 30, str_replace('_',' ',$from), array( 'id' => 'nsfrom' ) ) . - " - - - " . - Xml::label( wfMsg( 'allpagesto' ), 'nsto' ) . - " - " . - Xml::input( 'to', 30, str_replace('_',' ',$to), array( 'id' => 'nsto' ) ) . - " - - - " . - Xml::label( wfMsg( 'namespace' ), 'namespace' ) . - " - " . - Xml::namespaceSelector( $namespace, null ) . ' ' . - Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . - " - "; - $out .= Xml::closeElement( 'table' ); - $out .= Xml::closeElement( 'fieldset' ); - $out .= Xml::closeElement( 'form' ); - $out .= Xml::closeElement( 'div' ); - return $out; + global $wgScript; + $t = $this->getTitle(); + + $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) ); + $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); + $out .= Xml::hidden( 'title', $t->getPrefixedText() ); + $out .= Xml::openElement( 'fieldset' ); + $out .= Xml::element( 'legend', null, wfMsg( 'allpages' ) ); + $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) ); + $out .= " + " . + Xml::label( wfMsg( 'allpagesfrom' ), 'nsfrom' ) . + " + " . + Xml::input( 'from', 30, str_replace('_',' ',$from), array( 'id' => 'nsfrom' ) ) . + " + + + " . + Xml::label( wfMsg( 'allpagesto' ), 'nsto' ) . + " + " . + Xml::input( 'to', 30, str_replace('_',' ',$to), array( 'id' => 'nsto' ) ) . + " + + + " . + Xml::label( wfMsg( 'namespace' ), 'namespace' ) . + " + " . + Xml::namespaceSelector( $namespace, null ) . ' ' . + Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . + " +"; + $out .= Xml::closeElement( 'table' ); + $out .= Xml::closeElement( 'fieldset' ); + $out .= Xml::closeElement( 'form' ); + $out .= Xml::closeElement( 'div' ); + return $out; } /** @@ -307,7 +307,7 @@ class SpecialAllpages extends IncludableSpecialPage { $t = Title::makeTitle( $s->page_namespace, $s->page_title ); if( $t ) { $link = ( $s->page_is_redirect ? '
' : '' ) . - $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) . + $sk->linkKnown( $t, htmlspecialchars( $t->getText() ) ) . ($s->page_is_redirect ? '
' : '' ); } else { $link = '[[' . htmlspecialchars( $s->page_title ) . ']]'; @@ -384,20 +384,34 @@ class SpecialAllpages extends IncludableSpecialPage { # Do we put a previous link ? if( isset( $prevTitle ) && $pt = $prevTitle->getText() ) { - $q = 'from=' . $prevTitle->getPartialUrl() - . ( $namespace ? '&namespace=' . $namespace : '' ); - $prevLink = $sk->makeKnownLinkObj( $self, - wfMsgHTML( 'prevpage', htmlspecialchars( $pt ) ), $q ); + $query = array( 'from' => $prevTitle->getPartialUrl() ); + + if( $namespace ) + $query['namespace'] = $namespace; + + $prevLink = $sk->linkKnown( + $self, + wfMsgHTML( 'prevpage', htmlspecialchars( $pt ) ), + array(), + $query + ); $out2 = $wgLang->pipeList( array( $out2, $prevLink ) ); } if( $n == $this->maxPerPage && $s = $res->fetchObject() ) { # $s is the first link of the next chunk $t = Title::MakeTitle($namespace, $s->page_title); - $q = 'from=' . $t->getPartialUrl() - . ( $namespace ? '&namespace=' . $namespace : '' ); - $nextLink = $sk->makeKnownLinkObj( $self, - wfMsgHtml( 'nextpage', htmlspecialchars( $t->getText() ) ), $q ); + $query = array( 'from' => $t->getPartialUrl() ); + + if( $namespace ) + $query['namespace'] = $namespace; + + $nextLink = $sk->linkKnown( + $self, + wfMsgHtml( 'nextpage', htmlspecialchars( $t->getText() ) ), + array(), + $query + ); $out2 = $wgLang->pipeList( array( $out2, $nextLink ) ); } $out2 .= ""; diff --git a/includes/specials/SpecialAncientpages.php b/includes/specials/SpecialAncientpages.php index 18556c23bf..4738a1a066 100644 --- a/includes/specials/SpecialAncientpages.php +++ b/includes/specials/SpecialAncientpages.php @@ -56,7 +56,10 @@ class AncientPagesPage extends QueryPage { $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true ); $title = Title::makeTitle( $result->namespace, $result->title ); - $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); + $link = $skin->linkKnown( + $title, + htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) + ); return wfSpecialList($link, htmlspecialchars($d) ); } } diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index 933924f5af..e7f43ee66f 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -668,13 +668,21 @@ class IPBlockForm { */ private function getUnblockLink( $skin ) { $list = SpecialPage::getTitleFor( 'Ipblocklist' ); + $query = array( 'action' => 'unblock' ); + if( $this->BlockAddress ) { $addr = htmlspecialchars( strtr( $this->BlockAddress, '_', ' ' ) ); - return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock-addr', $addr ), - 'action=unblock&ip=' . urlencode( $this->BlockAddress ) ); + $message = wfMsgHtml( 'ipb-unblock-addr', $addr ); + $query['ip'] = $this->BlockAddress; } else { - return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock' ), 'action=unblock' ); + $message = wfMsgHtml( 'ipb-unblock' ); } + return $skin->linkKnown( + $list, + $message, + array(), + $query + ); } /** @@ -685,13 +693,22 @@ class IPBlockForm { */ private function getBlockListLink( $skin ) { $list = SpecialPage::getTitleFor( 'Ipblocklist' ); + $query = array(); + if( $this->BlockAddress ) { $addr = htmlspecialchars( strtr( $this->BlockAddress, '_', ' ' ) ); - return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-blocklist-addr', $addr ), - 'ip=' . urlencode( $this->BlockAddress ) ); + $message = wfMsgHtml( 'ipb-blocklist-addr', $addr ); + $query['ip'] = $this->BlockAddress; } else { - return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-blocklist' ) ); + $message = wfMsgHtml( 'ipb-blocklist' ); } + + return $skin->linkKnown( + $list, + $message, + array(), + $query + ); } /** diff --git a/includes/specials/SpecialBrokenRedirects.php b/includes/specials/SpecialBrokenRedirects.php index de33abccae..01f0bd9046 100644 --- a/includes/specials/SpecialBrokenRedirects.php +++ b/includes/specials/SpecialBrokenRedirects.php @@ -64,15 +64,30 @@ class BrokenRedirectsPage extends PageQueryPage { return '' . $skin->link( $fromObj ) . ''; } - $from = $skin->makeKnownLinkObj( $fromObj ,'', 'redirect=no' ); - $edit = $skin->makeKnownLinkObj( $fromObj, wfMsgHtml( 'brokenredirects-edit' ), 'action=edit' ); + $from = $skin->linkKnown( + $fromObj, + null, + array(), + array( 'redirect' => 'no' ) + ); + $edit = $skin->linkKnown( + $fromObj, + wfMsgHtml( 'brokenredirects-edit' ), + array(), + array( 'action' => 'edit' ) + ); $to = $skin->makeBrokenLinkObj( $toObj ); $arr = $wgContLang->getArrow(); $out = "{$from} {$edit}"; if( $wgUser->isAllowed( 'delete' ) ) { - $delete = $skin->makeKnownLinkObj( $fromObj, wfMsgHtml( 'brokenredirects-delete' ), 'action=delete' ); + $delete = $skin->linkKnown( + $fromObj, + wfMsgHtml( 'brokenredirects-delete' ), + array(), + array( 'action' => 'delete' ) + ); $out .= " {$delete}"; } diff --git a/includes/specials/SpecialConfirmemail.php b/includes/specials/SpecialConfirmemail.php index 15a81e5369..7090ee49be 100644 --- a/includes/specials/SpecialConfirmemail.php +++ b/includes/specials/SpecialConfirmemail.php @@ -35,8 +35,12 @@ class EmailConfirmation extends UnlistedSpecialPage { } else { $title = SpecialPage::getTitleFor( 'Userlogin' ); $skin = $wgUser->getSkin(); - $llink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'loginreqlink' ), - 'returnto=' . $this->getTitle()->getPrefixedUrl() ); + $llink = $skin->linkKnown( + $title, + wfMsgHtml( 'loginreqlink' ), + array(), + array( 'returnto' => $this->getTitle()->getPrefixedUrl() ) + ); $wgOut->addHTML( wfMsgWikiHtml( 'confirmemail_needlogin', $llink ) ); } } else { diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 19c895ec22..90c313e872 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -157,26 +157,41 @@ class SpecialContributions extends SpecialPage { if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && IP::isIPAddress( $nt->getText() ) ) ) { # Block link if( $wgUser->isAllowed( 'block' ) ) - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', - $nt->getDBkey() ), wfMsgHtml( 'blocklink' ) ); + $tools[] = $sk->linkKnown( + SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), + wfMsgHtml( 'blocklink' ) + ); # Block log link - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), - wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() ); + $tools[] = $sk->linkKnown( + SpecialPage::getTitleFor( 'Log' ), + wfMsgHtml( 'sp-contributions-blocklog' ), + array(), + array( + 'type' => 'block', + 'page' => $nt->getPrefixedUrl() + ) + ); } # Other logs link - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsg( 'sp-contributions-logs' ), - 'user=' . $nt->getPartialUrl() ); + $tools[] = $sk->linkKnown( + SpecialPage::getTitleFor( 'Log' ), + wfMsg( 'sp-contributions-logs' ), + array(), + array( 'user' => $nt->getPartialUrl() ) + ); # Add link to deleted user contributions for priviledged users if( $wgUser->isAllowed( 'deletedhistory' ) ) { - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions', - $nt->getDBkey() ), wfMsgHtml( 'sp-contributions-deleted' ) ); + $tools[] = $sk->linkKnown( + SpecialPage::getTitleFor( 'DeletedContributions', $nt->getDBkey() ), + wfMsgHtml( 'sp-contributions-deleted' ) + ); } # Add a link to change user rights for privileged users $userrightsPage = new UserrightsPage(); if( 0 !== $id && $userrightsPage->userCanChangeRights( User::newFromId( $id ) ) ) { - $tools[] = $sk->makeKnownLinkObj( + $tools[] = $sk->linkKnown( SpecialPage::getTitleFor( 'Userrights', $nt->getDBkey() ), wfMsgHtml( 'sp-contributions-userrights' ) ); @@ -493,7 +508,12 @@ class ContribsPager extends ReverseChronologicalPager { if( $row->rev_id == $row->page_latest ) { $topmarktext .= '' . $this->messages['uctop'] . ''; if( !$row->page_is_new ) { - $difftext .= '(' . $sk->makeKnownLinkObj( $page, $this->messages['diff'], 'diff=0' ) . ')'; + $difftext .= '(' . $sk->linkKnown( + $page, + $this->messages['diff'], + array(), + array( 'diff' => 0 ) + ) . ')'; # Add rollback link if( $page->quickUserCan( 'rollback') && $page->quickUserCan( 'edit' ) ) { $topmarktext .= ' '.$sk->generateRollback( $rev ); @@ -504,16 +524,33 @@ class ContribsPager extends ReverseChronologicalPager { } # Is there a visible previous revision? if( $rev->userCan(Revision::DELETED_TEXT) ) { - $difftext = '(' . $sk->makeKnownLinkObj( $page, $this->messages['diff'], - 'diff=prev&oldid='.$row->rev_id ) . ')'; + $difftext = '(' . $sk->linkKnown( + $page, + $this->messages['diff'], + array(), + array( + 'diff' => 'prev', + 'oldid' => $row->rev_id + ) + ) . ')'; } else { $difftext = '(' . $this->messages['diff'] . ')'; } - $histlink = '('.$sk->makeKnownLinkObj( $page, $this->messages['hist'], 'action=history' ) . ')'; + $histlink = '('.$sk->linkKnown( + $page, + $this->messages['hist'], + array(), + array( 'action' => 'history' ) + ) . ')'; $comment = $wgContLang->getDirMark() . $sk->revComment( $rev, false, true ); $date = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true ); - $d = $sk->makeKnownLinkObj( $page, htmlspecialchars($date), 'oldid='.intval($row->rev_id) ); + $d = $sk->linkKnown( + $page, + htmlspecialchars($date), + array(), + array( 'oldid' => intval( $row->rev_id ) ) + ); if( $this->target == 'newbies' ) { $userlink = ' . . ' . $sk->userLink( $row->rev_user, $row->rev_user_text ); diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 763bd9b73c..15d355c94c 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -126,23 +126,41 @@ class DeletedContribsPager extends IndexPager { $undelete = SpecialPage::getTitleFor( 'Undelete' ); $logs = SpecialPage::getTitleFor( 'Log' ); - $dellog = $sk->makeKnownLinkObj( $logs, + $dellog = $sk->linkKnown( + $logs, $this->messages['deletionlog'], - 'type=delete&page=' . $page->getPrefixedUrl() ); + array(), + array( + 'type' => 'delete', + 'page' => $page->getPrefixedUrl() + ) + ); - $reviewlink = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Undelete', $page->getPrefixedDBkey() ), - $this->messages['undeletebtn'] ); + $reviewlink = $sk->linkKnown( + SpecialPage::getTitleFor( 'Undelete', $page->getPrefixedDBkey() ), + $this->messages['undeletebtn'] + ); - $link = $sk->makeKnownLinkObj( $undelete, + $link = $sk->linkKnown( + $undelete, htmlspecialchars( $page->getPrefixedText() ), - 'target=' . $page->getPrefixedUrl() . - '×tamp=' . $rev->getTimestamp() ); + array(), + array( + 'target' => $page->getPrefixedUrl(), + 'timestamp' => $rev->getTimestamp() + ) + ); - $last = $sk->makeKnownLinkObj( $undelete, + $last = $sk->linkKnown( + $undelete, $this->messages['diff'], - "target=" . $page->getPrefixedUrl() . - "×tamp=" . $rev->getTimestamp() . - "&diff=prev" ); + array(), + array( + 'target' => $page->getPrefixedUrl(), + 'timestamp' => $rev->getTimestamp(), + 'diff' => 'prev' + ) + ); $comment = $sk->revComment( $rev ); $d = htmlspecialchars( $wgLang->timeanddate( $rev->getTimestamp(), true ) ); @@ -150,9 +168,15 @@ class DeletedContribsPager extends IndexPager { if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { $d = '' . $d . ''; } else { - $link = $sk->makeKnownLinkObj( $undelete, $d, - 'target=' . $page->getPrefixedUrl() . - '×tamp=' . $rev->getTimestamp() ); + $link = $sk->linkKnown( + $undelete, + $d, + array(), + array( + 'target' => $page->getPrefixedUrl(), + 'timestamp' => $rev->getTimestamp() + ) + ); } $pagelink = $sk->link( $page ); @@ -312,19 +336,34 @@ class DeletedContributionsPage extends SpecialPage { if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) { # Block link if( $wgUser->isAllowed( 'block' ) ) - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), - wfMsgHtml( 'blocklink' ) ); + $tools[] = $sk->linkKnown( + SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), + wfMsgHtml( 'blocklink' ) + ); # Block log link - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), - wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() ); + $tools[] = $sk->linkKnown( + SpecialPage::getTitleFor( 'Log' ), + wfMsgHtml( 'sp-contributions-blocklog' ), + array(), + array( + 'type' => 'block', + 'page' => $nt->getPrefixedUrl() + ) + ); } # Other logs link - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), - wfMsgHtml( 'sp-contributions-logs' ), 'user=' . $nt->getPartialUrl() ); + $tools[] = $sk->linkKnown( + SpecialPage::getTitleFor( 'Log' ), + wfMsgHtml( 'sp-contributions-logs' ), + array(), + array( 'user' => $nt->getPartialUrl() ) + ); # Link to undeleted contributions - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions', $nt->getDBkey() ), - wfMsgHtml( 'contributions' ) ); - + $tools[] = $sk->linkKnown( + SpecialPage::getTitleFor( 'Contributions', $nt->getDBkey() ), + wfMsgHtml( 'contributions' ) + ); + wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) ); $links = $wgLang->pipeList( $tools ); diff --git a/includes/specials/SpecialDoubleRedirects.php b/includes/specials/SpecialDoubleRedirects.php index 28ffccbea8..78ab341152 100644 --- a/includes/specials/SpecialDoubleRedirects.php +++ b/includes/specials/SpecialDoubleRedirects.php @@ -80,10 +80,20 @@ class DoubleRedirectsPage extends PageQueryPage { $titleB = Title::makeTitle( $result->nsb, $result->tb ); $titleC = Title::makeTitle( $result->nsc, $result->tc ); - $linkA = $skin->makeKnownLinkObj( $titleA, '', 'redirect=no' ); + $linkA = $skin->linkKnown( + $titleA, + null, + array(), + array( 'redirect' => 'no' ) + ); $edit = $skin->makeBrokenLinkObj( $titleA, "(".wfMsgHtml("qbedit").")" , 'redirect=no'); - $linkB = $skin->makeKnownLinkObj( $titleB, '', 'redirect=no' ); - $linkC = $skin->makeKnownLinkObj( $titleC ); + $linkB = $skin->linkKnown( + $titleB, + null, + array(), + array( 'redirect' => 'no' ) + ); + $linkC = $skin->linkKnown( $titleC ); $arr = $wgContLang->getArrow() . $wgContLang->getDirMark(); return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" ); diff --git a/includes/specials/SpecialFewestrevisions.php b/includes/specials/SpecialFewestrevisions.php index b8331fbeed..35311d7ed0 100644 --- a/includes/specials/SpecialFewestrevisions.php +++ b/includes/specials/SpecialFewestrevisions.php @@ -55,13 +55,20 @@ class FewestrevisionsPage extends QueryPage { $nt = Title::makeTitleSafe( $result->namespace, $result->title ); $text = $wgContLang->convert( $nt->getPrefixedText() ); - $plink = $skin->makeKnownLinkObj( $nt, $text ); + $plink = $skin->linkKnown( + $nt, + $text + ); $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->value ) ); $redirect = $result->redirect ? ' - ' . wfMsgHtml( 'isredirect' ) : ''; - $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' ) . $redirect; - + $nlink = $skin->linkKnown( + $nt, + $nl, + array(), + array( 'action' => 'history' ) + ) . $redirect; return wfSpecialList( $plink, $nlink ); } diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index 18054d6cb2..5105b1f5b9 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -136,7 +136,7 @@ class SpecialImport extends SpecialPage { if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) ) return $wgOut->permissionRequired( 'import' ); - $action = $this->getTitle()->getLocalUrl( 'action=submit' ); + $action = $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) ); if( $wgUser->isAllowed( 'importupload' ) ) { $wgOut->addWikiMsg( "importtext" ); @@ -273,7 +273,7 @@ class SpecialImport extends SpecialPage { * @ingroup SpecialPage */ class ImportReporter { - private $reason=false; + private $reason=false; function __construct( $importer, $upload, $interwiki , $reason=false ) { $importer->setPageOutCallback( array( $this, 'reportPage' ) ); @@ -299,7 +299,7 @@ class ImportReporter { $contentCount = $wgContLang->formatNum( $successCount ); if( $successCount > 0 ) { - $wgOut->addHTML( "
  • " . $skin->makeKnownLinkObj( $title ) . " " . + $wgOut->addHTML( "
  • " . $skin->linkKnown( $title ) . " " . wfMsgExt( 'import-revision-count', array( 'parsemag', 'escape' ), $localCount ) . "
  • \n" ); @@ -309,7 +309,7 @@ class ImportReporter { $detail = wfMsgExt( 'import-logentry-upload-detail', array( 'content', 'parsemag' ), $contentCount ); if ( $this->reason ) { - $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason; + $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason; } $log->addEntry( 'upload', $title, $detail ); } else { @@ -318,7 +318,7 @@ class ImportReporter { $detail = wfMsgExt( 'import-logentry-interwiki-detail', array( 'content', 'parsemag' ), $contentCount, $interwiki ); if ( $this->reason ) { - $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason; + $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason; } $log->addEntry( 'interwiki', $title, $detail ); } diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index 267ef690d3..242c8ec38b 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -151,7 +151,7 @@ class LinkSearchPage extends QueryPage { function formatResult( $skin, $result ) { $title = Title::makeTitle( $result->namespace, $result->title ); $url = $result->url; - $pageLink = $skin->makeKnownLinkObj( $title ); + $pageLink = $skin->linkKnown( $title ); $urlLink = $skin->makeExternalLink( $url, $url ); return wfMsgHtml( 'linksearch-line', $urlLink, $pageLink ); diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index d3ad50e0ef..dbfdbd5caa 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -133,7 +133,7 @@ class ImageListPager extends TablePager { if ( $imgfile === null ) $imgfile = wfMsg( 'imgfile' ); $name = $this->mCurrentRow->img_name; - $link = $this->getSkin()->makeKnownLinkObj( Title::makeTitle( NS_FILE, $name ), $value ); + $link = $this->getSkin()->linkKnown( Title::makeTitle( NS_FILE, $name ), $value ); $image = wfLocalFile( $value ); $url = $image->getURL(); $download = Xml::element('a', array( 'href' => $url ), $imgfile ); diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php index ead8a3bcc8..1b4ef30c6a 100644 --- a/includes/specials/SpecialMergeHistory.php +++ b/includes/specials/SpecialMergeHistory.php @@ -155,7 +155,7 @@ class MergehistoryForm { $haveRevisions = $revisions && $revisions->getNumRows() > 0; $titleObj = SpecialPage::getTitleFor( "Mergehistory" ); - $action = $titleObj->getLocalURL( "action=submit" ); + $action = $titleObj->getLocalURL( array( 'action' => 'submit' ) ); # Start the form here $top = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'merge' ) ); $wgOut->addHTML( $top ); @@ -228,8 +228,12 @@ class MergehistoryForm { $ts = wfTimestamp( TS_MW, $row->rev_timestamp ); $checkBox = Xml::radio( "mergepoint", $ts, false ); - $pageLink = $this->sk->makeKnownLinkObj( $rev->getTitle(), - htmlspecialchars( $wgLang->timeanddate( $ts ) ), 'oldid=' . $rev->getId() ); + $pageLink = $this->sk->linkKnown( + $rev->getTitle(), + htmlspecialchars( $wgLang->timeanddate( $ts ) ), + array(), + array( 'oldid' => $rev->getId() ) + ); if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { $pageLink = '' . $pageLink . ''; } @@ -238,8 +242,15 @@ class MergehistoryForm { if( !$rev->userCan( Revision::DELETED_TEXT ) ) $last = $this->message['last']; else if( isset($this->prevId[$row->rev_id]) ) - $last = $this->sk->makeKnownLinkObj( $rev->getTitle(), $this->message['last'], - "diff=" . $row->rev_id . "&oldid=" . $this->prevId[$row->rev_id] ); + $last = $this->sk->linkKnown( + $rev->getTitle(), + $this->message['last'], + array(), + array( + 'diff' => $row->rev_id, + 'oldid' => $this->prevId[$row->rev_id] + ) + ); $userLink = $this->sk->revUserTools( $rev ); @@ -261,8 +272,15 @@ class MergehistoryForm { if( !$this->userCan($row, Revision::DELETED_TEXT) ) { return '' . $wgLang->timeanddate( $ts, true ) . ''; } else { - $link = $this->sk->makeKnownLinkObj( $titleObj, - $wgLang->timeanddate( $ts, true ), "target=$target×tamp=$ts" ); + $link = $this->sk->linkKnown( + $titleObj, + $wgLang->timeanddate( $ts, true ), + array(), + array( + 'target' => $target, + 'timestamp' => $ts + ) + ); if( $this->isDeleted($row, Revision::DELETED_TEXT) ) $link = '' . $link . ''; return $link; diff --git a/includes/specials/SpecialMostlinked.php b/includes/specials/SpecialMostlinked.php index cbe5e65dc6..346bcbc0df 100644 --- a/includes/specials/SpecialMostlinked.php +++ b/includes/specials/SpecialMostlinked.php @@ -62,7 +62,7 @@ class MostlinkedPage extends QueryPage { */ function makeWlhLink( &$title, $caption, &$skin ) { $wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedDBkey() ); - return $skin->makeKnownLinkObj( $wlh, $caption ); + return $skin->linkKnown( $wlh, $caption ); } /** diff --git a/includes/specials/SpecialMostrevisions.php b/includes/specials/SpecialMostrevisions.php index f5a0f8c0d1..414e8d971a 100644 --- a/includes/specials/SpecialMostrevisions.php +++ b/includes/specials/SpecialMostrevisions.php @@ -42,11 +42,16 @@ class MostrevisionsPage extends QueryPage { $nt = Title::makeTitle( $result->namespace, $result->title ); $text = $wgContLang->convert( $nt->getPrefixedText() ); - $plink = $skin->makeKnownLinkObj( $nt, $text ); + $plink = $skin->linkKnown( $nt, $text ); $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'), $wgLang->formatNum( $result->value ) ); - $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' ); + $nlink = $skin->linkKnown( + $nt, + $nl, + array(), + array( 'action' => 'history' ) + ); return wfSpecialList($plink, $nlink); } diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 26055425e5..70b15948f1 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -463,7 +463,7 @@ class MovePageForm { # be longer than 255 characters. $newSubpage = Title::makeTitleSafe( $newNs, $newPageName ); if( !$newSubpage ) { - $oldLink = $skin->makeKnownLinkObj( $oldSubpage ); + $oldLink = $skin->linkKnown( $oldSubpage ); $extraOutput []= wfMsgHtml( 'movepage-page-unmoved', $oldLink, htmlspecialchars(Title::makeName( $newNs, $newPageName ))); continue; @@ -471,7 +471,7 @@ class MovePageForm { # This was copy-pasted from Renameuser, bleh. if ( $newSubpage->exists() && !$oldSubpage->isValidMoveTarget( $newSubpage ) ) { - $link = $skin->makeKnownLinkObj( $newSubpage ); + $link = $skin->linkKnown( $newSubpage ); $extraOutput []= wfMsgHtml( 'movepage-page-exists', $link ); } else { $success = $oldSubpage->moveTo( $newSubpage, true, $this->reason, $createRedirect ); @@ -479,11 +479,16 @@ class MovePageForm { if ( $this->fixRedirects ) { DoubleRedirectJob::fixRedirects( 'move', $oldSubpage, $newSubpage ); } - $oldLink = $skin->makeKnownLinkObj( $oldSubpage, '', 'redirect=no' ); - $newLink = $skin->makeKnownLinkObj( $newSubpage ); + $oldLink = $skin->linkKnown( + $oldSubpage, + null, + array(), + array( 'redirect' => 'no' ) + ); + $newLink = $skin->linkKnown( $newSubpage ); $extraOutput []= wfMsgHtml( 'movepage-page-moved', $oldLink, $newLink ); } else { - $oldLink = $skin->makeKnownLinkObj( $oldSubpage ); + $oldLink = $skin->linkKnown( $oldSubpage ); $newLink = $skin->link( $newSubpage ); $extraOutput []= wfMsgHtml( 'movepage-page-unmoved', $oldLink, $newLink ); } diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index c970fdf0f8..20cb120f00 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -255,9 +255,24 @@ class SpecialNewpages extends SpecialPage { $title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title ); $time = htmlspecialchars( $wgLang->timeAndDate( $result->rc_timestamp, true ) ); - $query = $this->patrollable( $result ) ? "rcid={$result->rc_id}&redirect=no" : 'redirect=no'; - $plink = $this->skin->makeKnownLinkObj( $title, '', $query ); - $hist = $this->skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' ); + + $query = array( 'redirect' => 'no' ); + + if( $this->patrollable( $result ) ) + $query['rcid'] = $result->rc_id; + + $plink = $this->skin->linkKnown( + $title, + null, + array(), + $query + ); + $hist = $this->skin->linkKnown( + $title, + wfMsgHtml( 'hist' ), + array(), + array( 'action' => 'history' ) + ); $length = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->length ) ); $ulink = $this->skin->userLink( $result->rc_user, $result->rc_user_text ) . ' ' . diff --git a/includes/specials/SpecialPopularpages.php b/includes/specials/SpecialPopularpages.php index eb5727367c..88b90bc384 100644 --- a/includes/specials/SpecialPopularpages.php +++ b/includes/specials/SpecialPopularpages.php @@ -48,9 +48,15 @@ class PopularPagesPage extends QueryPage { function formatResult( $skin, $result ) { global $wgLang, $wgContLang; $title = Title::makeTitle( $result->namespace, $result->title ); - $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); - $nv = wfMsgExt( 'nviews', array( 'parsemag', 'escape'), - $wgLang->formatNum( $result->value ) ); + $link = $skin->linkKnown( + $title, + htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) + ); + $nv = wfMsgExt( + 'nviews', + array( 'parsemag', 'escape'), + $wgLang->formatNum( $result->value ) + ); return wfSpecialList($link, $nv); } } diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index 0d95e5fc89..3a6b3c2d0d 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -136,7 +136,10 @@ class SpecialPrefixindex extends SpecialAllpages { $t = Title::makeTitle( $s->page_namespace, $s->page_title ); if( $t ) { $link = ($s->page_is_redirect ? '
    ' : '' ) . - $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) . + $sk->linkKnown( + $t, + htmlspecialchars( $t->getText() ) + ) . ($s->page_is_redirect ? '
    ' : '' ); } else { $link = '[[' . htmlspecialchars( $s->page_title ) . ']]'; @@ -170,17 +173,26 @@ class SpecialPrefixindex extends SpecialAllpages { $nsForm . ' ' . - $sk->makeKnownLinkObj( $self, wfMsgHtml( 'allpages' ) ); + $sk->linkKnown( $self, wfMsgHtml( 'allpages' ) ); if( isset( $res ) && $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) { - $namespaceparam = $namespace ? "&namespace=$namespace" : ""; + $query = array( + 'from' => $s->page_title, + 'prefix' => $prefix + ); + + if( $namespace ) { + $query['namespace'] = $namespace; + } + $out2 = $wgLang->pipeList( array( $out2, - $sk->makeKnownLinkObj( + $sk->linkKnown( $self, wfMsgHtml( 'nextpage', str_replace( '_',' ', htmlspecialchars( $s->page_title ) ) ), - "from=" . wfUrlEncode( $s->page_title ) . - "&prefix=" . wfUrlEncode( $prefix ) . $namespaceparam ) + array(), + $query + ) ) ); } $out2 .= "" . diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 1b12970c76..01b895fccf 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -95,12 +95,23 @@ class ProtectedPagesForm { # Show a link to the change protection form for allowed users otherwise a link to the protection log if( $wgUser->isAllowed( 'protect' ) ) { - $changeProtection = ' (' . $skin->makeKnownLinkObj( $title, wfMsgHtml( 'protect_change' ), - 'action=unprotect' ) . ')'; + $changeProtection = ' (' . $skin->linkKnown( + $title, + wfMsgHtml( 'protect_change' ), + array(), + array( 'action' => 'unprotect' ) + ) . ')'; } else { $ltitle = SpecialPage::getTitleFor( 'Log' ); - $changeProtection = ' (' . $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'protectlogpage' ), - 'type=protect&page=' . $title->getPrefixedUrl() ) . ')'; + $changeProtection = ' (' . $skin->linkKnown( + $ltitle, + wfMsgHtml( 'protectlogpage' ), + array(), + array( + 'type' => 'protect', + 'page' => $title->getPrefixedUrl() + ) + ) . ')'; } wfProfileOut( __METHOD__ ); @@ -223,6 +234,7 @@ class ProtectedPagesForm { // First pass to load the log names foreach( $wgRestrictionLevels as $type ) { + // Messages used can be 'restriction-level-sysop' and 'restriction-level-autoconfirmed' if( $type !='' && $type !='*') { $text = wfMsg("restriction-level-$type"); $m[$text] = $type; diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 3c54ae537c..f8697a2f32 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -186,16 +186,28 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { if( $this->targetObj ) { $links = array(); $logtitle = SpecialPage::getTitleFor( 'Log' ); - $links[] = $this->skin->makeKnownLinkObj( $logtitle, wfMsgHtml( 'viewpagelogs' ), - wfArrayToCGI( array( 'page' => $this->targetObj->getPrefixedUrl() ) ) ); + $links[] = $this->skin->linkKnown( + $logtitle, + wfMsgHtml( 'viewpagelogs' ), + array(), + array( 'page' => $this->targetObj->getPrefixedUrl() ) + ); # Give a link to the page history - $links[] = $this->skin->makeKnownLinkObj( $this->targetObj, wfMsgHtml( 'pagehist' ), - wfArrayToCGI( array( 'action' => 'history' ) ) ); + $links[] = $this->skin->linkKnown( + $this->targetObj, + wfMsgHtml( 'pagehist' ), + array(), + array( 'action' => 'history' ) + ); # Link to deleted edits if( $wgUser->isAllowed('undelete') ) { $undelete = SpecialPage::getTitleFor( 'Undelete' ); - $links[] = $this->skin->makeKnownLinkObj( $undelete, wfMsgHtml( 'deletedhist' ), - wfArrayToCGI( array( 'target' => $this->targetObj->getPrefixedDBkey() ) ) ); + $links[] = $this->skin->linkKnown( + $undelete, + wfMsgHtml( 'deletedhist' ), + array(), + array( 'target' => $this->targetObj->getPrefixedDBkey() ) + ); } # Logs themselves don't have histories or archived revisions $wgOut->setSubtitle( '

    '.implode($links,' / ').'

    ' ); diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index a0e7e789e3..0055495b76 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -103,7 +103,7 @@ class SpecialSearch { wfRunHooks( 'SpecialSearchNogomatch', array( &$t ) ); # If the feature is enabled, go straight to the edit page if( $wgGoToEdit ) { - $wgOut->redirect( $t->getFullURL( 'action=edit' ) ); + $wgOut->redirect( $t->getFullURL( array( 'action' => 'edit' ) ) ); return; } } @@ -165,17 +165,24 @@ class SpecialSearch { // did you mean... suggestions if( $textMatches && $textMatches->hasSuggestion() ) { $st = SpecialPage::getTitleFor( 'Search' ); + # mirror Go/Search behaviour of original request .. $didYouMeanParams = array( 'search' => $textMatches->getSuggestionQuery() ); + if($this->fulltext != NULL) $didYouMeanParams['fulltext'] = $this->fulltext; - $stParams = wfArrayToCGI( + + $stParams = array_merge( $didYouMeanParams, $this->powerSearchOptions() ); - $suggestLink = $sk->makeKnownLinkObj( $st, + + $suggestLink = $sk->linkKnown( + $st, $textMatches->getSuggestionSnippet(), - $stParams ); + array(), + $stParams + ); $this->didYouMeanHtml = '
    '.wfMsg('search-suggest',$suggestLink).'
    '; } @@ -406,7 +413,10 @@ class SpecialSearch { $sk = $wgUser->getSkin(); $t = $result->getTitle(); - $link = $this->sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms)); + $link = $this->sk->linkKnown( + $t, + $result->getTitleSnippet($terms) + ); //If page content is not readable, just return the title. //This is not quite safe, but better than showing excerpts from non-readable pages @@ -430,15 +440,29 @@ class SpecialSearch { $sectionTitle = $result->getSectionTitle(); $sectionText = $result->getSectionSnippet($terms); $redirect = ''; + if( !is_null($redirectTitle) ) - $redirect = "" - .wfMsg('search-redirect',$this->sk->makeKnownLinkObj( $redirectTitle, $redirectText)) - .""; + $redirect = "" . + wfMsg( + 'search-redirect', + $this->sk->linkKnown( + $redirectTitle, + $redirectText + ) + ) . + ""; + $section = ''; + if( !is_null($sectionTitle) ) - $section = "" - .wfMsg('search-section', $this->sk->makeKnownLinkObj( $sectionTitle, $sectionText)) - .""; + $section = "" . + wfMsg( + 'search-section', $this->sk->linkKnown( + $sectionTitle, + $sectionText + ) + ) . + ""; // format text extract $extract = "
    ".$result->getTextSnippet($terms)."
    "; @@ -457,20 +481,32 @@ class SpecialSearch { $byteSize = $result->getByteSize(); $wordCount = $result->getWordCount(); $timestamp = $result->getTimestamp(); - $size = wfMsgExt( 'search-result-size', array( 'parsemag', 'escape' ), - $this->sk->formatSize( $byteSize ), $wordCount ); + $size = wfMsgExt( + 'search-result-size', + array( 'parsemag', 'escape' ), + $this->sk->formatSize( $byteSize ), + $wordCount + ); $date = $wgLang->timeanddate( $timestamp ); // link to related articles if supported $related = ''; if( $result->hasRelated() ) { $st = SpecialPage::getTitleFor( 'Search' ); - $stParams = wfArrayToCGI( $this->powerSearchOptions(), - array('search' => wfMsgForContent('searchrelated').':'.$t->getPrefixedText(), - 'fulltext' => wfMsg('search') )); + $stParams = array_merge( + $this->powerSearchOptions(), + array( + 'search' => wfMsgForContent( 'searchrelated' ) . ':' . $t->getPrefixedText(), + 'fulltext' => wfMsg( 'search' ) + ) + ); - $related = ' -- ' . $sk->makeKnownLinkObj( $st, - wfMsg('search-relatedarticle'), $stParams ); + $related = ' -- ' . $sk->linkKnown( + $st, + wfMsg('search-relatedarticle'), + array(), + $stParams + ); } // Include a thumbnail for media files... @@ -567,16 +603,25 @@ class SpecialSearch { $t = $result->getTitle(); - $link = $this->sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms)); + $link = $this->sk->linkKnown( + $t, + $result->getTitleSnippet($terms) + ); // format redirect if any $redirectTitle = $result->getRedirectTitle(); $redirectText = $result->getRedirectSnippet($terms); $redirect = ''; if( !is_null($redirectTitle) ) - $redirect = "" - .wfMsg('search-redirect',$this->sk->makeKnownLinkObj( $redirectTitle, $redirectText)) - .""; + $redirect = "" . + wfMsg( + 'search-redirect', + $this->sk->linkKnown( + $redirectTitle, + $redirectText + ) + ) . + ""; $out = ""; // display project name @@ -592,8 +637,15 @@ class SpecialSearch { } // "more results" link (special page stuff could be localized, but we might not know target lang) $searchTitle = Title::newFromText($t->getInterwiki().":Special:Search"); - $searchLink = $this->sk->makeKnownLinkObj( $searchTitle, wfMsg('search-interwiki-more'), - wfArrayToCGI(array('search' => $query, 'fulltext' => 'Search'))); + $searchLink = $this->sk->linkKnown( + $searchTitle, + wfMsg('search-interwiki-more'), + array(), + array( + 'search' => $query, + 'fulltext' => 'Search' + ) + ); $out .= "
    {$searchLink}{$caption}
    \n
    {$searchLink}{$caption}
    \n