Revision: 51568
Author:   siebrand
Date:     2009-06-07 15:02:12 +0000 (Sun, 07 Jun 2009)

Log Message:
-----------
* replace some use of deprecated makeKnownLinkObj() by link() in core
* use array type parameter instead of string to escapeLocalUrl(), getFullURL() 
and getFullUrl() for readability
* add FIXME in Parser.php and LogEventsList.php where I didn't know how to 
replace makeKnownLinkObj by link()
* return type for private method Skin::editUrlOptions() changed from string to 
array
* some code readability improvements

Linking this to r51559 for CodeReview as there is some discussion there, and 
these changes are very similar.

Todo: core special pages

Modified Paths:
--------------
    trunk/phase3/includes/LogEventsList.php
    trunk/phase3/includes/OutputPage.php
    trunk/phase3/includes/PageHistory.php
    trunk/phase3/includes/PatrolLog.php
    trunk/phase3/includes/Preferences.php
    trunk/phase3/includes/Skin.php
    trunk/phase3/includes/SkinTemplate.php
    trunk/phase3/includes/WatchlistEditor.php
    trunk/phase3/includes/parser/Parser.php
    trunk/phase3/skins/CologneBlue.php
    trunk/phase3/skins/Standard.php
    trunk/phase3/skins/disabled/MonoBookCBT.php

