Revision: 51543
Author:   siebrand
Date:     2009-06-06 17:00:20 +0000 (Sat, 06 Jun 2009)

Log Message:
-----------
* replace use of deprecated makeLink() by link() in core
* replace other deprecated Linker::*link*() methods in special pages

Modified Paths:
--------------
    trunk/phase3/includes/ImageGallery.php
    trunk/phase3/includes/Linker.php
    trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php
    trunk/phase3/includes/specials/SpecialListgrouprights.php
    trunk/phase3/includes/specials/SpecialMIMEsearch.php
    trunk/phase3/includes/specials/SpecialStatistics.php

Modified: trunk/phase3/includes/ImageGallery.php
===================================================================
--- trunk/phase3/includes/ImageGallery.php      2009-06-06 16:44:29 UTC (rev 
51542)
+++ trunk/phase3/includes/ImageGallery.php      2009-06-06 17:00:20 UTC (rev 
51543)
@@ -250,8 +250,15 @@
                                        . htmlspecialchars( $nt->getText() ) . 
'</div>';
                        } elseif( $this->mHideBadImages && wfIsBadImage( 
$nt->getDBkey(), $this->getContextTitle() ) ) {
                                # The image is blacklisted, just show it as a 
text link.
-                               $thumbhtml = "\n\t\t\t".'<div style="height: 
'.($this->mHeights*1.25+2).'px;">'
-                                       . $sk->makeKnownLinkObj( $nt, 
htmlspecialchars( $nt->getText() ) ) . '</div>';
+                               $thumbhtml = "\n\t\t\t".'<div style="height: 
'.($this->mHeights*1.25+2).'px;">' .
+                                       $sk->link(
+                                               $nt,
+                                               htmlspecialchars( 
$nt->getText() ),
+                                               array()
+                                               array(),
+                                               array( 'known', 'noclasses' )
+                                       ) .
+                                       '</div>';
                        } elseif( !( $thumb = $img->transform( $params ) ) ) {
                                # Error generating thumbnail.
                                $thumbhtml = "\n\t\t\t".'<div style="height: 
'.($this->mHeights*1.25+2).'px;">'
@@ -274,7 +281,8 @@
                        }
 
                        //TODO
-                       //$ul = $sk->makeLink( $wgContLang->getNsText( 
MWNamespace::getUser() ) . ":{$ut}", $ut );
+                       // $linkTarget = Title::newFromText( 
$wgContLang->getNsText( MWNamespace::getUser() ) . ":{$ut}" );
+                       // $ul = $sk->link( $linkTarget, $ut );
 
                        if( $this->mShowBytes ) {
                                if( $img ) {
@@ -289,7 +297,13 @@
                        }
 
                        $textlink = $this->mShowFilename ?
-                               $sk->makeKnownLinkObj( $nt, htmlspecialchars( 
$wgLang->truncate( $nt->getText(), 20 ) ) ) . "<br />\n" :
+                               $sk->link(
+                                       $nt,
+                                       htmlspecialchars( $wgLang->truncate( 
$nt->getText(), 20 ) )
+                                       array(),
+                                       array(),
+                                       array( 'known', 'noclasses' )
+                               ) . "<br />\n" :
                                '' ;
 
                        # ATTENTION: The newline after <div 
class="gallerytext"> is needed to accommodate htmltidy which

Modified: trunk/phase3/includes/Linker.php
===================================================================
--- trunk/phase3/includes/Linker.php    2009-06-06 16:44:29 UTC (rev 51542)
+++ trunk/phase3/includes/Linker.php    2009-06-06 17:00:20 UTC (rev 51543)
@@ -1345,7 +1345,12 @@
                        $linkRegexp = '/\[\[(.*?)\]\]' . preg_quote( $trail, 
'/' ) . '/';
                        if (isset($match[1][0]) && $match[1][0] == ':')
                                $match[1] = substr($match[1], 1);
-                       $thelink = $this->makeLink( $match[1], $text, "", 
$trail );
+                       list( $inside, $trail ) = Linker::splitTrail( $trail );
+                       $linkTarget = Title::newFromText( $match[1] );
+                       $thelink = $this->link(
+                               linkTarget,
+                               $text . $inside,
+                       ) . $trail;
                }
                $comment = preg_replace( $linkRegexp, 
StringUtils::escapeRegexReplacement( $thelink ), $comment, 1 );
 

Modified: trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php
===================================================================
--- trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php       
2009-06-06 16:44:29 UTC (rev 51542)
+++ trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php       
2009-06-06 17:00:20 UTC (rev 51543)
@@ -51,7 +51,10 @@
 
                $nt = Title::makeTitle( NS_FILE, $result->title );
                $text = $wgContLang->convert( $nt->getText() );
