* replace use of deprecated makeLink() by link() in core
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sat, 6 Jun 2009 17:00:20 +0000 (17:00 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sat, 6 Jun 2009 17:00:20 +0000 (17:00 +0000)
* replace other deprecated Linker::*link*() methods in special pages

includes/ImageGallery.php
includes/Linker.php
includes/specials/SpecialFileDuplicateSearch.php
includes/specials/SpecialListgrouprights.php
includes/specials/SpecialMIMEsearch.php
includes/specials/SpecialStatistics.php

index 8a38bed..fe88cd6 100644 (file)
@@ -250,8 +250,15 @@ class ImageGallery
                                        . 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 @@ class ImageGallery
                        }
 
                        //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 @@ class ImageGallery
                        }
 
                        $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
index b5975ba..1ea9800 100644 (file)
@@ -1345,7 +1345,12 @@ class Linker {
                        $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 );
 
index 65d32b8..7166693 100644 (file)
@@ -51,7 +51,10 @@ class FileDuplicateSearchPage extends QueryPage {
 
                $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 );
index b5c358a..44cd024 100644 (file)
@@ -61,14 +61,29 @@ class SpecialListGroupRights extends SpecialPage {
                                // 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 = '';
index 43fe3f6..194836e 100644 (file)
@@ -65,7 +65,10 @@ class MIMEsearchPage extends QueryPage {
 
                $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'),
index 109c5c3..5431eb8 100644 (file)
@@ -184,13 +184,19 @@ class SpecialStatistics extends SpecialPage {
                        } 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 ) {