Modified: trunk/phase3/includes/LogEventsList.php
===================================================================
--- trunk/phase3/includes/LogEventsList.php     2009-06-07 14:56:24 UTC (rev 
51567)
+++ trunk/phase3/includes/LogEventsList.php     2009-06-07 15:02:12 UTC (rev 
51568)
@@ -109,6 +109,7 @@
                $hiddens = ''; // keep track for "go" button
                foreach( $filter as $type => $val ) {
                        $hideVal = 1 - intval($val);
+                       // FIXME: use link() here. Needs changes in 
getDefaultQuery()
                        $link = $this->skin->makeKnownLinkObj( $wgTitle, 
$messages[$hideVal],
                                wfArrayToCGI( array( "hide_{$type}_log" => 
$hideVal ), $this->getDefaultQuery() )
                        );
@@ -242,33 +243,55 @@
                } else if( self::typeAction($row,'move','move','move') && 
!empty($paramArray[0]) ) {
                        $destTitle = Title::newFromText( $paramArray[0] );
                        if( $destTitle ) {
-                               $revert = '(' . $this->skin->makeKnownLinkObj( 
SpecialPage::getTitleFor( 'Movepage' ),
+                               $revert = '(' . $this->skin->link(
+                                       SpecialPage::getTitleFor( 'Movepage' ),
                                        $this->message['revertmove'],
-                                       'wpOldTitle=' . urlencode( 
$destTitle->getPrefixedDBkey() ) .
-                                       '&wpNewTitle=' . urlencode( 
$title->getPrefixedDBkey() ) .
-                                       '&wpReason=' . urlencode( 
wfMsgForContent( 'revertmove' ) ) .
-                                       '&wpMovetalk=0' ) . ')';
+                                       array(),
+                                       array(
+                                               'wpOldTitle' => 
$destTitle->getPrefixedDBkey(),
+                                               'wpNewTitle' => 
$title->getPrefixedDBkey(),
+                                               'wpReason' => wfMsgForContent( 
'revertmove' ),
+                                               'wpMovetalk' => 0
+                                       ),
+                                       array( 'known', 'noclasses' )
+                               ) . ')';
                        }
                // Show undelete link
                } else if( 
self::typeAction($row,array('delete','suppress'),'delete','deletedhistory') ) {
-                       if( !$wgUser->isAllowed( 'undelete' ) ) 
+                       if( !$wgUser->isAllowed( 'undelete' ) ) {
                                $viewdeleted = 
$this->message['undeleteviewlink'];
-                       else 
+                       } else {
                                $viewdeleted = $this->message['undeletelink'];
-                       $revert = '(' . $this->skin->makeKnownLinkObj( 
SpecialPage::getTitleFor( 'Undelete' ),
-                               $viewdeleted, 'target='. urlencode( 
$title->getPrefixedDBkey() ) ) . ')';
+                       }
+
+                       $revert = '(' . $this->skin->link(
+                               SpecialPage::getTitleFor( 'Undelete' ),
+                               $viewdeleted,
+                               array(),
+                               array( 'target' => $title->getPrefixedDBkey() ),
+                               array( 'known', 'noclasses' )
+                        ) . ')';
                // Show unblock/change block link
                } else if( 
self::typeAction($row,array('block','suppress'),array('block','reblock'),'block')
 ) {
                        $revert = '(' .
-                               $this->skin->link( SpecialPage::getTitleFor( 
'Ipblocklist' ),
+                               $this->skin->link(
+                                       SpecialPage::getTitleFor( 'Ipblocklist' 
),
                                        $this->message['unblocklink'],
                                        array(),
-                                       array( 'action' => 'unblock', 'ip' => 
$row->log_title ),
-                                       'known' ) 
-                               . $this->message['pipe-separator'] .
-                               $this->skin->link( SpecialPage::getTitleFor( 
'Blockip', $row->log_title ), 
+                                       array(
+                                               'action' => 'unblock',
+                                               'ip' => $row->log_title
+                                       ),
+                                       'known'
+                               ) .
+                               $this->message['pipe-separator'] .
+                               $this->skin->link(
+                                       SpecialPage::getTitleFor( 'Blockip', 
$row->log_title ),
                                        $this->message['change-blocklink'],
-                                       array(), array(), 'known' ) .
+                                       array(),
+                                       array(),
+                                       'known'
+                               ) .
                                ')';
                // Show change protection link
                } else if( self::typeAction( $row, 'protect', array( 'modify', 
'protect', 'unprotect' ) ) ) {
@@ -276,7 +299,11 @@
                                $this->skin->link( $title,
                                        $this->message['hist'],
                                        array(),
-                                       array( 'action' => 'history', 'offset' 
=> $row->log_timestamp ) );
+                                       array(
+                                               'action' => 'history',
+                                               'offset' => $row->log_timestamp
+                                       )
+                               );
                        if( $wgUser->isAllowed( 'protect' ) ) {
                                $revert .= $this->message['pipe-separator'] .
                                        $this->skin->link( $title,
@@ -289,9 +316,17 @@
                // Show unmerge link
                } else if( 
self::typeAction($row,'merge','merge','mergehistory') ) {
                        $merge = SpecialPage::getTitleFor( 'Mergehistory' );
-                       $revert = '(' .  $this->skin->makeKnownLinkObj( $merge, 
$this->message['revertmerge'],
-                               wfArrayToCGI( array('target' => $paramArray[0], 
'dest' => $title->getPrefixedDBkey(), 
-                                       'mergepoint' => $paramArray[1] ) ) ) . 
')';
+                       $revert = '(' .  $this->skin->link(
+                               $merge,
+                               $this->message['revertmerge'],
+                               array(),
+                               array(
+                                       'target' => $paramArray[0],
+                                       'dest' => $title->getPrefixedDBkey(), 
+                                       'mergepoint' => $paramArray[1]
+                               ),
+                               array( 'known', 'noclasses' )
+                       ) . ')';
                // If an edit was hidden from a page give a review link to the 
history
                } else if( 
self::typeAction($row,array('delete','suppress'),'revision','deleterevision') ) 
{
                        if( count($paramArray) >= 2 ) {
@@ -300,16 +335,33 @@
                                $key = $paramArray[0];
                                // $paramArray[1] is a CSV of the IDs
                                $Ids = explode( ',', $paramArray[1] );
-                               $query = urlencode($paramArray[1]);
+                               $query = $paramArray[1];
                                $revert = array();
                                // Diff link for single rev deletions
                                if( ( $key === 'oldid' || $key == 'revision' ) 
&& count($Ids) == 1 ) {
-                                       $revert[] = 
$this->skin->makeKnownLinkObj( $title, $this->message['diff'], 
-                                               
'diff='.intval($Ids[0])."&unhide=1" );
+                                       $revert[] = $this->skin->link(
+                                               $title,
+                                               $this->message['diff'], 
+                                               array(),
+                                               array(
+                                                       'diff' => intval( 
$Ids[0] ),
+                                                       'unhide' => 1
+                                               ),
+                                               array( 'known', 'noclasses' )
+                                       );
                                }
                                // View/modify link...
-                               $revert[] = $this->skin->makeKnownLinkObj( 
$revdel, $this->message['revdel-restore'],
-                                       
'target='.$title->getPrefixedUrl()."&type=$key&ids=$query" );
+                               $revert[] = $this->skin->link(
+                                       $revdel,
+                                       $this->message['revdel-restore'],
+                                       array(),
+                                       array(
+                                               'target' => 
$title->getPrefixedUrl(),
+                                               'type' => $key,
+                                               'ids' => $query
+                                       ),
+                                       array( 'known', 'noclasses' )
+                               );
                                // Pipe links
                                $revert = '(' . implode(' | ',$revert) . ')';
                        }
@@ -319,10 +371,19 @@
                                $revdel = SpecialPage::getTitleFor( 
'Revisiondelete' );
                                // $paramArray[1] is a CSV of the IDs
                                $Ids = explode( ',', $paramArray[0] );
-                               $query = urlencode($paramArray[0]);
+                               $query = $paramArray[0];
                                // Link to each hidden object ID, 
$paramArray[1] is the url param
-                               $revert = '(' . $this->skin->makeKnownLinkObj( 
$revdel, $this->message['revdel-restore'], 
-                                       
'target='.$title->getPrefixedUrl()."&type=logging&ids=$query" ) . ')';
+                               $revert = '(' . $this->skin->link(
+                                       $revdel,
+                                       $this->message['revdel-restore'], 
+                                       array(),
+                                       array(
+                                               'target' => 
$title->getPrefixedUrl(),
+                                               'type' => 'logging',
+                                               'ids' => $query
+                                       ),
+                                       array( 'known', 'noclasses' )
+                               ) . ')';
                        }
                // Self-created users
                } else if( self::typeAction($row,'newusers','create2') ) {

Modified: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php        2009-06-07 14:56:24 UTC (rev 
51567)
+++ trunk/phase3/includes/OutputPage.php        2009-06-07 15:02:12 UTC (rev 
51568)
@@ -1254,7 +1254,13 @@
                $this->setArticleFlag( false );
 
                $loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
-               $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 
'loginreqlink' ), 'returnto=' . $this->getTitle()->getPrefixedUrl() );
+               $loginLink = $skin->link(
+                       $loginTitle,
+                       wfMsgHtml( 'loginreqlink' ),
+                       array(),
+                       array( 'returnto' => 
$this->getTitle()->getPrefixedUrl() ),
+                       array( 'known', 'noclasses' )
+               );
                $this->addHTML( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) 
);
                $this->addHTML( "\n<!--" . $this->getTitle()->getPrefixedUrl() 
. "-->" );
 