-               $plink = $skin->makeLink( $nt->getPrefixedText(), $text );
+               $plink = $skin->link(
+                       Title::newFromText( $nt->getPrefixedText() ),
+                       $text
+               );
 
                $user = $skin->link( Title::makeTitle( NS_USER, 
$result->img_user_text ), $result->img_user_text );
                $time = $wgLang->timeanddate( $result->img_timestamp );

Modified: trunk/phase3/includes/specials/SpecialListgrouprights.php
===================================================================
--- trunk/phase3/includes/specials/SpecialListgrouprights.php   2009-06-06 
16:44:29 UTC (rev 51542)
+++ trunk/phase3/includes/specials/SpecialListgrouprights.php   2009-06-06 
17:00:20 UTC (rev 51543)
@@ -61,14 +61,29 @@
                                // Do not make a link for the generic * group
                                $grouppage = 
htmlspecialchars($groupnameLocalized);
                        } else {
-                               $grouppage = $this->skin->makeLink( 
$grouppageLocalized, htmlspecialchars($groupnameLocalized) );
+                               $grouppage = $this->skin->link(
+                                       Title::newFromText( $grouppageLocalized 
),
+                                       htmlspecialchars($groupnameLocalized)
+                               );
                        }
 
                        if ( $group === 'user' ) {
                                // Link to Special:listusers for implicit group 
'user'
-                               $grouplink = '<br />' . 
$this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Listusers' ), 
wfMsgHtml( 'listgrouprights-members' ), ''  );
+                               $grouplink = '<br />' . $this->skin->link(
+                                       SpecialPage::getTitleFor( 'Listusers' ),
+                                       wfMsgHtml( 'listgrouprights-members' ),
+                                       array(),
+                                       array(),
+                                       array( 'known', 'noclasses' )
+                               );
                        } elseif ( !in_array( $group, $wgImplicitGroups ) ) {
-                               $grouplink = '<br />' . 
$this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Listusers' ), 
wfMsgHtml( 'listgrouprights-members' ), 'group=' . $group );
+                               $grouplink = '<br />' . $this->skin->link(
+                                       SpecialPage::getTitleFor( 'Listusers' ),
+                                       wfMsgHtml( 'listgrouprights-members' ),
+                                       array(),
+                                       array( 'group' => $group ),
+                                       array( 'known', 'noclasses' )
+                               );
                        } else {
                                // No link to Special:listusers for other 
implicit groups as they are unlistable
                                $grouplink = '';

Modified: trunk/phase3/includes/specials/SpecialMIMEsearch.php
===================================================================
--- trunk/phase3/includes/specials/SpecialMIMEsearch.php        2009-06-06 
16:44:29 UTC (rev 51542)
+++ trunk/phase3/includes/specials/SpecialMIMEsearch.php        2009-06-06 
17:00:20 UTC (rev 51543)
@@ -65,7 +65,10 @@
 
                $nt = Title::makeTitle( $result->namespace, $result->title );
                $text = $wgContLang->convert( $nt->getText() );
-               $plink = $skin->makeLink( $nt->getPrefixedText(), 
htmlspecialchars($text) );
+               $plink = $skin->link(
+                       Title::newFromText( $nt->getPrefixedText() ),
+                       htmlspecialchars( $text )
+               );
 
                $download = $skin->makeMediaLinkObj( $nt, wfMsgHtml( 'download' 
) );
                $bytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'),

Modified: trunk/phase3/includes/specials/SpecialStatistics.php
===================================================================
--- trunk/phase3/includes/specials/SpecialStatistics.php        2009-06-06 
16:44:29 UTC (rev 51542)
+++ trunk/phase3/includes/specials/SpecialStatistics.php        2009-06-06 
17:00:20 UTC (rev 51543)
@@ -184,13 +184,19 @@
                        } else {
                                $grouppageLocalized = $msg;
                        }
-                       $grouppage = $sk->makeLink( $grouppageLocalized, 
htmlspecialchars( $groupnameLocalized ) );
-                       $grouplink = $sk->link( SpecialPage::getTitleFor( 
'Listusers' ),
+                       $linkTarget = Title::newFromText( $grouppageLocalized );
+                       $grouppage = $sk->link(
+                               $linkTarget,
+                               htmlspecialchars( $groupnameLocalized )
+                       );
+                       $grouplink = $sk->link(
+                               SpecialPage::getTitleFor( 'Listusers' ),
                                wfMsgHtml( 'listgrouprights-members' ),
                                array(),
                                array( 'group' => $group ),
-                               'known' );
-                               # Add a class when a usergroup contains no 
members to allow hiding these rows
+                               'known'
+                       );
+                       # Add a class when a usergroup contains no members to 
allow hiding these rows
                        $classZero = '';
                        $countUsers = SiteStats::numberingroup( $groupname );
                        if( $countUsers == 0 ) {



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

Reply via email to