* replace use of deprecated makeKnownLinkObj() by linkKnown() in core special pages
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 7 Jun 2009 18:45:52 +0000 (18:45 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 7 Jun 2009 18:45:52 +0000 (18:45 +0000)
* 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.

32 files changed:
includes/specials/SpecialAllmessages.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialAncientpages.php
includes/specials/SpecialBlockip.php
includes/specials/SpecialBrokenRedirects.php
includes/specials/SpecialConfirmemail.php
includes/specials/SpecialContributions.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialDoubleRedirects.php
includes/specials/SpecialFewestrevisions.php
includes/specials/SpecialImport.php
includes/specials/SpecialLinkSearch.php
includes/specials/SpecialListfiles.php
includes/specials/SpecialMergeHistory.php
includes/specials/SpecialMostlinked.php
includes/specials/SpecialMostrevisions.php
includes/specials/SpecialMovepage.php
includes/specials/SpecialNewpages.php
includes/specials/SpecialPopularpages.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialProtectedpages.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialSearch.php
includes/specials/SpecialShortpages.php
includes/specials/SpecialSpecialpages.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUnusedtemplates.php
includes/specials/SpecialUnwatchedpages.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUserlogin.php
includes/specials/SpecialWatchlist.php
includes/specials/SpecialWhatlinkshere.php

index f141d96..cfbe158 100644 (file)
@@ -52,8 +52,8 @@ function wfSpecialAllmessages() {
                $navText .= wfAllMessagesMakePhp( $messages );
                $wgOut->addHTML( $wgLang->pipeList( array(
                        'PHP',
-                       '<a href="' . $title->escapeLocalUrl( 'ot=html' ) . '">HTML</a>',
-                       '<a href="' . $title->escapeLocalUrl( 'ot=xml' ) . '">XML</a>' .
+                       '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'html' ) ) . '">HTML</a>',
+                       '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'xml' ) ) . '">XML</a>' .
                        '<pre>' . htmlspecialchars( $navText ) . '</pre>'
                ) ) );
        } else if ( $ot == 'xml' ) {
@@ -62,9 +62,9 @@ function wfSpecialAllmessages() {
                echo wfAllMessagesMakeXml( $messages );
        } else {
                $wgOut->addHTML( $wgLang->pipeList( array(
-                       '<a href="' . $title->escapeLocalUrl( 'ot=php' ) . '">PHP</a>',
+                       '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'php' ) ) . '">PHP</a>',
                        'HTML',
-                       '<a href="' . $title->escapeLocalUrl( 'ot=xml' ) . '">XML</a>'
+                       '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'xml' ) ) . '">XML</a>'
                ) ) );
                $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, "<span id=\"sp-allmessages-i-$i\">" . 
-                               htmlspecialchars( $key ) . '</span>' );
+                       // FIXME: the span should be taken care of in $customAttribs, shouldn't it?
+                       $pageLink = $sk->linkKnown(
+                               $titleObj,
+                               "<span id=\"sp-allmessages-i-$i\">" . htmlspecialchars( $key ) . '</span>'
+                       );
                } else {
                        $pageLink = $sk->makeBrokenLinkObj( $titleObj, "<span id=\"sp-allmessages-i-$i\">" . 
                                htmlspecialchars( $key ) . '</span>' );
                }
                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 ) );
                }
index 0a78f3d..b3d2d51 100644 (file)
@@ -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 .= "<tr>
-                   <td class='mw-label'>" .
-                       Xml::label( wfMsg( 'allpagesfrom' ), 'nsfrom' ) .
-                   "</td>
-                   <td class='mw-input'>" .
-                       Xml::input( 'from', 30, str_replace('_',' ',$from), array( 'id' => 'nsfrom' ) ) .
-                   "</td>
-               </tr>
-               <tr>
-                   <td class='mw-label'>" .
-                       Xml::label( wfMsg( 'allpagesto' ), 'nsto' ) .
-                   "</td>
-                   <td class='mw-input'>" .
-                       Xml::input( 'to', 30, str_replace('_',' ',$to), array( 'id' => 'nsto' ) ) .
-                   "</td>
-               </tr>
-               <tr>
-                   <td class='mw-label'>" .
-                       Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
-                   "</td>
-                   <td class='mw-input'>" .
-                       Xml::namespaceSelector( $namespace, null ) . ' ' .
-                       Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
-                   "</td>
-                   </tr>";
-           $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 .= "<tr>
+       <td class='mw-label'>" .
+                       Xml::label( wfMsg( 'allpagesfrom' ), 'nsfrom' ) .
+                       "       </td>
+       <td class='mw-input'>" .
+                       Xml::input( 'from', 30, str_replace('_',' ',$from), array( 'id' => 'nsfrom' ) ) .
+                       "       </td>
+</tr>
+<tr>
+       <td class='mw-label'>" .
+                       Xml::label( wfMsg( 'allpagesto' ), 'nsto' ) .
+                       "       </td>
+                       <td class='mw-input'>" .
+                       Xml::input( 'to', 30, str_replace('_',' ',$to), array( 'id' => 'nsto' ) ) .
+                       "               </td>
+</tr>
+<tr>
+       <td class='mw-label'>" .
+                       Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
+                       "       </td>
+                       <td class='mw-input'>" .
+                       Xml::namespaceSelector( $namespace, null ) . ' ' .
+                       Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
+                       "       </td>
+</tr>";
+               $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 ? '<div class="allpagesredirect">' : '' ) .
-                                                       $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) .
+                                                       $sk->linkKnown( $t, htmlspecialchars( $t->getText() ) ) .
                                                        ($s->page_is_redirect ? '</div>' : '' );
                                        } 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 .= "</td></tr></table>";