@@ -1336,7 +1342,18 @@
                        // Permissions error
                        if( $source ) {
                                $this->setPageTitle( wfMsg( 'viewsource' ) );
-                               $this->setSubtitle( wfMsg( 'viewsourcefor', 
$skin->makeKnownLinkObj( $this->getTitle() ) ) );
+                               $this->setSubtitle(
+                                       wfMsg(
+                                               'viewsourcefor',
+                                               $skin->link(
+                                                       $this->getTitle(),
+                                                       null,
+                                                       array(),
+                                                       array(),
+                                                       array( 'known', 
'noclasses' )
+                                               )
+                                       )
+                               );
                        } else {
                                $this->setPageTitle( wfMsg( 'badaccess' ) );
                        }

Modified: trunk/phase3/includes/PageHistory.php
===================================================================
--- trunk/phase3/includes/PageHistory.php       2009-06-07 14:56:24 UTC (rev 
51567)
+++ trunk/phase3/includes/PageHistory.php       2009-06-07 15:02:12 UTC (rev 
51568)
@@ -90,8 +90,13 @@
                $wgOut->addScriptFile( 'history.js' );
 
                $logPage = SpecialPage::getTitleFor( 'Log' );
-               $logLink = $this->mSkin->makeKnownLinkObj( $logPage, wfMsgHtml( 
'viewpagelogs' ),
-                       'page=' . $this->mTitle->getPrefixedUrl() );
+               $logLink = $this->mSkin->link(
+                       $logPage,
+                       wfMsgHtml( 'viewpagelogs' ),
+                       array(),
+                       array( 'page' => $this->mTitle->getPrefixedUrl() ),
+                       array( 'known', 'noclasses' )
+               );
                $wgOut->setSubtitle( $logLink );
 
                $feedType = $wgRequest->getVal( 'feed' );
@@ -379,7 +384,13 @@
                $date = $wgLang->timeanddate( wfTimestamp(TS_MW, 
$rev->getTimestamp()), true );
                $date = htmlspecialchars( $date );
                if( !$rev->isDeleted( Revision::DELETED_TEXT ) ) {
-                       $link = $this->mSkin->makeKnownLinkObj( $this->mTitle, 
$date, "oldid=" . $rev->getId() );
+                       $link = $this->mSkin->link(
+                               $this->mTitle,
+                               $date,
+                               array(),
+                               array( 'oldid' => $rev->getId() ),
+                               array( 'known', 'noclasses' )
+                       );
                } else {
                        $link = "<span class=\"history-deleted\">$date</span>";
                }
@@ -397,8 +408,16 @@
                if( $latest || !$rev->userCan( Revision::DELETED_TEXT ) ) {
                        return $cur;
                } else {
-                       return $this->mSkin->makeKnownLinkObj( $this->mTitle, 
$cur,
-                               'diff=' . $this->mTitle->getLatestRevID() . 
"&oldid=" . $rev->getId() );
+                       return $this->mSkin->link(
+                               $this->mTitle,
+                               $cur,
+                               array(),
+                               array(
+                                       'diff' => 
$this->mTitle->getLatestRevID(),
+                                       'oldid' => $rev->getId()
+                               ),
+                               array( 'known', 'noclasses' )
+                       );
                }
        }
 
@@ -418,13 +437,29 @@
                        return $last;
                } elseif( $next === 'unknown' ) {
                        # Next row probably exists but is unknown, use an 
oldid=prev link
-                       return $this->mSkin->makeKnownLinkObj( $this->mTitle, 
$last,
-                               "diff=" . $prevRev->getId() . "&oldid=prev" );
+                       return $this->mSkin->link(
+                               $this->mTitle,
+                               $last,
+                               array(),
+                               array(
+                                       'diff' => $prevRev->getId(),
+                                       'oldid' => 'prev'
+                               ),
+                               array( 'known', 'noclasses' )
+                       );
                } elseif( !$prevRev->userCan(Revision::DELETED_TEXT) || 
!$nextRev->userCan(Revision::DELETED_TEXT) ) {
                        return $last;
                } else {
-                       return $this->mSkin->makeKnownLinkObj( $this->mTitle, 
$last,
-                               "diff=" . $prevRev->getId() . 
"&oldid={$next->rev_id}" );
+                       return $this->mSkin->link(
+                               $this->mTitle,
+                               $last,
+                               array(),
+                               array(
+                                       'diff' => $prevRev->getId(),
+                                       'oldid' => $next->rev_id
+                               ),
+                               array( 'known', 'noclasses' )
+                       );
                }
        }
 
@@ -506,10 +541,11 @@
                }
 
                $feed = new $wgFeedClasses[$type](
-               $this->mTitle->getPrefixedText() . ' - ' .
-               wfMsgForContent( 'history-feed-title' ),
-               wfMsgForContent( 'history-feed-description' ),
-               $this->mTitle->getFullUrl( 'action=history' ) );
+                       $this->mTitle->getPrefixedText() . ' - ' .
+                               wfMsgForContent( 'history-feed-title' ),
+                       wfMsgForContent( 'history-feed-description' ),
+                       $this->mTitle->getFullUrl( array( 'action' => 'history' 
) )
+               );
 
                // Get a limit on number of feed entries. Provide a sane default
                // of 10 if none is defined (but limit to $wgFeedLimit max)
