* replace some use of deprecated makeKnownLinkObj() by link() in core
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sat, 6 Jun 2009 22:42:48 +0000 (22:42 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sat, 6 Jun 2009 22:42:48 +0000 (22:42 +0000)
* use array type parameter instead of string to escapeLocalUrl(), getFullURL() and getFullUrl() for readability

includes/Article.php
includes/CategoryPage.php
includes/ChangesList.php
includes/EditPage.php
includes/FileDeleteForm.php
includes/FileRevertForm.php
includes/ImagePage.php

index 56ad67a..2ed4b5a 100644 (file)
@@ -836,7 +836,13 @@ class Article {
                        // This is an internally redirected page view.
                        // We'll need a backlink to the source page for navigation.
                        if( wfRunHooks( 'ArticleViewRedirect', array( &$this ) ) ) {
-                               $redir = $sk->makeKnownLinkObj( $this->mRedirectedFrom, '', 'redirect=no' );
+                               $redir = $sk->link(
+                                       $this->mRedirectedFrom,
+                                       null,
+                                       array(),
+                                       array( 'redirect' => 'no' ),
+                                       array( 'known', 'noclasses' )
+                               );
                                $s = wfMsgExt( 'redirectedfrom', array( 'parseinline', 'replaceafter' ), $redir );
                                $wgOut->setSubtitle( $s );
 
@@ -1040,15 +1046,24 @@ class Article {
 
                # If we have been passed an &rcid= parameter, we want to give the user a
                # chance to mark this new article as patrolled.
-               if( !empty($rcid) && $this->mTitle->exists() && $this->mTitle->quickUserCan('patrol') ) {
+               if( !empty( $rcid ) && $this->mTitle->exists() && $this->mTitle->quickUserCan( 'patrol' ) ) {
                        $wgOut->addHTML(
                                "<div class='patrollink'>" .
-                                       wfMsgHtml( 'markaspatrolledlink',
-                                       $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml('markaspatrolledtext'),
-                                               "action=markpatrolled&rcid=$rcid" )
-                                       ) .
+                                       wfMsgHtml(
+                                               'markaspatrolledlink',
+                                               $sk->link(
+                                                       $this->mTitle,
+                                                       wfMsgHtml( 'markaspatrolledtext' ),
+                                                       array(),
+                                                       array(
+                                                               'action' => 'markpatrolled',
+                                                               'rcid' => $rcid
+                                                       ),
+                                                       array( 'known', 'noclasses' )
+                                               )
+                                       ) .
                                '</div>'
-                        );
+                       );
                }
 
                # Trackbacks
@@ -1123,7 +1138,13 @@ class Article {
                // the loop prepends the arrow image before the link, so the first case needs to be outside
                $title = array_shift( $target );
                if( $forceKnown ) {
-                       $link = $sk->makeKnownLinkObj( $title, htmlspecialchars( $title->getFullText() ) );
+                       $link = $sk->link(
+                               $title,
+                               htmlspecialchars( $title->getFullText() ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       );
                } else {
                        $link = $sk->link( $title, htmlspecialchars( $title->getFullText() ) );
                }
@@ -1131,7 +1152,13 @@ class Article {
                foreach( $target as $rt ) {
                        if( $forceKnown ) {
                                $link .= '<img src="'.$imageUrl2.'" alt="'.$alt2.' " />'
-                                       . $sk->makeKnownLinkObj( $rt, htmlspecialchars( $rt->getFullText() ) );
+                                       . $sk->link(
+                                               $rt,
+                                               htmlspecialchars( $rt->getFullText() ),
+                                               array(),
+                                               array(),
+                                               array( 'known', 'noclasses' )
+                                       );
                        } else {
                                $link .= '<img src="'.$imageUrl2.'" alt="'.$alt2.' " />'
                                        . $sk->link( $rt, htmlspecialchars( $rt->getFullText() ) );
@@ -2404,7 +2431,14 @@ class Article {
 
                wfDebug( "Article::confirmDelete\n" );
 
-               $wgOut->setSubtitle( wfMsgHtml( 'delete-backlink', $wgUser->getSkin()->makeKnownLinkObj( $this->mTitle ) ) );
+               $deleteBackLink = $wgUser->getSkin()->link(
+                       $this->mTitle,
+                       null,
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               );
+               $wgOut->setSubtitle( wfMsgHtml( 'delete-backlink', $deleteBackLink ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->addWikiMsg( 'confirmdeletetext' );
 
@@ -3052,23 +3086,74 @@ class Article {
                $sk = $wgUser->getSkin();
                $lnk = $current
                        ? wfMsgHtml( 'currentrevisionlink' )
-                       : $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'currentrevisionlink' ) );
+                       : $sk->link(
+                               $this->mTitle,
+                               wfMsgHtml( 'currentrevisionlink' ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       );
                $curdiff = $current
                        ? wfMsgHtml( 'diff' )
-                       : $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'diff' ), 'diff=cur&oldid='.$oldid );
+                       : $sk->link(
+                               $this->mTitle,
+                               wfMsgHtml( 'diff' ),
+                               array(),
+                               array(
+                                       'diff' => 'cur',
+                                       'oldid' => $oldid
+                               ),
+                               array( 'known', 'noclasses' )
+                       );
                $prev = $this->mTitle->getPreviousRevisionID( $oldid ) ;
                $prevlink = $prev
-                       ? $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'previousrevision' ), 'direction=prev&oldid='.$oldid )
+                       ? $sk->link(
+                               $this->mTitle,
+                               wfMsgHtml( 'previousrevision' ),
+                               array(),
+                               array(
+                                       'direction' => 'prev',
+                                       'oldid' => $oldid
+                               ),
+                               array( 'known', 'noclasses' )
+                       )
                        : wfMsgHtml( 'previousrevision' );
                $prevdiff = $prev
-                       ? $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'diff' ), 'diff=prev&oldid='.$oldid )
+                       ? $sk->link(
+                               $this->mTitle,
+                               wfMsgHtml( 'diff' ),
+                               array(),
+                               array(
+                                       'diff' => 'prev',
+                                       'oldid' => $oldid
+                               ),
+                               array( 'known', 'noclasses' )
+                       )
                        : wfMsgHtml( 'diff' );
                $nextlink = $current
                        ? wfMsgHtml( 'nextrevision' )
-                       : $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextrevision' ), 'direction=next&oldid='.$oldid );
+                       : $sk->link(
+                               $this->mTitle,
+                               wfMsgHtml( 'nextrevision' ),
+                               array(),
+                               array(
+                                       'direction' => 'next',
+                                       'oldid' => $oldid
+                               ),
+                               array( 'known', 'noclasses' )
+                       );
                $nextdiff = $current
                        ? wfMsgHtml( 'diff' )
-                       : $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'diff' ), 'diff=next&oldid='.$oldid );
+                       : $sk->link(
+                               $this->mTitle,
+                               wfMsgHtml( 'diff' ),
+                               array(),
+                               array(
+                                       'diff' => 'next',
+                                       'oldid' => $oldid
+                               ),
+                               array( 'known', 'noclasses' )
+                       );
 
                $cdel='';
                if( $wgUser->isAllowed( 'deleterevision' ) ) {
@@ -3080,11 +3165,17 @@ class Article {
                        // If revision was hidden from sysops
                                $cdel = wfMsgHtml( 'rev-delundel' );
                        } else {
-                               $cdel = $sk->makeKnownLinkObj( $revdel,
+                               $cdel = $sk->link(
+                                       $revdel,
                                        wfMsgHtml('rev-delundel'),
-                                       'type=revision' . 
-                                       '&target=' . urlencode( $this->mTitle->getPrefixedDbkey() ) .
-                                       '&ids=' . urlencode( $oldid ) );
+                                       array(),
+                                       array(
+                                               'type' => 'revision',
+                                               'target' => urlencode( $this->mTitle->getPrefixedDbkey() ),
+                                               'ids' => urlencode( $oldid )
+                                       ),
+                                       array( 'known', 'noclasses' )
+                               );
                                // Bolden oversighted content
                                if( $revision->isDeleted( Revision::DELETED_RESTRICTED ) )
                                        $cdel = "<strong>$cdel</strong>";
index c75eb19..f7af3d6 100644 (file)
@@ -144,8 +144,13 @@ class CategoryViewer {
        function addSubcategory( $title, $sortkey, $pageLength ) {
                global $wgContLang;
                // Subcategory; strip the 'Category' namespace from the link text.
-               $this->children[] = $this->getSkin()->makeKnownLinkObj(
-                       $title, $wgContLang->convertHtml( $title->getText() ) );
+               $this->children[] = $this->getSkin()->link(
+                       $title,
+                       $wgContLang->convertHtml( $title->getText() ).
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               );
 
                $this->children_start_char[] = $this->getSubcategorySortChar( $title, $sortkey );
        }
@@ -191,7 +196,14 @@ class CategoryViewer {
                global $wgContLang;
                $titletext = $wgContLang->convertHtml( $title->getPrefixedText() );
                $this->articles[] = $isRedirect
-                       ? '<span class="redirect-in-category">' . $this->getSkin()->makeKnownLinkObj( $title, $titletext ) . '</span>'
+                       ? '<span class="redirect-in-category">' .
+                               $this->getSkin()->link(
+                                       $title,
+                                       $titletext,
+                                       array(),
+                                       array(),
+                                       array( 'known', 'noclasses' )
+                               ) . '</span>'
                        : $this->getSkin()->makeSizeLinkObj( $pageLength, $title, $titletext );
                $this->articles_start_char[] = $wgContLang->convert( $wgContLang->firstChar( $sortkey ) );
        }
index d14726b..2861022 100644 (file)
@@ -160,12 +160,32 @@ class ChangesList {
                # Diff
                $s .= '(' . $this->message['diff'] . ') (';
                # Hist
-               $s .= $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), $this->message['hist'], 
-                       'action=history' ) . ') . . ';
+               $s .= $this->skin->link(
+                       $rc->getMovedToTitle(),
+                       $this->message['hist'],
+                       array(),
+                       array( 'action' => 'history' ),
+                       array( 'known', 'noclasses' )
+               ) . ') . . ';
                # "[[x]] moved to [[y]]"
                $msg = ( $rc->mAttribs['rc_type'] == RC_MOVE ) ? '1movedto2' : '1movedto2_redir';
-               $s .= wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
-                       $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
+               $s .= wfMsg(
+                       $msg,
+                       $this->skin->link(
+                               $rc->getTitle(),
+                               null,
+                               array(),
+                               array( 'redirect' => 'no' ),
+                               array( 'known', 'noclasses' )
+                       ),
+                       $this->skin->link(
+                               $rc->getMovedToTitle(),
+                               null,
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       )
+               );
        }
 
        protected function insertDateHeader( &$s, $rc_timestamp ) {
@@ -184,7 +204,13 @@ class ChangesList {
 
        protected function insertLog( &$s, $title, $logtype ) {
                $logname = LogPage::logName( $logtype );
-               $s .= '(' . $this->skin->makeKnownLinkObj($title, $logname ) . ')';
+               $s .= '(' . $this->skin->link(
+                       $title,
+                       $logname,
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               ) . ')';
        }
 
        protected function insertDiffHist( &$s, &$rc, $unpatrolled ) {
@@ -194,21 +220,36 @@ class ChangesList {
                } else if( !$this->userCan($rc,Revision::DELETED_TEXT) ) {
                        $diffLink = $this->message['diff'];
                } else {
-                       $rcidparam = $unpatrolled ? array( 'rcid' => $rc->mAttribs['rc_id'] ) : array();
-                       $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'],
-                               wfArrayToCGI( array(
-                                       'curid' => $rc->mAttribs['rc_cur_id'],
-                                       'diff'  => $rc->mAttribs['rc_this_oldid'],
-                                       'oldid' => $rc->mAttribs['rc_last_oldid'] ),
-                                       $rcidparam ),
-                               '', '', ' tabindex="'.$rc->counter.'"');
+                       $query = array(
+                               'curid' => $rc->mAttribs['rc_cur_id'],
+                               'diff'  => $rc->mAttribs['rc_this_oldid'],
+                               'oldid' => $rc->mAttribs['rc_last_oldid']
+                       );
+
+                       if( $unpatrolled ) {
+                               $query['rcid'] = $rc->mAttribs['rc_id'];
+                       };
+
+                       $diffLink = $this->skin->link(
+                               $rc->getTitle(),
+                               $this->message['diff'],
+                               array( 'tabindex' => $rc->counter ),
+                               $query,
+                               array( 'known', 'noclasses' )
+                       );
                }
                $s .= '('.$diffLink.') (';
                # History link
-               $s .= $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['hist'],
-                       wfArrayToCGI( array(
+               $s .= $this->skin->link(
+                       $rc->getTitle(),
+                       $this->message['hist'],
+                       array(),
+                       array(
                                'curid' => $rc->mAttribs['rc_cur_id'],
-                               'action' => 'history' ) ) );
+                               'action' => 'history'
+                       ),
+                       array( 'known', 'noclasses' )
+               );
                $s .= ') . . ';
        }
 
@@ -216,13 +257,29 @@ class ChangesList {
                global $wgContLang;
                # If it's a new article, there is no diff link, but if it hasn't been
                # patrolled yet, we need to give users a way to do so
-               $params = ( $unpatrolled && $rc->mAttribs['rc_type'] == RC_NEW ) ?
-                       'rcid='.$rc->mAttribs['rc_id'] : '';
+               $params = array();
+
+               if ( $unpatrolled && $rc->mAttribs['rc_type'] == RC_NEW ) {
+                       $params['rcid'] = $rc->mAttribs['rc_id'];
+               }
+
                if( $this->isDeleted($rc,Revision::DELETED_TEXT) ) {
-                       $articlelink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '', $params );
-                       $articlelink = '<span class="history-deleted">'.$articlelink.'</span>';
+                       $articlelink = $this->skin->link(
+                               $rc->getTitle(),
+                               null,
+                               array(),
+                               $params,
+                               array( 'known', 'noclasses' )
+                       );
+                       $articlelink = '<span class="history-deleted">' . $articlelink . '</span>';
                } else {
-                   $articlelink = ' '. $this->skin->makeKnownLinkObj( $rc->getTitle(), '', $params );
+                       $articlelink = ' '. $this->skin->link(
+                               $rc->getTitle(),
+                               null,
+                               array(),
+                               $params,
+                               array( 'known', 'noclasses' )
+                       );
                }
                # Bolden pages watched by this user
                if( $watched ) {
@@ -332,7 +389,7 @@ class ChangesList {
                }
        }
 
-       protected function maybeWatchedLink( $link, $watched=false ) {
+       protected function maybeWatchedLink( $link, $watched = false ) {
                if( $watched ) {
                        return '<strong class="mw-watched">' . $link . '</strong>';
                } else {
@@ -569,7 +626,7 @@ class EnhancedChangesList extends ChangesList {
                $rc->timestamp = $time;
                $rc->numberofWatchingusers = $baseRC->numberofWatchingusers;
 
-               # Make "cur" and "diff" links.  Don't use link(), it's too slow if
+               # Make "cur" and "diff" links.  Do not use link(), it is too slow if
                # called too many times (50% of CPU time on RecentChanges!).
                if( $rc->unpatrolled ) {
                        $rcIdQuery = array( 'rcid' => $rc_id );
@@ -600,7 +657,7 @@ class EnhancedChangesList extends ChangesList {
 
                # Make "last" link
                if( !$showdifflinks || !$rc_last_oldid ) {
-                   $lastLink = $this->message['last'];
+                       $lastLink = $this->message['last'];
                } else if( $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
                        $lastLink = $this->message['last'];
                } else {
@@ -741,7 +798,7 @@ class EnhancedChangesList extends ChangesList {
 
                $r .= $wgContLang->getDirMark();
 
-               $curIdEq = 'curid=' . $curId;
+               $queryParams['curid'] = $curId;
                # Changes message
                $n = count($block);
                static $nchanges = array();
@@ -757,8 +814,17 @@ class EnhancedChangesList extends ChangesList {
                        } else if( $isnew ) {
                                $r .= $nchanges[$n];
                        } else {
-                               $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(),
-                                       $nchanges[$n], $curIdEq."&diff=$currentRevision&oldid=$oldid" );
+                               $params = $queryParams;
+                               $params['diff'] = $currentRevision;
+                               $params['oldid'] = $oldid;
+                               
+                               $r .= $this->skin->link(
+                                       $block[0]->getTitle(),
+                                       $nchanges[$n],
+                                       array(),
+                                       $params,
+                                       array( 'known', 'noclasses' )
+                               );
                        }
                }
 
@@ -768,8 +834,17 @@ class EnhancedChangesList extends ChangesList {
                } else if( $namehidden || !$block[0]->getTitle()->exists() ) {
                        $r .= $this->message['semicolon-separator'] . $this->message['hist'] . ')';
                } else {
-                       $r .= $this->message['semicolon-separator'] . $this->skin->makeKnownLinkObj( $block[0]->getTitle(),
-                               $this->message['hist'], $curIdEq . '&action=history' ) . ')';
+                       $params = $queryParams;
+                       $params['action'] = 'history';
+
+                       $r .= $this->message['semicolon-separator'] .
+                               $this->skin->link(
+                                       $block[0]->getTitle(),
+                                       $this->message['hist'],
+                                       array(),
+                                       $params,
+                                       array( 'known', 'noclasses' )
+                               ) . ')';
                }
                $r .= ' . . ';
 
@@ -817,10 +892,12 @@ class EnhancedChangesList extends ChangesList {
                        $r .= $this->recentChangesFlags( $rc_new, $rc_minor, $rcObj->unpatrolled, '&nbsp;', $rc_bot );
                        $r .= '&nbsp;</tt></td><td valign="top">';
 
-                       $o = '';
+                       $params = $queryParams;
+
                        if( $rc_this_oldid != 0 ) {
-                               $o = 'oldid='.$rc_this_oldid;
+                               $params['oldid'] = $rc_this_oldid;
                        }
+
                        # Log timestamp
                        if( $rc_type == RC_LOG ) {
                                $link = '<tt>'.$rcObj->timestamp.'</tt> ';
@@ -828,10 +905,18 @@ class EnhancedChangesList extends ChangesList {
                        } else if( !ChangesList::userCan($rcObj,Revision::DELETED_TEXT) ) {
                                $link = '<span class="history-deleted"><tt>'.$rcObj->timestamp.'</tt></span> ';
                        } else {
-                               $rcIdEq = ($rcObj->unpatrolled && $rc_type == RC_NEW) ?
-                                       '&rcid='.$rcObj->mAttribs['rc_id'] : '';
-                               $link = '<tt>'.$this->skin->makeKnownLinkObj( $rcObj->getTitle(),
-                                       $rcObj->timestamp, $curIdEq.'&'.$o.$rcIdEq ).'</tt>';
+                               if ( $rcObj->unpatrolled && $rc_type == RC_NEW) {
+                                       $params['rcid'] = $rcObj->mAttribs['rc_id'];
+                               }
+
+                               $link = '<tt>' .
+                                       $this->skin->link(
+                                               $rcObj->getTitle(),
+                                               $rcObj->timestamp,
+                                               array(),
+                                               $params,
+                                               array( 'known', 'noclasses' )
+                                       ) . '</tt>';
                                if( $this->isDeleted($rcObj,Revision::DELETED_TEXT) )
                                        $link = '<span class="history-deleted">'.$link.'</span> ';
                        }
@@ -938,7 +1023,7 @@ class EnhancedChangesList extends ChangesList {
                // that explicitly initializes variables.
                $classes = array(); // TODO implement
                extract( $rcObj->mAttribs );
-               $curIdEq = "curid={$rc_cur_id}";
+               $query['curid'] = $rc_cur_id;
 
                $r = '<table cellspacing="0" cellpadding="0" border="0" style="background: none"><tr>';
                $r .= '<td valign="top" style="white-space: nowrap"><tt>' . $this->spacerArrow() . '&nbsp;';
@@ -953,15 +1038,27 @@ class EnhancedChangesList extends ChangesList {
                if( $rc_log_type ) {
                        $logtitle = Title::newFromText( "Log/$rc_log_type", NS_SPECIAL );
                        $logname = LogPage::logName( $rc_log_type );
-                       $r .= '(' . $this->skin->makeKnownLinkObj($logtitle, $logname ) . ')';
+                       $r .= '(' . $this->skin->link(
+                               $logtitle,
+                               $logname,
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       ) . ')';
                } else {
                        $this->insertArticleLink( $r, $rcObj, $rcObj->unpatrolled, $rcObj->watched );
                }
                # Diff and hist links
                if ( $rc_type != RC_LOG ) {
                        $r .= ' ('. $rcObj->difflink . $this->message['semicolon-separator'];
-                       $r .= $this->skin->makeKnownLinkObj( $rcObj->getTitle(), $this->message['hist'], 
-                               $curIdEq.'&action=history' ) . ')';
+                       $query['action'] = 'history';
+                       $r .= $this->skin->link(
+                               $rcObj->getTitle(),
+                               $this->message['hist'],
+                               array(),
+                               $query,
+                               array( 'known', 'noclasses' )
+                       ) . ')';
                }
                $r .= ' . . ';
                # Character diff
index 1051c22..0df1da6 100644 (file)
@@ -1282,15 +1282,18 @@ class EditPage {
                        $wgOut->addHTML( "</div>\n" );
                }
 
-               $q = 'action='.$this->action;
-               #if ( "no" == $redirect ) { $q .= "&redirect=no"; }
-               $action = $wgTitle->escapeLocalURL( $q );
+               $action = $wgTitle->escapeLocalURL( array( 'action' => $this->action ) );
 
                $summary = wfMsgExt( 'summary', 'parseinline' );
                $subject = wfMsgExt( 'subject', 'parseinline' );
 
-               $cancel = $sk->makeKnownLink( $wgTitle->getPrefixedText(),
-                               wfMsgExt('cancel', array('parseinline')) );
+               $cancel = $sk->link(
+                       $wgTitle->getPrefixedText(),
+                       wfMsgExt( 'cancel', array( 'parseinline' ) ),
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               );
                $separator = wfMsgExt( 'pipe-separator' , 'escapenoentities' );
                $edithelpurl = Skin::makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' ));
                $edithelp = '<a target="helpwindow" href="'.$edithelpurl.'">'.
@@ -1674,7 +1677,11 @@ END
        function doLivePreviewScript() {
                global $wgOut, $wgTitle;
                $wgOut->addScriptFile( 'preview.js' );
-               $liveAction = $wgTitle->getLocalUrl( "action={$this->action}&wpPreview=true&live=true" );
+               $liveAction = $wgTitle->getLocalUrl( array(
+                       'action' => $this->action,
+                       'wpPreview' => 'true',
+                       'live' => 'true'
+               ) );
                return "return !lpDoPreview(" .
                        "editform.wpTextbox1.value," .
                        '"' . $liveAction . '"' . ")";
@@ -1864,7 +1871,13 @@ END
                $skin = $wgUser->getSkin();
 
                $loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
-               $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $wgTitle->getPrefixedUrl() );
+               $loginLink = $skin->link(
+                       $loginTitle,
+                       wfMsgHtml( 'loginreqlink' ),
+                       array(),
+                       array( 'returnto' => $wgTitle->getPrefixedUrl() ),
+                       array( 'known', 'noclasses' )
+               );
 
                $wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
index b89a5e9..9a764d1 100644 (file)
@@ -251,7 +251,16 @@ class FileDeleteForm {
                global $wgOut, $wgUser;
                $wgOut->setPageTitle( wfMsg( 'filedelete', $this->title->getText() ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
-               $wgOut->setSubtitle( wfMsg( 'filedelete-backlink', $wgUser->getSkin()->makeKnownLinkObj( $this->title ) ) );
+               $wgOut->setSubtitle( wfMsg(
+                       'filedelete-backlink',
+                       $wgUser->getSkin()->link(
+                               $this->title,
+                               null,
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       )
+               ) );
        }
 
        /**
@@ -284,11 +293,10 @@ class FileDeleteForm {
         * @return string
         */
        private function getAction() {
-               $q = array();
-               $q[] = 'action=delete';
+               $q['action'] = 'delete';
                if( $this->oldimage )
-                       $q[] = 'oldimage=' . urlencode( $this->oldimage );
-               return $this->title->getLocalUrl( implode( '&', $q ) );
+                       $q['oldimage'] = $this->oldimage;
+               return $this->title->getLocalUrl( $q );
        }
 
        /**
@@ -299,5 +307,4 @@ class FileDeleteForm {
        private function getTimestamp() {
                return $this->oldfile->getTimestamp();
        }
-
 }
index c7c7324..a058d06 100644 (file)
@@ -114,7 +114,16 @@ class FileRevertForm {
                global $wgOut, $wgUser;
                $wgOut->setPageTitle( wfMsg( 'filerevert', $this->title->getText() ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
-               $wgOut->setSubtitle( wfMsg( 'filerevert-backlink', $wgUser->getSkin()->makeKnownLinkObj( $this->title ) ) );
+               $wgOut->setSubtitle( wfMsg(
+                       'filerevert-backlink',
+                       $wgUser->getSkin()->link(
+                               $this->title,
+                               null,
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       )
+               ) );
        }
 
        /**
index 132f7f8..60d7b3b 100644 (file)
@@ -381,7 +381,13 @@ class ImagePage extends Article {
 
                                        if( $page > 1 ) {
                                                $label = $wgOut->parse( wfMsg( 'imgmultipageprev' ), false );
-                                               $link = $sk->makeKnownLinkObj( $this->mTitle, $label, 'page='. ($page-1) );
+                                               $link = $sk->link(
+                                                       $this->mTitle,
+                                                       $label,
+                                                       array(),
+                                                       array( 'page' => $page - 1 ),
+                                                       array( 'known', 'noclasses' )
+                                               );
                                                $thumb1 = $sk->makeThumbLinkObj( $this->mTitle, $this->displayImg, $link, $label, 'none',
                                                        array( 'page' => $page - 1 ) );
                                        } else {
@@ -390,7 +396,13 @@ class ImagePage extends Article {
 
                                        if( $page < $count ) {
                                                $label = wfMsg( 'imgmultipagenext' );
-                                               $link = $sk->makeKnownLinkObj( $this->mTitle, $label, 'page='. ($page+1) );
+                                               $link = $sk->link(
+                                                       $this->mTitle,
+                                                       $label,
+                                                       array(),
+                                                       array( 'page' => $page + 1 ),
+                                                       array( 'known', 'noclasses' )
+                                               );
                                                $thumb2 = $sk->makeThumbLinkObj( $this->mTitle, $this->displayImg, $link, $label, 'none',
                                                        array( 'page' => $page + 1 ) );
                                        } else {
@@ -547,7 +559,17 @@ EOT
                }
 
                # External editing link
-               $elink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' );
+               $elink = $sk->link(
+                       $this->mTitle,
+                       wfMsgHtml( 'edit-externally' ),
+                       array(),
+                       array(
+                               'action' => 'edit',
+                               'externaledit' => 'true',
+                               'mode' => 'file'
+                       ),
+                       array( 'known', 'noclasses' )
+               );
                $wgOut->addHTML( '<li id="mw-imagepage-edit-external">' . $elink . ' <small>' . wfMsgExt( 'edit-externally-help', array( 'parseinline' ) ) . "</small></li>\n" );
 
                $wgOut->addHTML( "</ul>\n" );
@@ -615,8 +637,13 @@ EOT
                        $count++;
                        if( $count <= $limit ) {
                                // We have not yet reached the extra one that tells us there is more to fetch
-                               $name = Title::makeTitle( $s->page_namespace, $s->page_title );
-                               $link = $sk->makeKnownLinkObj( $name, "" );
+                               $link = $sk->link(
+                                       Title::makeTitle( $s->page_namespace, $s->page_title ),
+                                       null,
+                                       array(),
+                                       array(),
+                                       array( 'known', 'noclasses' )
+                               );
                                $wgOut->addHTML( "<li>{$link}</li>\n" );
                        }
                }
@@ -643,7 +670,13 @@ EOT
 
                $sk = $wgUser->getSkin();
                foreach ( $redirects as $title ) {
-                       $link = $sk->makeKnownLinkObj( $title, "", "redirect=no" );
+                       $link = $sk->link(
+                               $title,
+                               null,
+                               array(),
+                               array( 'redirect' => 'no' ),
+                               array( 'known', 'noclasses' )
+                       );
                        $wgOut->addHTML( "<li>{$link}</li>\n" );
                }
                $wgOut->addHTML( "</ul></div>\n" );
@@ -667,9 +700,15 @@ EOT
                $sk = $wgUser->getSkin();
                foreach ( $dupes as $file ) {
                        $fromSrc = '';
-                       if( $file->isLocal() )
-                               $link = $sk->makeKnownLinkObj( $file->getTitle(), "" );
-                       else {
+                       if( $file->isLocal() ) {
+                               $link = $sk->link(
+                                       $file->getTitle(),
+                                       null,
+                                       array(),
+                                       array(),
+                                       array( 'known', 'noclasses' )
+                               );
+                       } else {
                                $link = $sk->makeExternalLink( $file->getDescriptionUrl(),
                                        $file->getTitle()->getPrefixedText() );
                                $fromSrc = wfMsg( 'shared-repo-from', $file->getRepo()->getDisplayName() );
@@ -851,13 +890,17 @@ class ImageHistoryList {
                        if( $file->isDeleted(File::DELETED_FILE) ) {
                                $row .= wfMsgHtml('filehist-revert');
                        } else {
-                               $q = array();
-                               $q[] = 'action=revert';
-                               $q[] = 'oldimage=' . urlencode( $img );
-                               $q[] = 'wpEditToken=' . urlencode( $wgUser->editToken( $img ) );
-                               $row .= $this->skin->makeKnownLinkObj( $this->title,
+                               $row .= $this->skin->link(
+                                       $this->title,
                                        wfMsgHtml( 'filehist-revert' ),
-                                       implode( '&', $q ) );
+                                       array(),
+                                       array(
+                                               'action' => 'revert',
+                                               'oldimage' => $img,
+                                               'wpEditToken' => $wgUser->editToken( $img )
+                                       ),
+                                       array( 'known', 'noclasses' )
+                               );
                        }
                }
                $row .= '</td>';
@@ -873,10 +916,17 @@ class ImageHistoryList {
                } elseif( $file->isDeleted(File::DELETED_FILE) ) {
                        $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
                        # Make a link to review the image
-                       $url = $this->skin->makeKnownLinkObj( $revdel, $wgLang->timeAndDate( $timestamp, true ),
-                               "target=".$wgTitle->getPrefixedUrl().
-                               "&file=" . urlencode( $img ) .
-                               "&token=" . urlencode( $wgUser->editToken( $img ) ) );
+                       $url = $this->skin->link(
+                               $revdel,
+                               $wgLang->timeAndDate( $timestamp, true ),
+                               array(),
+                               array(
+                                       'target' => $wgTitle->getPrefixedUrl(),
+                                       'file' => $img,
+                                       'token' => $wgUser->editToken( $img )
+                               ),
+                               array( 'known', 'noclasses' )
+                       );
                        $row .= '<span class="history-deleted">'.$url.'</span>';
                } elseif( $file->isMissing() ) {
                        # Don't link to missing files