index 18556c2..4738a1a 100644 (file)
@@ -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) );
        }
 }
index 933924f..e7f43ee 100644 (file)
@@ -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
+               );
        }
        
        /**
index de33abc..01f0bd9 100644 (file)
@@ -64,15 +64,30 @@ class BrokenRedirectsPage extends PageQueryPage {
                        return '<s>' . $skin->link( $fromObj ) . '</s>';
                }
 
-               $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}";
                }
 
index 15a81e5..7090ee4 100644 (file)
@@ -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 {
index 19c895e..90c313e 100644 (file)
@@ -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 .= '<span class="mw-uctop">' . $this->messages['uctop'] . '</span>';
                        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 );
index 763bd9b..15d355c 100644 (file)
@@ -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() .
-                       '&timestamp=' . $rev->getTimestamp() );
+                       array(),
+                       array(
+                               'target' => $page->getPrefixedUrl(),
+                               'timestamp' => $rev->getTimestamp()
+                       )
+               );
 
-               $last = $sk->makeKnownLinkObj( $undelete,
+               $last = $sk->linkKnown(
+                       $undelete,
                        $this->messages['diff'],
-                       "target=" . $page->getPrefixedUrl() .
-                       "&timestamp=" . $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 = '<span class="history-deleted">' . $d . '</span>';
                } else {
-                       $link = $sk->makeKnownLinkObj( $undelete, $d,
-                               'target=' . $page->getPrefixedUrl() .
-                               '&timestamp=' . $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 );
index 28ffccb..78ab341 100644 (file)
@@ -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}" );
index b8331fb..35311d7 100644 (file)
@@ -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 );
        }
index 18054d6..5105b1f 100644 (file)
@@ -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( "<li>" . $skin->makeKnownLinkObj( $title ) . " " .
+                       $wgOut->addHTML( "<li>" . $skin->linkKnown( $title ) . " " .
                                wfMsgExt( 'import-revision-count', array( 'parsemag', 'escape' ), $localCount ) .
                                "</li>\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 );
                        }
index 267ef69..242c8ec 100644 (file)
@@ -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 );
index d3ad50e..dbfdbd5 100644 (file)
@@ -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 );
index ead8a3b..1b4ef30 100644 (file)
@@ -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 = '<span class="history-deleted">' . $pageLink . '</span>';
                }
@@ -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 '<span class="history-deleted">' . $wgLang->timeanddate( $ts, true ) . '</span>';
                } else {
-                       $link = $this->sk->makeKnownLinkObj( $titleObj,
-                               $wgLang->timeanddate( $ts, true ), "target=$target&timestamp=$ts" );
+                       $link = $this->sk->linkKnown(
+                               $titleObj,
+                               $wgLang->timeanddate( $ts, true ),
+                               array(),
+                               array(
+                                       'target' => $target,
+                                       'timestamp' => $ts
+                               )
+                       );
                        if( $this->isDeleted($row, Revision::DELETED_TEXT) )
                                $link = '<span class="history-deleted">' . $link . '</span>';
                        return $link;
index cbe5e65..346bcbc 100644 (file)
@@ -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 );
        }
 
        /**
index f5a0f8c..414e8d9 100644 (file)
@@ -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);
        }
index 2605542..70b1594 100644 (file)
@@ -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 );
                                }
index c970fdf..20cb120 100644 (file)
@@ -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 ) . ' ' .
index eb57273..88b90bc 100644 (file)
@@ -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);
        }
 }
index 0d95e5f..3a6b3c2 100644 (file)
@@ -136,7 +136,10 @@ class SpecialPrefixindex extends SpecialAllpages {
                                        $t = Title::makeTitle( $s->page_namespace, $s->page_title );
                                        if( $t ) {
                                                $link = ($s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) .
-                                                       $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) .
+                                                       $sk->linkKnown(
+                                                               $t,
+                                                               htmlspecialchars( $t->getText() )
+                                                       ) .
                                                        ($s->page_is_redirect ? '</div>' : '' );
                                        } else {
                                                $link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
@@ -170,17 +173,26 @@ class SpecialPrefixindex extends SpecialAllpages {
                                                $nsForm .
                                        '</td>
                                        <td id="mw-prefixindex-nav-form">' .
-                                               $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 .= "</td></tr>" .
index 1b12970..01b895f 100644 (file)
@@ -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;
index 3c54ae5..f8697a2 100644 (file)
@@ -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( '<p>'.implode($links,' / ').'</p>' );
index a0e7e78..0055495 100644 (file)
@@ -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 = '<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>';
                }
@@ -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 = "<span class='searchalttitle'>"
-                               .wfMsg('search-redirect',$this->sk->makeKnownLinkObj( $redirectTitle, $redirectText))
-                               ."</span>";
+                       $redirect = "<span class='searchalttitle'>" .
+                               wfMsg(
+                                       'search-redirect',
+                                       $this->sk->linkKnown(
+                                               $redirectTitle,
+                                               $redirectText
+                                       )
+                               ) .
+                               "</span>";
+
                $section = '';
+
                if( !is_null($sectionTitle) )
-                       $section = "<span class='searchalttitle'>"
-                               .wfMsg('search-section', $this->sk->makeKnownLinkObj( $sectionTitle, $sectionText))
-                               ."</span>";
+                       $section = "<span class='searchalttitle'>" .
+                               wfMsg(
+                                       'search-section', $this->sk->linkKnown(
+                                               $sectionTitle,
+                                               $sectionText
+                                       )
+                               ) .
+                               "</span>";
 
                // format text extract
                $extract = "<div class='searchresult'>".$result->getTextSnippet($terms)."</div>";
@@ -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 = "<span class='searchalttitle'>"
-                               .wfMsg('search-redirect',$this->sk->makeKnownLinkObj( $redirectTitle, $redirectText))
-                               ."</span>";
+                       $redirect = "<span class='searchalttitle'>" .
+                               wfMsg(
+                                       'search-redirect',
+                                       $this->sk->linkKnown(
+                                               $redirectTitle,
+                                               $redirectText
+                                       )
+                               ) .
+                               "</span>";
 
                $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 .= "</ul><div class='mw-search-interwiki-project'><span class='mw-search-interwiki-more'>
                                {$searchLink}</span>{$caption}</div>\n<ul>";
                }
@@ -801,13 +853,23 @@ class SpecialSearch {
                $opt['redirs'] = $this->searchRedirects ? 1 : 0;
 
                $st = SpecialPage::getTitleFor( 'Search' );
-               $stParams = wfArrayToCGI( array( 'search' => $term, 'fulltext' => wfMsg( 'search' ) ), $opt );
+               $stParams = array_merge(
+                       array(
+                               'search' => $term,
+                               'fulltext' => wfMsg( 'search' )
+                       ),
+                       $opt
+               );
 
-               return Xml::element( 'a',
-                       array( 'href'=> $st->getLocalURL( $stParams ), 'title' => $tooltip, 
-                              'onmousedown' => 'mwSearchHeaderClick(this);',
-                              'onkeydown' => 'mwSearchHeaderClick(this);'),
-                       $label );
+               return Xml::element(
+                       'a',
+                       array(
+                               'href' => $st->getLocalURL( $stParams ),
+                               'title' => $tooltip, 
+                               'onmousedown' => 'mwSearchHeaderClick(this);',
+                               'onkeydown' => 'mwSearchHeaderClick(this);'),
+                       $label
+               );
        }
 
        /** Check if query starts with image: prefix */