@@ -573,14 +609,16 @@
                return new FeedItem(
                        $title,
                        $text,
-                       $this->mTitle->getFullUrl( 'diff=' . $rev->getId() . 
'&oldid=prev' ),
+                       $this->mTitle->getFullUrl( array(
+                               'diff' => $rev->getId(),
+                               'oldid' => 'prev'
+                       ) ),
                        $rev->getTimestamp(),
                        $rev->getUserText(),
                        $this->mTitle->getTalkPage()->getFullUrl() );
        }
 }
 
-
 /**
  * @ingroup Pager
  */

Modified: trunk/phase3/includes/PatrolLog.php
===================================================================
--- trunk/phase3/includes/PatrolLog.php 2009-06-07 14:56:24 UTC (rev 51567)
+++ trunk/phase3/includes/PatrolLog.php 2009-06-07 15:02:12 UTC (rev 51568)
@@ -45,10 +45,18 @@
                        $link = $skin->link( $title );
                        if( $title->exists() ) {
                                # Generate a diff link
-                               $bits[] = 'oldid=' . urlencode( $cur );
-                               $bits[] = 'diff=prev';
-                               $bits = implode( '&', $bits );
-                               $diff = $skin->makeKnownLinkObj( $title, 
htmlspecialchars( wfMsg( 'patrol-log-diff', $cur ) ), $bits );
+                               $query = array(
+                                       'oldid' => $cur,
+                                       'diff' => 'prev'
+                               );
+
+                               $diff = $skin->link(
+                                       $title,
+                                       htmlspecialchars( wfMsg( 
'patrol-log-diff', $cur ) ),
+                                       array(),
+                                       $query,
+                                       array( 'known', 'noclasses' )
+                               );
                        } else {
                                # Don't bother with a diff link, it's useless
                                $diff = htmlspecialchars( wfMsg( 
'patrol-log-diff', $cur ) );

Modified: trunk/phase3/includes/Preferences.php
===================================================================
--- trunk/phase3/includes/Preferences.php       2009-06-07 14:56:24 UTC (rev 
51567)
+++ trunk/phase3/includes/Preferences.php       2009-06-07 15:02:12 UTC (rev 
51568)
@@ -310,8 +310,13 @@
                                        global $wgUser; // wgUser is okay here, 
it's for display
                                        $skin = $wgUser->getSkin();
                                        $emailauthenticated = 
wfMsgHtml('emailnotauthenticated').'<br />' .
-                                               $skin->makeKnownLinkObj( 
SpecialPage::getTitleFor( 'Confirmemail' ),
-                                                       wfMsg( 
'emailconfirmlink' ) ) . '<br />';
+                                               $skin->link(
+                                                       
SpecialPage::getTitleFor( 'Confirmemail' ),
+                                                       wfMsg( 
'emailconfirmlink' ),
+                                                       array(),
+                                                       array(),
+                                                       array( 'known', 
'noclasses' )
+                                               ) . '<br />';
                                }
                        } else {
                                $disableEmailPrefs = true;

Modified: trunk/phase3/includes/Skin.php
===================================================================
--- trunk/phase3/includes/Skin.php      2009-06-07 14:56:24 UTC (rev 51567)
+++ trunk/phase3/includes/Skin.php      2009-06-07 15:02:12 UTC (rev 51568)
@@ -992,16 +992,34 @@
                        }
                }
                if ( 'history' == $action || isset( $diff ) || isset( $oldid ) 
) {
-                       $s[] .= $this->makeKnownLinkObj( $this->mTitle,
-                                       wfMsg( 'currentrev' ) );
+                       $s[] .= $this->link(
+                                       $this->mTitle,
+                                       wfMsg( 'currentrev' ),
+                                       array(),
+                                       array(),
+                                       array( 'known', 'noclasses' )
+                       );
                }
 
                if ( $wgUser->getNewtalk() ) {
                        # do not show "You have new messages" text when we are 
viewing our
                        # own talk page
                        if( !$this->mTitle->equals( $wgUser->getTalkPage() ) ) {
-                               $tl = $this->makeKnownLinkObj( 
$wgUser->getTalkPage(), wfMsgHtml( 'newmessageslink' ), 'redirect=no' );
-                               $dl = $this->makeKnownLinkObj( 
$wgUser->getTalkPage(), wfMsgHtml( 'newmessagesdifflink' ), 'diff=cur' );
+                               $tl = $this->link(
+                                       $wgUser->getTalkPage(),
+                                       wfMsgHtml( 'newmessageslink' ),
+                                       array(),
+                                       array( 'redirect' => 'no' ),
+                                       array( 'known', 'noclasses' )
+                               );
+
+                               $dl = $this->link(
+                                       $wgUser->getTalkPage(),
+                                       wfMsgHtml( 'newmessagesdifflink' ),
+                                       array(),
+                                       array( 'diff' => 'cur' ),
+                                       array( 'known', 'noclasses' )
+                               );
                                $s[] = '<strong>'. wfMsg( 'youhavenewmessages', 
$tl, $dl ) . '</strong>';
                                # disable caching
                                $wgOut->setSquidMaxage( 0 );
@@ -1030,10 +1048,16 @@
                                } else {
                                        $msg = 'viewdeleted';
                                }
-                               return wfMsg( $msg,
-                                       $this->makeKnownLinkObj(
+                               return wfMsg(
+                                       $msg,
+                                       $this->link(
                                                SpecialPage::getTitleFor( 
'Undelete', $this->mTitle->getPrefixedDBkey() ),
-                                               wfMsgExt( 'restorelink', array( 
'parsemag', 'escape' ), $wgLang->formatNum( $n ) ) ) );
+                                               wfMsgExt( 'restorelink', array( 
'parsemag', 'escape' ), $wgLang->formatNum( $n ) ),
+                                               array(),
+                                               array(),
+                                               array( 'known', 'noclasses' )
+                                       )
+                               );
                        }
                }
                return '';
