From 813e4e1160bdc677dc4def529a4ecb650a1ad3da Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sat, 6 Aug 2016 20:41:13 -0700 Subject: [PATCH] SpecialTags: Use LinkRenderer instead of Linker::link() Change-Id: I2b179e9d90e79f46cca5c6698847caadeadc1444 --- includes/specials/SpecialTags.php | 32 ++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index 2139949958..b3f099793a 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -176,12 +176,13 @@ class SpecialTags extends SpecialPage { $newRow = ''; $newRow .= Xml::tags( 'td', null, Xml::element( 'code', null, $tag ) ); + $linkRenderer = $this->getLinkRenderer(); $disp = ChangeTags::tagDescription( $tag ); if ( $showEditLinks ) { $disp .= ' '; - $editLink = Linker::link( + $editLink = $linkRenderer->makeLink( $this->msg( "tag-$tag" )->inContentLanguage()->getTitle(), - $this->msg( 'tags-edit' )->escaped() + $this->msg( 'tags-edit' )->text() ); $disp .= $this->msg( 'parentheses' )->rawParams( $editLink )->escaped(); } @@ -191,9 +192,9 @@ class SpecialTags extends SpecialPage { $desc = !$msg->exists() ? '' : $msg->parse(); if ( $showEditLinks ) { $desc .= ' '; - $editDescLink = Linker::link( + $editDescLink = $linkRenderer->makeLink( $this->msg( "tag-$tag-description" )->inContentLanguage()->getTitle(), - $this->msg( 'tags-edit' )->escaped() + $this->msg( 'tags-edit' )->text() ); $desc .= $this->msg( 'parentheses' )->rawParams( $editDescLink )->escaped(); } @@ -217,14 +218,16 @@ class SpecialTags extends SpecialPage { $activeMsg = ( $isActive ? 'tags-active-yes' : 'tags-active-no' ); $newRow .= Xml::tags( 'td', null, $this->msg( $activeMsg )->escaped() ); - $hitcountLabel = $this->msg( 'tags-hitcount' )->numParams( $hitcount )->escaped(); + $hitcountLabelMsg = $this->msg( 'tags-hitcount' )->numParams( $hitcount ); if ( $this->getConfig()->get( 'UseTagFilter' ) ) { - $hitcountLabel = Linker::link( + $hitcountLabel = $linkRenderer->makeLink( SpecialPage::getTitleFor( 'Recentchanges' ), - $hitcountLabel, + $hitcountLabelMsg->text(), [], [ 'tagfilter' => $tag ] ); + } else { + $hitcountLabel = $hitcountLabelMsg->escaped(); } // add raw $hitcount for sorting, because tags-hitcount contains numbers and letters @@ -235,8 +238,9 @@ class SpecialTags extends SpecialPage { // delete if ( $showDeleteActions && ChangeTags::canDeleteTag( $tag )->isOK() ) { - $actionLinks[] = Linker::linkKnown( $this->getPageTitle( 'delete' ), - $this->msg( 'tags-delete' )->escaped(), + $actionLinks[] = $linkRenderer->makeKnownLink( + $this->getPageTitle( 'delete' ), + $this->msg( 'tags-delete' )->text(), [], [ 'tag' => $tag ] ); } @@ -245,16 +249,18 @@ class SpecialTags extends SpecialPage { // activate if ( ChangeTags::canActivateTag( $tag )->isOK() ) { - $actionLinks[] = Linker::linkKnown( $this->getPageTitle( 'activate' ), - $this->msg( 'tags-activate' )->escaped(), + $actionLinks[] = $linkRenderer->makeKnownLink( + $this->getPageTitle( 'activate' ), + $this->msg( 'tags-activate' )->text(), [], [ 'tag' => $tag ] ); } // deactivate if ( ChangeTags::canDeactivateTag( $tag )->isOK() ) { - $actionLinks[] = Linker::linkKnown( $this->getPageTitle( 'deactivate' ), - $this->msg( 'tags-deactivate' )->escaped(), + $actionLinks[] = $linkRenderer->makeKnownLink( + $this->getPageTitle( 'deactivate' ), + $this->msg( 'tags-deactivate' )->text(), [], [ 'tag' => $tag ] ); } -- 2.20.1