@@ -929,7 +991,7 @@ class SpecialSearchOld {
                        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;
                        }
                }
@@ -974,14 +1036,17 @@ class SpecialSearchOld {
                        $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
+                       );
 
                        $wgOut->addHTML('<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>');
                }
@@ -1208,7 +1273,10 @@ class SpecialSearchOld {
                $t = $result->getTitle();
                $sk = $wgUser->getSkin();
 
-               $link = $sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms));
+               $link = $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
@@ -1234,14 +1302,26 @@ class SpecialSearchOld {
                $sectionText = $result->getSectionSnippet($terms);
                $redirect = '';
                if( !is_null($redirectTitle) )
-                       $redirect = "<span class='searchalttitle'>"
-                               .wfMsg('search-redirect',$sk->makeKnownLinkObj( $redirectTitle, $redirectText))
-                               ."</span>";
+                       $redirect = "<span class='searchalttitle'>" .
+                               wfMsg(
+                                       'search-redirect',
+                                       $sk->linkKnown(
+                                               $redirectTitle,
+                                               $redirectText
+                                       )
+                               ) .
+                               "</span>";
                $section = '';
                if( !is_null($sectionTitle) )
-                       $section = "<span class='searchalttitle'>"
-                               .wfMsg('search-section', $sk->makeKnownLinkObj( $sectionTitle, $sectionText))
-                               ."</span>";
+                       $section = "<span class='searchalttitle'>" .
+                               wfMsg(
+                                       'search-section',
+                                       $sk->linkKnown(
+                                               $sectionTitle,
+                                               $sectionText
+                                       )
+                               ) .
+                               "</span>";
 
                // format text extract
                $extract = "<div class='searchresult'>".$result->getTextSnippet($terms)."</div>";
@@ -1269,12 +1349,20 @@ class SpecialSearchOld {
                $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...
@@ -1375,16 +1463,25 @@ class SpecialSearchOld {
                $t = $result->getTitle();
                $sk = $wgUser->getSkin();
 
-               $link = $sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms));
+               $link = $sk->linkKnown(
+                       $t,
+                       $result->getTitleSnippet( $terms )
+               );
 
                // format redirect if any
                $redirectTitle = $result->getRedirectTitle();
                $redirectText = $result->getRedirectSnippet($terms);
                $redirect = '';
                if( !is_null($redirectTitle) )
-                       $redirect = "<span class='searchalttitle'>"
-                               .wfMsg('search-redirect',$sk->makeKnownLinkObj( $redirectTitle, $redirectText))
-                               ."</span>";
+                       $redirect = "<span class='searchalttitle'>" .
+                               wfMsg(
+                                       'search-redirect', 
+                                       $sk->linkKnown(
+                                               $redirectTitle,
+                                               $redirectText
+                                       )
+                               ) .
+                               "</span>";
 
                $out = "";
                // display project name
@@ -1400,8 +1497,15 @@ class SpecialSearchOld {
                        }
                        // "more results" link (special page stuff could be localized, but we might not know target lang)
                        $searchTitle = Title::newFromText($t->getInterwiki().":Special:Search");
-                       $searchLink = $sk->makeKnownLinkObj( $searchTitle, wfMsg('search-interwiki-more'),
-                               wfArrayToCGI(array('search' => $query, 'fulltext' => 'Search')));
+                       $searchLink = $sk->linkKnown(
+                               $searchTitle,
+                               wfMsg( 'search-interwiki-more' ),
+                               array(),
+                               array(
+                                       'search' => $query,
+                                       'fulltext' => 'Search'
+                               )
+                       );
                        $out .= "</ul><div class='mw-search-interwiki-project'><span class='mw-search-interwiki-more'>{$searchLink}</span>{$caption}</div>\n<ul>";
                }
 