@@ -1094,7 +1118,13 @@
                                        $display .= $link;
                                        $linkObj = Title::newFromText( 
$growinglink );
                                        if( is_object( $linkObj ) && 
$linkObj->exists() ){
-                                               $getlink = 
$this->makeKnownLinkObj( $linkObj, htmlspecialchars( $display ) );
+                                               $getlink = $this->link(
+                                                       $linkObj,
+                                                       htmlspecialchars( 
$display ),
+                                                       array(),
+                                                       array(),
+                                                       array( 'known', 
'noclasses' )
+                                               );
                                                $c++;
                                                if( $c > 1 ) {
                                                        $subpages .= wfMsgExt( 
'pipe-separator', 'escapenoentities' );
@@ -1503,7 +1533,13 @@
        }
 
        function mainPageLink() {
-               $s = $this->makeKnownLinkObj( Title::newMainPage(), wfMsg( 
'mainpage' ) );
+               $s = $this->link(
+                       Title::newMainPage(),
+                       wfMsg( 'mainpage' ),
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               );
                return $s;
        }
 
@@ -1553,7 +1589,13 @@
                                $t = wfMsg( 'viewsource' );
                        }
 
-                       $s = $this->makeKnownLinkObj( $this->mTitle, $t, 
$this->editUrlOptions() );
+                       $s = $this->link(
+                               $this->mTitle,
+                               $t,
+                               array(),
+                               $this->editUrlOptions(),
+                               array( 'known', 'noclasses' )
+                       );
                }
                return $s;
        }
@@ -1562,17 +1604,19 @@
         * Return URL options for the 'edit page' link.
         * This may include an 'oldid' specifier, if the current page view is 
such.
         *
-        * @return string
+        * @return array
         * @private
         */
        function editUrlOptions() {
                global $wgArticle;
 
+               $options = array( 'action' => 'edit' ); 
+
                if( $this->mRevisionId && ! $wgArticle->isCurrent() ) {
-                       return 'action=edit&oldid=' . intval( 
$this->mRevisionId );
-               } else {
-                       return 'action=edit';
+                       $options['oldid'] = intval( $this->mRevisionId );
                }
+
+               return $options;
        }
 
        function deleteThisPage() {
@@ -1582,7 +1626,13 @@
                if ( $this->mTitle->getArticleId() && ( !$diff ) && 
$wgUser->isAllowed( 'delete' ) ) {
                        $t = wfMsg( 'deletethispage' );
 
-                       $s = $this->makeKnownLinkObj( $this->mTitle, $t, 
'action=delete' );
+                       $s = $this->link(
+                               $this->mTitle,
+                               $t,
+                               array(),
+                               array( 'action' => 'delete' ),
+                               array( 'known', 'noclasses' )
+                       );
                } else {
                        $s = '';
                }
@@ -1595,13 +1645,20 @@
                $diff = $wgRequest->getVal( 'diff' );
                if ( $this->mTitle->getArticleId() && ( ! $diff ) && 
$wgUser->isAllowed('protect') ) {
                        if ( $this->mTitle->isProtected() ) {
-                               $t = wfMsg( 'unprotectthispage' );
-                               $q = 'action=unprotect';
+                               $text = wfMsg( 'unprotectthispage' );
+                               $query = array( 'action' => 'unprotect' );
                        } else {
-                               $t = wfMsg( 'protectthispage' );
-                               $q = 'action=protect';
+                               $text = wfMsg( 'protectthispage' );
+                               $query = array( 'action' => 'protect' );
                        }
-                       $s = $this->makeKnownLinkObj( $this->mTitle, $t, $q );
+
+                       $s = $this->link(
+                               $this->mTitle,
+                               $text,
+                               array(),
+                               $query,
+                               array( 'known', 'noclasses' )
+                       );
                } else {
                        $s = '';
                }
@@ -1614,15 +1671,22 @@
 
                if ( $wgOut->isArticleRelated() ) {
                        if ( $this->mTitle->userIsWatching() ) {
-                               $t = wfMsg( 'unwatchthispage' );
-                               $q = 'action=unwatch';
-                               $id = 'mw-unwatch-link' . $this->mWatchLinkNum;
+                               $text = wfMsg( 'unwatchthispage' );
+                               $query = array( 'action' => 'unwatch' );
+                               $id = array( 'mw-unwatch-link' => 
$this->mWatchLinkNum );
                        } else {
-                               $t = wfMsg( 'watchthispage' );
-                               $q = 'action=watch';
-                               $id = 'mw-watch-link' . $this->mWatchLinkNum;
+                               $text = wfMsg( 'watchthispage' );
+                               $query = array( 'action' => 'watch' );
+                               $id = array( 'mw-watch-link' => 
$this->mWatchLinkNum );
                        }
-                       $s = $this->makeKnownLinkObj( $this->mTitle, $t, $q, 
'', '', " id=\"$id\"" );
+
+                       $s = $this->link(
+                               $this->mTitle,
+                               $text,
+                               array( 'id' => $id ),
+                               $query,
+                               array( 'known', 'noclasses' )
+                       );
                } else {
                        $s = wfMsg( 'notanarticle' );
                }
@@ -1631,8 +1695,13 @@
 
        function moveThisPage() {
                if ( $this->mTitle->quickUserCan( 'move' ) ) {
-                       return $this->makeKnownLinkObj( 
SpecialPage::getTitleFor( 'Movepage' ),
-                         wfMsg( 'movethispage' ), 'target=' . 
$this->mTitle->getPrefixedURL() );
+                       return $this->link(
+                               SpecialPage::getTitleFor( 'Movepage' ),
+                               wfMsg( 'movethispage' ),
+                               array(),
+                               array( 'target' => 
$this->mTitle->getPrefixedURL() ),
+                               array( 'known', 'noclasses' )
+                       );
                } else {
                        // no message if page is protected - would be redundant
                        return '';
@@ -1640,20 +1709,32 @@
        }
 
        function historyLink() {
-               return $this->link( $this->mTitle, wfMsgHtml( 'history' ),
-                       array( 'rel' => 'archives' ), array( 'action' => 
'history' ) );
+               return $this->link(
+                       $this->mTitle,
+                       wfMsgHtml( 'history' ),
+                       array( 'rel' => 'archives' ),
+                       array( 'action' => 'history' )
+               );
        }
 
        function whatLinksHere() {
-               return $this->makeKnownLinkObj(
+               return $this->link(
                        SpecialPage::getTitleFor( 'Whatlinkshere', 
$this->mTitle->getPrefixedDBkey() ),
-                       wfMsgHtml( 'whatlinkshere' ) );
+                       wfMsgHtml( 'whatlinkshere' ),
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               );
        }
 
        function userContribsLink() {
-               return $this->makeKnownLinkObj(
+               return $this->link(
                        SpecialPage::getTitleFor( 'Contributions', 
$this->mTitle->getDBkey() ),
-                       wfMsgHtml( 'contributions' ) );
+                       wfMsgHtml( 'contributions' ),
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               );
        }
 
        function showEmailUser( $id ) {
@@ -1664,9 +1745,13 @@
        }
 
        function emailUserLink() {
-               return $this->makeKnownLinkObj(
+               return $this->link(
                        SpecialPage::getTitleFor( 'Emailuser', 
$this->mTitle->getDBkey() ),
-                       wfMsg( 'emailuser' ) );
+                       wfMsg( 'emailuser' ),
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               );
        }
 
        function watchPageLinksLink() {
@@ -1674,9 +1759,13 @@
                if ( ! $wgOut->isArticleRelated() ) {
                        return '(' . wfMsg( 'notanarticle' ) . ')';
                } else {
-                       return $this->makeKnownLinkObj(
+                       return $this->link(
                                SpecialPage::getTitleFor( 
'Recentchangeslinked', $this->mTitle->getPrefixedDBkey() ),
-                               wfMsg( 'recentchangeslinked-toolbox' ) );
+                               wfMsg( 'recentchangeslinked-toolbox' ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       );
                }
        }
 
@@ -1777,7 +1866,7 @@
                }
 
                # __NEWSECTIONLINK___ changes behaviour here
-               # If it's present, the link points to this page, otherwise
+               # If it is present, the link points to this page, otherwise
                # it points to the talk page
                if( $this->mTitle->isTalkPage() ) {
                        $title = $this->mTitle;
@@ -1787,7 +1876,16 @@
                        $title = $this->mTitle->getTalkPage();
                }
 
-               return $this->makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 
'action=edit&section=new' );
+               return $this->link(
+                       $title,
+                       wfMsg( 'postcomment' ),
+                       array(),
+                       array(
+                               'action' => 'edit',
+                               'section' => 'new'
+                       ),
+                       array( 'known', 'noclasses' )
+               );
        }
 
        /* these are used extensively in SkinTemplate, but also some other 
places */

Modified: trunk/phase3/includes/SkinTemplate.php
===================================================================
--- trunk/phase3/includes/SkinTemplate.php      2009-06-07 14:56:24 UTC (rev 
51567)
+++ trunk/phase3/includes/SkinTemplate.php      2009-06-07 15:02:12 UTC (rev 
51568)
@@ -290,24 +290,35 @@
                } else {
                        $tpl->set( 'jsvarurl', false );
                }
+
                $newtalks = $wgUser->getNewMessageLinks();
 
                if( count( $newtalks ) == 1 && $newtalks[0]['wiki'] === 
wfWikiID() ) {
                        $usertitle = $this->mUser->getUserPage();
                        $usertalktitle = $usertitle->getTalkPage();
+
                        if( !$usertalktitle->equals( $this->mTitle ) ) {
-                               $ntl = wfMsg( 'youhavenewmessages',
-                                       $this->makeKnownLinkObj(
-                                               $usertalktitle,
-                                               wfMsgHtml( 'newmessageslink' ),
-                                               'redirect=no'
-                                       ),
-                                       $this->makeKnownLinkObj(
-                                               $usertalktitle,
-                                               wfMsgHtml( 
'newmessagesdifflink' ),
-                                               'diff=cur'
-                                       )
+                               $newmessageslink = $this->link(
+                                       $usertalktitle,
+                                       wfMsgHtml( 'newmessageslink' ),
+                                       array(),
+                                       array( 'redirect' => 'no' ),
+                                       array( 'known', 'noclasses' )
                                );
+
+                               $newmessagesdifflink = $this->link(
+                                       $usertalktitle,
+                                       wfMsgHtml( 'newmessagesdifflink' ),
+                                       array(),
+                                       array( 'diff' => 'cur' ),
+                                       array( 'known', 'noclasses' )
+                               );
+
+                               $ntl = wfMsg(
+                                       'youhavenewmessages',
+                                       $newmessageslink,
+                                       $newmessagesdifflink
+                               );
                                # Disable Cache
                                $out->setSquidMaxage( 0 );
                        }

Modified: trunk/phase3/includes/WatchlistEditor.php
===================================================================
--- trunk/phase3/includes/WatchlistEditor.php   2009-06-07 14:56:24 UTC (rev 
51567)
+++ trunk/phase3/includes/WatchlistEditor.php   2009-06-07 15:02:12 UTC (rev 
51568)
@@ -340,7 +340,7 @@
                if( ( $count = $this->showItemCount( $output, $user ) ) > 0 ) {
                        $self = SpecialPage::getTitleFor( 'Watchlist' );
                        $form  = Xml::openElement( 'form', array( 'method' => 
'post',
-                               'action' => $self->getLocalUrl( 'action=edit' ) 
) );
+                               'action' => $self->getLocalUrl( array( 'action' 
=> 'edit' ) ) ) );
                        $form .= Xml::hidden( 'token', $wgUser->editToken( 
'watchlistedit' ) );
                        $form .= "<fieldset>\n<legend>" . wfMsgHtml( 
'watchlistedit-normal-legend' ) . "</legend>";
                        $form .= wfMsgExt( 'watchlistedit-normal-explain', 
'parse' );
@@ -414,10 +414,22 @@
                        $link = '<span class="watchlistredir">' . $link . 
'</span>';
                $tools[] = $skin->link( $title->getTalkPage(), wfMsgHtml( 
'talkpagelinktext' ) );
                if( $title->exists() ) {
-                       $tools[] = $skin->makeKnownLinkObj( $title, wfMsgHtml( 
'history_short' ), 'action=history' );
+                       $tools[] = $skin->link(
+                               $title,
+                               wfMsgHtml( 'history_short' ),
+                               array(),
+                               array( 'action' => 'history' ),
+                               array( 'known', 'noclasses' )
+                       );
                }
                if( $title->getNamespace() == NS_USER && !$title->isSubpage() ) 
{
-                       $tools[] = $skin->makeKnownLinkObj( 
SpecialPage::getTitleFor( 'Contributions', $title->getText() ), wfMsgHtml( 
'contributions' ) );
+                       $tools[] = $skin->link(
+                               SpecialPage::getTitleFor( 'Contributions', 
$title->getText() ),
+                               wfMsgHtml( 'contributions' ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       );
                }
                return "<li>"
                        . Xml::check( 'titles[]', false, array( 'value' => 
$title->getPrefixedText() ) )
@@ -435,7 +447,7 @@
                $this->showItemCount( $output, $user );
                $self = SpecialPage::getTitleFor( 'Watchlist' );
                $form  = Xml::openElement( 'form', array( 'method' => 'post',
-                       'action' => $self->getLocalUrl( 'action=raw' ) ) );
+                       'action' => $self->getLocalUrl( array( 'action' => 
'raw' ) ) ) );
                $form .= Xml::hidden( 'token', $wgUser->editToken( 
'watchlistedit' ) );
                $form .= '<fieldset><legend>' . wfMsgHtml( 
'watchlistedit-raw-legend' ) . '</legend>';
                $form .= wfMsgExt( 'watchlistedit-raw-explain', 'parse' );