index 70f5c30..c41b15c 100644 (file)
@@ -74,10 +74,15 @@ class ShortPagesPage extends QueryPage {
                if ( !$title ) {
                        return '<!-- Invalid title ' .  htmlspecialchars( "{$result->namespace}:{$result->title}" ). '-->';
                }
-               $hlink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
+               $hlink = $skin->linkKnown(
+                       $title,
+                       wfMsgHtml( 'hist' ),
+                       array(),
+                       array( 'action' => 'history' )
+               );
                $plink = $this->isCached()
                                        ? $skin->link( $title )
-                                       : $skin->makeKnownLinkObj( $title );
+                                       : $skin->linkKnown( $title );
                $size = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( htmlspecialchars( $result->value ) ) );
 
                return $title->exists()
index c44a327..84ab689 100644 (file)
@@ -60,7 +60,7 @@ function wfSpecialSpecialpages() {
                $wgOut->addHTML( "<td width='30%' valign='top'><ul>\n" );
                foreach( $sortedPages as $desc => $specialpage ) {
                        list( $title, $restricted ) = $specialpage;
-                       $link = $sk->makeKnownLinkObj( $title , htmlspecialchars( $desc ) );
+                       $link = $sk->linkKnown( $title , htmlspecialchars( $desc ) );
                        if( $restricted ) {
                                $includesRestrictedPages = true;
                                $wgOut->addHTML( "<li class='mw-specialpages-page mw-specialpagerestricted'><strong>{$link}</strong></li>\n" );
index 53c5789..0e53dbb 100644 (file)
@@ -677,8 +677,12 @@ class UndeleteForm {
                $wgOut->addHTML( "<ul>\n" );
                while( $row = $result->fetchObject() ) {
                        $title = Title::makeTitleSafe( $row->ar_namespace, $row->ar_title );
-                       $link = $sk->makeKnownLinkObj( $undelete, htmlspecialchars( $title->getPrefixedText() ),
-                               'target=' . $title->getPrefixedUrl() );
+                       $link = $sk->linkKnown(
+                               $undelete,
+                               htmlspecialchars( $title->getPrefixedText() ),
+                               array(),
+                               array( 'target' => $title->getPrefixedUrl() )
+                       );
                        $revs = wfMsgExt( 'undeleterevisions',
                                array( 'parseinline' ),
                                $wgLang->formatNum( $row->count ) );
@@ -718,7 +722,7 @@ class UndeleteForm {
 
                $wgOut->setPageTitle( wfMsg( 'undeletepage' ) );
 
-               $link = $skin->makeKnownLinkObj(
+               $link = $skin->linkKnown(
                        SpecialPage::getTitleFor( 'Undelete', $this->mTargetObj->getPrefixedDBkey() ),
                        htmlspecialchars( $this->mTargetObj->getPrefixedText() )
                );
@@ -770,7 +774,7 @@ class UndeleteForm {
                        Xml::openElement( 'div' ) .
                        Xml::openElement( 'form', array(
                                'method' => 'post',
-                               'action' => $self->getLocalURL( "action=submit" ) ) ) .
+                               'action' => $self->getLocalURL( array( 'action' => 'submit' ) ) ) ) .
                        Xml::element( 'input', array(
                                'type' => 'hidden',
                                'name' => 'target',
@@ -987,7 +991,7 @@ class UndeleteForm {
 
                if ( $this->mAllowed ) {
                        $titleObj = SpecialPage::getTitleFor( "Undelete" );
-                       $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' => 'undelete' ) );
                        $wgOut->addHTML( $top );
@@ -1111,8 +1115,16 @@ class UndeleteForm {
                        if( !$rev->userCan( Revision::DELETED_TEXT ) ) {
                                $last = wfMsgHtml('diff');
                        } else if( $remaining > 0 || ($earliestLiveTime && $ts > $earliestLiveTime) ) {
-                               $last = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml('diff'),
-                                       "target=" . $this->mTargetObj->getPrefixedUrl() . "&timestamp=$ts&diff=prev" );
+                               $last = $sk->linkKnown(
+                                       $titleObj,
+                                       wfMsgHtml('diff'),
+                                       array(),
+                                       array(
+                                               'target' => $this->mTargetObj->getPrefixedUrl(),
+                                               'timestamp' => $ts,
+                                               'diff' => 'prev'
+                                       )
+                               );
                        } else {
                                $last = wfMsgHtml('diff');
                        }
@@ -1201,8 +1213,15 @@ class UndeleteForm {
                if( !$rev->userCan(Revision::DELETED_TEXT) ) {
                        return '<span class="history-deleted">' . $time . '</span>';
                } else {
-                       $link = $sk->makeKnownLinkObj( $titleObj, $time,
-                               "target=".$this->mTargetObj->getPrefixedUrl()."&timestamp=$ts" );
+                       $link = $sk->linkKnown(
+                               $titleObj,
+                               $time,
+                               array(),
+                               array(
+                                       'target' => $this->mTargetObj->getPrefixedUrl(),
+                                       'timestamp' => $ts
+                               )
+                       );
                        if( $rev->isDeleted(Revision::DELETED_TEXT) )
                                $link = '<span class="history-deleted">' . $link . '</span>';
                        return $link;
@@ -1219,10 +1238,16 @@ class UndeleteForm {
                if( !$file->userCan(File::DELETED_FILE) ) {
                        return '<span class="history-deleted">' . $wgLang->timeanddate( $ts, true ) . '</span>';
                } else {
-                       $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ),
-                               "target=".$this->mTargetObj->getPrefixedUrl().
-                               "&file=$key" .
-                               "&token=" . urlencode( $wgUser->editToken( $key ) ) );
+                       $link = $sk->linkKnown(
+                               $titleObj,
+                               $wgLang->timeanddate( $ts, true ),
+                               array(),
+                               array(
+                                       'target' => $this->mTargetObj->getPrefixedUrl(),
+                                       'file' => $key,
+                                       'token' => $wgUser->editToken( $key )
+                               )
+                       );
                        if( $file->isDeleted(File::DELETED_FILE) )
                                $link = '<span class="history-deleted">' . $link . '</span>';
                        return $link;
@@ -1281,7 +1306,7 @@ class UndeleteForm {
                                                $wgUser, $this->mComment) );
 
                                $skin = $wgUser->getSkin();
-                               $link = $skin->makeKnownLinkObj( $this->mTargetObj );
+                               $link = $skin->linkKnown( $this->mTargetObj );
                                $wgOut->addHTML( wfMsgWikiHtml( 'undeletedpage', $link ) );
                        } else {
                                $wgOut->showFatalError( wfMsg( "cannotundelete" ) );
index 89acd09..5aaf363 100644 (file)
@@ -33,11 +33,18 @@ class UnusedtemplatesPage extends QueryPage {
 
        function formatResult( $skin, $result ) {
                $title = Title::makeTitle( NS_TEMPLATE, $result->title );
-               $pageLink = $skin->makeKnownLinkObj( $title, '', 'redirect=no' );
-               $wlhLink = $skin->makeKnownLinkObj(
+               $pageLink = $skin->linkKnown(
+                       $title,
+                       null,
+                       array(),
+                       array( 'redirect' => 'no' )
+               );
+               $wlhLink = $skin->linkKnown(
                        SpecialPage::getTitleFor( 'Whatlinkshere' ),
                        wfMsgHtml( 'unusedtemplateswlh' ),
-                       'target=' . $title->getPrefixedUrl() );
+                       array(),
+                       array( 'target' => $title->getPrefixedUrl() )
+               );
                return wfSpecialList( $pageLink, $wlhLink );
        }
 
index 64ab372..b621ba7 100644 (file)
@@ -44,8 +44,16 @@ class UnwatchedpagesPage extends QueryPage {
                $nt = Title::makeTitle( $result->namespace, $result->title );
                $text = $wgContLang->convert( $nt->getPrefixedText() );
 
-               $plink = $skin->makeKnownLinkObj( $nt, htmlspecialchars( $text ) );
-               $wlink = $skin->makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' );
+               $plink = $skin->linkKnown(
+                       $nt,
+                       htmlspecialchars( $text )
+               );
+               $wlink = $skin->linkKnown(
+                       $nt,
+                       wfMsgHtml( 'watch' ),
+                       array(),
+                       array( 'action' => 'watch'
+               );
 
                return wfSpecialList( $plink, $wlink );
        }
index 1e4a81a..3a9b36c 100644 (file)
@@ -632,7 +632,7 @@ class UploadForm {
                }
 
                if( $file->exists() ) {
-                       $dlink = $sk->makeKnownLinkObj( $file->getTitle() );
+                       $dlink = $sk->linkKnown( $file->getTitle() );
                        if ( $file->allowInlineDisplay() ) {
                                $dlink2 = $sk->makeImageLinkObj( $file->getTitle(), wfMsgExt( 'fileexists-thumb', 'parseinline' ),
                                        $file->getName(), $align, array(), false, true );
@@ -647,12 +647,17 @@ class UploadForm {
                        $warning .= '<li>' . wfMsgExt( 'fileexists', array('parseinline','replaceafter'), $dlink ) . '</li>' . $dlink2;
 
                } elseif( $file->getTitle()->getArticleID() ) {
-                       $lnk = $sk->makeKnownLinkObj( $file->getTitle(), '', 'redirect=no' );
+                       $lnk = $sk->linkKnown(
+                               $file->getTitle(),
+                               null,
+                               array(),
+                               array( 'redirect' => 'no' )
+                       );
                        $warning .= '<li>' . wfMsgExt( 'filepageexists', array( 'parseinline', 'replaceafter' ), $lnk ) . '</li>';
                } elseif ( $file_lc && $file_lc->exists() ) {
                        # Check if image with lowercase extension exists.
                        # It's not forbidden but in 99% it makes no sense to upload the same filename with uppercase extension
-                       $dlink = $sk->makeKnownLinkObj( $nt_lc );
+                       $dlink = $sk->linkKnown( $nt_lc );
                        if ( $file_lc->allowInlineDisplay() ) {
                                $dlink2 = $sk->makeImageLinkObj( $nt_lc, wfMsgExt( 'fileexists-thumb', 'parseinline' ),
                                        $nt_lc->getText(), $align, array(), false, true );
@@ -677,7 +682,7 @@ class UploadForm {
                        $file_thb = wfLocalFile( $nt_thb );
                        if ($file_thb->exists() ) {
                                # Check if an image without leading '180px-' (or similiar) exists
-                               $dlink = $sk->makeKnownLinkObj( $nt_thb);
+                               $dlink = $sk->linkKnown( $nt_thb );
                                if ( $file_thb->allowInlineDisplay() ) {
                                        $dlink2 = $sk->makeImageLinkObj( $nt_thb,
                                                wfMsgExt( 'fileexists-thumb', 'parseinline' ),
@@ -713,8 +718,15 @@ class UploadForm {
                        # If the file existed before and was deleted, warn the user of this
                        # Don't bother doing so if the file exists now, however
                        $ltitle = SpecialPage::getTitleFor( 'Log' );
-                       $llink = $sk->makeKnownLinkObj( $ltitle, wfMsgHtml( 'deletionlog' ),
-                               'type=delete&page=' . $file->getTitle()->getPrefixedUrl() );
+                       $llink = $sk->linkKnown(
+                               $ltitle,
+                               wfMsgHtml( 'deletionlog' ),
+                               array(),
+                               array(
+                                       'type' => 'delete',
+                                       'page' => $file->getTitle()->getPrefixedUrl()
+                               )
+                       );
                        $warning .= '<li>' . wfMsgWikiHtml( 'filewasdeleted', $llink ) . '</li>';
                }
                return $warning;
@@ -992,7 +1004,7 @@ wgUploadAutoFill = {$autofill};
                                $link = wfMsgExt(
                                        $wgUser->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted',
                                        array( 'parse', 'replaceafter' ),
-                                       $wgUser->getSkin()->makeKnownLinkObj(
+                                       $wgUser->getSkin()->linkKnown(
                                                SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedText() ),
                                                wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $count )
                                        )
index 2c21de6..250a12d 100644 (file)
@@ -1005,12 +1005,17 @@ class LoginForm {
        function makeLanguageSelectorLink( $text, $lang ) {
                global $wgUser;
                $self = SpecialPage::getTitleFor( 'Userlogin' );
-               $attr[] = 'uselang=' . $lang;
+               $attr = array( 'uselang' => $lang );
                if( $this->mType == 'signup' )
-                       $attr[] = 'type=signup';
+                       $attr['type'] = 'signup';
                if( $this->mReturnTo )
-                       $attr[] = 'returnto=' . $this->mReturnTo;
+                       $attr['returnto'] = $this->mReturnTo;
                $skin = $wgUser->getSkin();
-               return $skin->makeKnownLinkObj( $self, htmlspecialchars( $text ), implode( '&', $attr ) );
+               return $skin->linkKnown(
+                       $self,
+                       htmlspecialchars( $text ),
+                       array(),
+                       $attr
+               );
        }
 }
index c715a13..1d0b8f1 100644 (file)
@@ -21,8 +21,12 @@ function wfSpecialWatchlist( $par ) {
        # Anons don't get a watchlist
        if( $wgUser->isAnon() ) {
                $wgOut->setPageTitle( wfMsg( 'watchnologin' ) );
-               $llink = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogin' ), 
-                       wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() );
+               $llink = $skin->linkKnown(
+                       SpecialPage::getTitleFor( 'Userlogin' ), 
+                       wfMsgHtml( 'loginreqlink' ),
+                       array(),
+                       array( 'returnto' => $specialTitle->getPrefixedUrl() )
+               );
                $wgOut->addHTML( wfMsgWikiHtml( 'watchlistanontext', $llink ) );
                return;
        }
@@ -256,34 +260,100 @@ function wfSpecialWatchlist( $par ) {
        $hideLinktext = wfMsgHtml( 'hide' );
        # Hide/show minor edits
        $label = $hideMinor ? $showLinktext : $hideLinktext;
-       $linkBits = wfArrayToCGI( array( 'hideMinor' => 1 - (int)$hideMinor ), $nondefaults );
-       $links[] = wfMsgHtml( 'rcshowhideminor', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+       $linkBits = array_merge(
+               array( 'hideMinor' => 1 - (int)$hideMinor ),
+               $nondefaults
+       );
+       $links[] = wfMsgHtml(
+               'rcshowhideminor',
+               $skin->linkKnown(
+                       $thisTitle,
+                       $label,
+                       array(),
+                       $linkBits
+               )
+       );
 
        # Hide/show bot edits
        $label = $hideBots ? $showLinktext : $hideLinktext;
-       $linkBits = wfArrayToCGI( array( 'hideBots' => 1 - (int)$hideBots ), $nondefaults );
-       $links[] = wfMsgHtml( 'rcshowhidebots', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+       $linkBits = array_merge(
+               array( 'hideBots' => 1 - (int)$hideBots ),
+               $nondefaults
+       );
+       $links[] = wfMsgHtml(
+               'rcshowhidebots',
+               $skin->linkKnown(
+                       $thisTitle,
+                       $label,
+                       array(),
+                       $linkBits
+               )
+       );
 
        # Hide/show anonymous edits
        $label = $hideAnons ? $showLinktext : $hideLinktext;
-       $linkBits = wfArrayToCGI( array( 'hideAnons' => 1 - (int)$hideAnons ), $nondefaults );
-       $links[] = wfMsgHtml( 'rcshowhideanons', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+       $linkBits = array_merge(
+               array( 'hideAnons' => 1 - (int)$hideAnons ),
+               $nondefaults
+       );
+       $links[] = wfMsgHtml(
+               'rcshowhideanons',
+               $skin->linkKnown(
+                       $thisTitle,
+                       $label,
+                       array(),
+                       $linkBits
+               )
+       );
 
        # Hide/show logged in edits
        $label = $hideLiu ? $showLinktext : $hideLinktext;
-       $linkBits = wfArrayToCGI( array( 'hideLiu' => 1 - (int)$hideLiu ), $nondefaults );
-       $links[] = wfMsgHtml( 'rcshowhideliu', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+       $linkBits = array_merge(
+               array( 'hideLiu' => 1 - (int)$hideLiu ),
+               $nondefaults
+       );
+       $links[] = wfMsgHtml(
+               'rcshowhideliu',
+               $skin->linkKnown(
+                       $thisTitle,
+                       $label,
+                       array(),
+                       $linkBits
+               )
+       );
 
        # Hide/show own edits
        $label = $hideOwn ? $showLinktext : $hideLinktext;
-       $linkBits = wfArrayToCGI( array( 'hideOwn' => 1 - (int)$hideOwn ), $nondefaults );
-       $links[] = wfMsgHtml( 'rcshowhidemine', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+       $linkBits = array_merge(
+               array( 'hideOwn' => 1 - (int)$hideOwn ),
+               $nondefaults
+       );
+       $links[] = wfMsgHtml(
+               'rcshowhidemine',
+               $skin->linkKnown(
+                       $thisTitle,
+                       $label,
+                       array(),
+                       $linkBits
+               )
+       );
 
        # Hide/show patrolled edits
        if( $wgUser->useRCPatrol() ) {
                $label = $hidePatrolled ? $showLinktext : $hideLinktext;
-               $linkBits = wfArrayToCGI( array( 'hidePatrolled' => 1 - (int)$hidePatrolled ), $nondefaults );
-               $links[] = wfMsgHtml( 'rcshowhidepatr', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+               $linkBits = array_merge(
+                       array( 'hidePatrolled' => 1 - (int)$hidePatrolled ),
+                       $nondefaults
+               );
+               $links[] = wfMsgHtml(
+                       'rcshowhidepatr',
+                       $skin->linkKnown(
+                               $thisTitle,
+                               $label,
+                               array(),
+                               $linkBits
+                       )
+               );
        }
 
        # Namespace filter and put the whole form together.
index dd8eee3..5671228 100644 (file)
@@ -258,8 +258,18 @@ class SpecialWhatLinksHere extends SpecialPage {
                        }
                }
 
-               $suppressRedirect = $row->page_is_redirect ? 'redirect=no' : '';
-               $link = $this->skin->makeKnownLinkObj( $nt, '', $suppressRedirect );
+               if( $row->page_is_redirect ) {
+                       $query = array( 'redirect' => 'no' );
+               } else {
+                       $query = array();
+               }
+
+               $link = $this->skin->linkKnown(
+                       $nt,
+                       null,
+                       array(),
+                       $query
+               );
 
                // Display properties (redirect or template)
                $propsText = '';
@@ -294,11 +304,21 @@ class SpecialWhatLinksHere extends SpecialPage {
                        $title = SpecialPage::getTitleFor( 'Whatlinkshere' );
 
                $targetText = $target->getPrefixedUrl();
-               return $this->skin->makeKnownLinkObj( $title, $text, 'target=' . $targetText );
+               return $this->skin->linkKnown(
+                       $title,
+                       $text,
+                       array(),
+                       array( 'target' => $targetText )
+               );
        }
 
        function makeSelfLink( $text, $query ) {
-               return $this->skin->makeKnownLinkObj( $this->selfTitle, $text, $query );
+               return $this->skin->linkKnown(
+                       $this->selfTitle,
+                       $text,
+                       array(),
+                       $query
+               );
        }
 
        function getPrevNext( $prevId, $nextId ) {
@@ -313,18 +333,18 @@ class SpecialWhatLinksHere extends SpecialPage {
 
                if ( 0 != $prevId ) {
                        $overrides = array( 'from' => $this->opts->getValue( 'back' ) );
-                       $prev = $this->makeSelfLink( $prev, wfArrayToCGI( $overrides, $changed ) );
+                       $prev = $this->makeSelfLink( $prev, array_merge( $overrides, $changed ) );
                }
                if ( 0 != $nextId ) {
                        $overrides = array( 'from' => $nextId, 'back' => $prevId );
-                       $next = $this->makeSelfLink( $next, wfArrayToCGI( $overrides, $changed ) );
+                       $next = $this->makeSelfLink( $next, array_merge( $overrides, $changed ) );
                }
 
                $limitLinks = array();
                foreach ( $this->limits as $limit ) {
                        $prettyLimit = $wgLang->formatNum( $limit );
                        $overrides = array( 'limit' => $limit );
-                       $limitLinks[] = $this->makeSelfLink( $prettyLimit, wfArrayToCGI( $overrides, $changed ) );
+                       $limitLinks[] = $this->makeSelfLink( $prettyLimit, array_merge( $overrides, $changed ) );
                }
 
                $nums = $wgLang->pipeList( $limitLinks );
@@ -391,7 +411,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                        $chosen = $this->opts->getValue( $type );
                        $msg = wfMsgHtml( "whatlinkshere-{$type}", $chosen ? $show : $hide );
                        $overrides = array( $type => !$chosen );
-                       $links[] = $this->makeSelfLink( $msg, wfArrayToCGI( $overrides, $changed ) );
+                       $links[] = $this->makeSelfLink( $msg, array_merge( $overrides, $changed ) );
                }
                return Xml::fieldset( wfMsg( 'whatlinkshere-filters' ), $wgLang->pipeList( $links ) );
        }