@@ -487,7 +499,14 @@
                $tools = array();
                $modes = array( 'view' => false, 'edit' => 'edit', 'raw' => 
'raw' );
                foreach( $modes as $mode => $subpage ) {
-                       $tools[] = $skin->makeKnownLinkObj( 
SpecialPage::getTitleFor( 'Watchlist', $subpage ), wfMsgHtml( 
"watchlisttools-{$mode}" ) );
+                       // can use messages 'watchlisttools-view', 
'watchlisttools-edit', 'watchlisttools-raw'
+                       $tools[] = $skin->link(
+                               SpecialPage::getTitleFor( 'Watchlist', $subpage 
),
+                               wfMsgHtml( "watchlisttools-{$mode}" ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       );
                }
                return $wgLang->pipeList( $tools );
        }

Modified: trunk/phase3/includes/parser/Parser.php
===================================================================
--- trunk/phase3/includes/parser/Parser.php     2009-06-07 14:56:24 UTC (rev 
51567)
+++ trunk/phase3/includes/parser/Parser.php     2009-06-07 15:02:12 UTC (rev 
51568)
@@ -1793,6 +1793,7 @@
        function makeKnownLinkHolder( $nt, $text = '', $query = '', $trail = 
'', $prefix = '' ) {
                list( $inside, $trail ) = Linker::splitTrail( $trail );
                $sk = $this->mOptions->getSkin();
+               // FIXME: use link() instead of deprecated makeKnownLinkObj()
                $link = $sk->makeKnownLinkObj( $nt, $text, $query, $inside, 
$prefix );
                return $this->armorLinks( $link ) . $trail;
        }

Modified: trunk/phase3/skins/CologneBlue.php
===================================================================
--- trunk/phase3/skins/CologneBlue.php  2009-06-07 14:56:24 UTC (rev 51567)
+++ trunk/phase3/skins/CologneBlue.php  2009-06-07 15:02:12 UTC (rev 51568)
@@ -79,7 +79,13 @@
 
                $s .= $this->bottomLinks();
                $s .= $wgLang->pipeList( array(
-                       "\n<br />" . $this->makeKnownLinkObj( 
Title::newMainPage() ),
+                       "\n<br />" . $this->link(
+                               Title::newMainPage(),
+                               null,
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       ),
                        $this->aboutLink(),
                        $this->searchForm( wfMsg( 'qbfind' ) )
                ) );
@@ -242,20 +248,35 @@
                $s .= $this->menuHead( 'qbmyoptions' );
                if ( $wgUser->isLoggedIn() ) {
                        $name = $wgUser->getName();
-                       $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
-                               wfMsg( 'mytalk' ) );
+                       $tl = $this->link(
+                               $wgUser->getTalkPage(),
+                               wfMsg( 'mytalk' ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       );
                        if ( $wgUser->getNewtalk() ) {
                                $tl .= " *";
                        }
 
-                       $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
-                               wfMsg( 'mypage' ) )
+                       $s .= $this->link(
+                               $wgUser->getUserPage(),
+                               wfMsg( 'mypage' ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                         )
                          . $sep . $tl
                          . $sep . $this->specialLink( 'watchlist' )
-                         . $sep . $this->makeKnownLinkObj( 
SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
-                               wfMsg( 'mycontris' ) )
-                         . $sep . $this->specialLink( 'preferences' )
-                         . $sep . $this->specialLink( 'userlogout' );
+                         . $sep . $this->link(
+                               SpecialPage::getSafeTitleFor( 'Contributions', 
$wgUser->getName() ),
+                               wfMsg( 'mycontris' ),
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                         )
+                         . $sep . $this->specialLink( 'preferences' )
+                         . $sep . $this->specialLink( 'userlogout' );
                } else {
                        $s .= $this->specialLink( 'userlogin' );
                }
@@ -267,15 +288,21 @@
                if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
                        $s .= $sep . $this->specialLink( 'upload' );
                }
+
                global $wgSiteSupportPage;
+
                if( $wgSiteSupportPage ) {
                        $s .= $sep . '<a href="' . htmlspecialchars( 
$wgSiteSupportPage ) . '" class="internal">'
                              . wfMsg( 'sitesupport' ) . '</a>';
                }
 
-               $s .= $sep . $this->makeKnownLinkObj(
+               $s .= $sep . $this->link(
                        SpecialPage::getTitleFor( 'Specialpages' ),
-                       wfMsg( 'moredotdotdot' ) );
+                       wfMsg( 'moredotdotdot' ),
+                       array(),
+                       array(),
+                       array( 'known', 'noclasses' )
+               );
 
                $s .= $sep . "\n</div>\n";
                return $s;

Modified: trunk/phase3/skins/Standard.php
===================================================================
--- trunk/phase3/skins/Standard.php     2009-06-07 14:56:24 UTC (rev 51567)
+++ trunk/phase3/skins/Standard.php     2009-06-07 15:02:12 UTC (rev 51568)
@@ -221,13 +221,21 @@
                                        # and to avoid messing with the 
separator that is prepended to the next item
                                        $s .= '<strong>' . wfMsg( 'newpage' ) . 
'</strong>';
                                }
-
                        }
 
                        # "Post a comment" link
                        if( ( $this->mTitle->isTalkPage() || 
$wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
-                               $s .= '<br />' . $this->makeKnownLinkObj( 
$this->mTitle, wfMsg( 'postcomment' ), 'action=edit&section=new' );
-                       
+                               $s .= '<br />' . $this->link(
+                                       $this->mTitle,
+                                       wfMsg( 'postcomment' ),
+                                       array(),
+                                       array(
+                                               'action' => 'edit',
+                                               'section' => 'new'
+                                       ),
+                                       array( 'known', 'noclasses' )
+                               );
+
                        #if( $tns%2 && $action!='edit' && !$wpPreview) {
                                #$s.= '<br 
/>'.$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit&section=new');
                        #}

Modified: trunk/phase3/skins/disabled/MonoBookCBT.php
===================================================================
--- trunk/phase3/skins/disabled/MonoBookCBT.php 2009-06-07 14:56:24 UTC (rev 
51567)
+++ trunk/phase3/skins/disabled/MonoBookCBT.php 2009-06-07 15:02:12 UTC (rev 
51568)
@@ -426,19 +426,30 @@
                if (count($newtalks) == 1 && $newtalks[0]["wiki"] === 
$wgDBname) {
                        $usertitle = $this->getUserPageTitle();
                        $usertalktitle = $usertitle->getTalkPage();
+
                        if( !$usertalktitle->equals( $this->mTitle ) ) {
-                               $ntl = wfMsg( 'youhavenewmessages',
-                                       $this->makeKnownLinkObj(
-                                               $usertalktitle,
-                                               wfMsgHtml( 'newmessageslink' ),
-                                               'redirect=no'
-                                       ),
-                                       $this->makeKnownLinkObj(
-                                               $usertalktitle,
-                                               wfMsgHtml( 
'newmessagesdifflink' ),
-                                               'diff=cur'
-                                       )
+                               $newmessageslink = $this->link(
+                                       $usertalktitle,
+                                       wfMsgHtml( 'newmessageslink' ),
+                                       array(),
+                                       array( 'redirect' => 'no' ),
+                                       array( 'known', 'noclasses' )
                                );
+       
+                               $newmessagesdifflink = $this->link(
+                                       $usertalktitle,
+                                       wfMsgHtml( 'newmessagesdifflink' ),
+                                       array(),
+                                       array( 'diff' => 'cur' ),
+                                       array( 'known', 'noclasses' )
+                               );
+       
+                               $ntl = wfMsg(
+                                       'youhavenewmessages',
+                                       $newmessageslink,
+                                       $newmessagesdifflink
+                               );
+
                                # Disable Cache
                                $this->mOut->setSquidMaxage(0);
                        }



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to