jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/359688 )

Change subject: Replace Linker::link() with LinkRenderer in special pages
......................................................................


Replace Linker::link() with LinkRenderer in special pages

Bug: T149346
Change-Id: Ib4bf6bd1e585a671a77658d1b9a51a1f59a5a350
---
M frontend/specialpages/actions/RevisionReview_body.php
M frontend/specialpages/reports/ConfiguredPages_body.php
M frontend/specialpages/reports/PendingChanges_body.php
M frontend/specialpages/reports/ProblemChanges_body.php
M frontend/specialpages/reports/ReviewedPages_body.php
M frontend/specialpages/reports/ReviewedVersions_body.php
M frontend/specialpages/reports/StablePages_body.php
M frontend/specialpages/reports/UnreviewedPages_body.php
M frontend/specialpages/reports/ValidationStatistics_body.php
9 files changed, 52 insertions(+), 37 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/frontend/specialpages/actions/RevisionReview_body.php 
b/frontend/specialpages/actions/RevisionReview_body.php
index 974a95b..6fc5917 100644
--- a/frontend/specialpages/actions/RevisionReview_body.php
+++ b/frontend/specialpages/actions/RevisionReview_body.php
@@ -182,11 +182,12 @@
        }
 
        protected function getSpecialLinks() {
+               $linkRenderer = $this->getLinkRenderer();
                $s = '<p>' . $this->msg( 'returnto' )->rawParams(
-                       Linker::linkKnown( SpecialPage::getTitleFor( 
'UnreviewedPages' ) )
+                       $linkRenderer->makeKnownLink( SpecialPage::getTitleFor( 
'UnreviewedPages' ) )
                )->escaped() . '</p>';
                $s .= '<p>' . $this->msg( 'returnto' )->rawParams(
-                       Linker::linkKnown( SpecialPage::getTitleFor( 
'PendingChanges' ) )
+                       $linkRenderer->makeKnownLink( SpecialPage::getTitleFor( 
'PendingChanges' ) )
                )->escaped() . '</p>';
                return $s;
        }
diff --git a/frontend/specialpages/reports/ConfiguredPages_body.php 
b/frontend/specialpages/reports/ConfiguredPages_body.php
index b62561a..89f9849 100644
--- a/frontend/specialpages/reports/ConfiguredPages_body.php
+++ b/frontend/specialpages/reports/ConfiguredPages_body.php
@@ -71,11 +71,12 @@
        public function formatRow( $row ) {
                $title = Title::newFromRow( $row );
                # Link to page
-               $link = Linker::link( $title );
+               $linkRenderer = $this->getLinkRenderer();
+               $link = $linkRenderer->makeLink( $title );
                # Link to page configuration
-               $config = Linker::linkKnown(
+               $config = $linkRenderer->makeKnownLink(
                        SpecialPage::getTitleFor( 'Stabilization' ),
-                       $this->msg( 'configuredpages-config' )->escaped(),
+                       $this->msg( 'configuredpages-config' )->text(),
                        [],
                        'page=' . $title->getPrefixedUrl()
                );
diff --git a/frontend/specialpages/reports/PendingChanges_body.php 
b/frontend/specialpages/reports/PendingChanges_body.php
index efff67d..f621f89 100644
--- a/frontend/specialpages/reports/PendingChanges_body.php
+++ b/frontend/specialpages/reports/PendingChanges_body.php
@@ -225,14 +225,17 @@
                $title = Title::newFromRow( $row );
                $stxt = ChangesList::showCharacterDifference( $row->rev_len, 
$row->page_len );
                # Page links...
-               $link = Linker::link( $title );
-               $hist = Linker::linkKnown( $title,
-                       $this->msg( 'hist' )->escaped(),
+               $linkRenderer = $this->getLinkRenderer();
+               $link = $linkRenderer->makeLink( $title );
+               $hist = $linkRenderer->makeKnownLink(
+                       $title,
+                       $this->msg( 'hist' )->text(),
                        [],
                        [ 'action' => 'history' ]
                );
-               $review = Linker::linkKnown( $title,
-                       $this->msg( 'pendingchanges-diff' )->escaped(),
+               $review = $linkRenderer->makeKnownLink(
+                       $title,
+                       $this->msg( 'pendingchanges-diff' )->text(),
                        [],
                        [ 'diff' => 'cur', 'oldid' => $row->stable ] + 
FlaggedRevs::diffOnlyCGI()
                );
diff --git a/frontend/specialpages/reports/ProblemChanges_body.php 
b/frontend/specialpages/reports/ProblemChanges_body.php
index d832c63..e21f270 100644
--- a/frontend/specialpages/reports/ProblemChanges_body.php
+++ b/frontend/specialpages/reports/ProblemChanges_body.php
@@ -193,9 +193,11 @@
                $css = $quality = $tags = $underReview = '';
 
                $title = Title::newFromRow( $row );
-               $link = Linker::link( $title );
-               $review = Linker::linkKnown( $title,
-                       $this->msg( 'pendingchanges-diff' )->escaped(),
+               $linkRenderer = $this->getLinkRenderer();
+               $link = $linkRenderer->makeLink( $title );
+               $review = $linkRenderer->makeKnownLink(
+                       $title,
+                       $this->msg( 'pendingchanges-diff' )->text(),
                        [],
                        [ 'diff' => 'cur', 'oldid' => $row->stable ] + 
FlaggedRevs::diffOnlyCGI()
                );
diff --git a/frontend/specialpages/reports/ReviewedPages_body.php 
b/frontend/specialpages/reports/ReviewedPages_body.php
index c824a33..ce91ab3 100644
--- a/frontend/specialpages/reports/ReviewedPages_body.php
+++ b/frontend/specialpages/reports/ReviewedPages_body.php
@@ -40,9 +40,9 @@
                $form .= "<fieldset><legend>" . $this->msg( 'reviewedpages-leg' 
)->escaped() . "</legend>\n";
 
                // show/hide links
-               $showhide = [ $this->msg( 'show' )->escaped(), $this->msg( 
'hide' )->escaped() ];
+               $showhide = [ $this->msg( 'show' )->text(), $this->msg( 'hide' 
)->text() ];
                $onoff = 1 - $this->hideRedirs;
-               $link = Linker::link( $this->getPageTitle(), $showhide[$onoff], 
[],
+               $link = $this->getLinkRenderer()->makeLink( 
$this->getPageTitle(), $showhide[$onoff], [],
                         [ 'hideredirs' => $onoff, 'namespace' => 
$this->namespace ]
                );
                $showhideredirs = $this->msg( 'whatlinkshere-hideredirs' 
)->rawParams( $link )->escaped();
@@ -82,7 +82,8 @@
 
        public function formatRow( $row ) {
                $title = Title::newFromRow( $row );
-               $link = Linker::link( $title ); # Link to page
+               $linkRenderer = $this->getLinkRenderer();
+               $link = $linkRenderer->makeLink( $title ); # Link to page
                $dirmark = $this->getLanguage()->getDirMark(); # Direction mark
                $stxt = ''; # Size (bytes)
                $size = $row->page_len;
@@ -96,18 +97,18 @@
                        }
                }
                # Link to list of reviewed versions for page
-               $list = Linker::linkKnown(
+               $list = $linkRenderer->makeKnownLink(
                        SpecialPage::getTitleFor( 'ReviewedVersions' ),
-                       $this->msg( 'reviewedpages-all' )->escaped(),
+                       $this->msg( 'reviewedpages-all' )->text(),
                        [],
                        'page=' . $title->getPrefixedUrl()
                );
                # Link to highest tier rev
                $best = '';
                if ( FlaggedRevs::qualityVersions() ) {
-                       $best = Linker::linkKnown(
+                       $best = $linkRenderer->makeKnownLink(
                                $title,
-                               $this->msg( 'reviewedpages-best' )->escaped(),
+                               $this->msg( 'reviewedpages-best' )->text(),
                                [],
                                'stableid=best'
                        );
diff --git a/frontend/specialpages/reports/ReviewedVersions_body.php 
b/frontend/specialpages/reports/ReviewedVersions_body.php
index a01ef0f..cb24484 100644
--- a/frontend/specialpages/reports/ReviewedVersions_body.php
+++ b/frontend/specialpages/reports/ReviewedVersions_body.php
@@ -60,7 +60,7 @@
                $lev = ( $row->fr_quality >= 1 )
                        ? $this->msg( 'revreview-hist-quality' )->escaped()
                        : $this->msg( 'revreview-hist-basic' )->escaped();
-               $link = Linker::link(
+               $link = $this->getLinkRenderer()->makeLink(
                        $this->page,
                        $rdatim,
                        [],
diff --git a/frontend/specialpages/reports/StablePages_body.php 
b/frontend/specialpages/reports/StablePages_body.php
index f56ce62..909479c 100644
--- a/frontend/specialpages/reports/StablePages_body.php
+++ b/frontend/specialpages/reports/StablePages_body.php
@@ -67,19 +67,22 @@
 
        public function formatRow( $row ) {
                $title = Title::makeTitle( $row->page_namespace, 
$row->page_title );
+               $linkRenderer = $this->getLinkRenderer();
                // Link to page
-               $link = Linker::link( $title );
+               $link = $linkRenderer->makeLink( $title );
                // Helpful utility links
                $utilLinks = [];
-               $utilLinks[] = Linker::link(
+               $utilLinks[] = $linkRenderer->makeLink(
                        $title,
-                       $this->msg( 'stablepages-config' )->escaped(),
+                       $this->msg( 'stablepages-config' )->text(),
                        [], [ 'action' => 'protect' ], 'known' );
-               $utilLinks[] = Linker::link( $title,
-                       $this->msg( 'history' )->escaped(),
+               $utilLinks[] = $linkRenderer->makeLink(
+                       $title,
+                       $this->msg( 'history' )->text(),
                        [], [ 'action' => 'history' ], 'known' );
-               $utilLinks[] = Linker::link( SpecialPage::getTitleFor( 'Log', 
'stable' ),
-                       $this->msg( 'stable-logpage' )->escaped(),
+               $utilLinks[] = $linkRenderer->makeLink(
+                       SpecialPage::getTitleFor( 'Log', 'stable' ),
+                       $this->msg( 'stable-logpage' )->text(),
                        [], [ 'page' => $title->getPrefixedText() ], 'known' );
                // Autoreview/review restriction level
                $restr = '';
diff --git a/frontend/specialpages/reports/UnreviewedPages_body.php 
b/frontend/specialpages/reports/UnreviewedPages_body.php
index aea4251..faaf8f4 100644
--- a/frontend/specialpages/reports/UnreviewedPages_body.php
+++ b/frontend/specialpages/reports/UnreviewedPages_body.php
@@ -44,9 +44,9 @@
                        $this->getLanguage()->formatNum( 
$this->pager->getNumRows() ) );
 
                # show/hide links
-               $showhide = [ $this->msg( 'show' )->escaped(), $this->msg( 
'hide' )->escaped() ];
+               $showhide = [ $this->msg( 'show' )->text(), $this->msg( 'hide' 
)->text() ];
                $onoff = 1 - $this->hideRedirs;
-               $link = Linker::link( $this->getPageTitle(), $showhide[$onoff], 
[],
+               $link = $this->getLinkRenderer()->makeLink( 
$this->getPageTitle(), $showhide[$onoff], [],
                        [ 'hideredirs' => $onoff, 'category' => $this->category,
                                'namespace' => $this->namespace ]
                );
@@ -108,11 +108,12 @@
                $title = Title::newFromRow( $row );
 
                $stxt = $underReview = $watching = '';
-               $link = Linker::link( $title, null, [], [ 'redirect' => 'no' ] 
);
+               $linkRenderer = $this->getLinkRenderer();
+               $link = $linkRenderer->makeLink( $title, null, [], [ 'redirect' 
=> 'no' ] );
                $dirmark = $this->getLanguage()->getDirMark();
-               $hist = Linker::linkKnown(
+               $hist = $linkRenderer->makeKnownLink(
                        $title,
-                       $this->msg( 'hist' )->escaped(),
+                       $this->msg( 'hist' )->text(),
                        [],
                        [ 'action' => 'history' ]
                );
diff --git a/frontend/specialpages/reports/ValidationStatistics_body.php 
b/frontend/specialpages/reports/ValidationStatistics_body.php
index 8f71023..d988f12 100644
--- a/frontend/specialpages/reports/ValidationStatistics_body.php
+++ b/frontend/specialpages/reports/ValidationStatistics_body.php
@@ -127,6 +127,7 @@
                        $unreviewed = intval( $total ) - intval( $reviewed );
                        $unreviewed = $lang->formatnum( max( 0, $unreviewed ) 
); // lag between queries
 
+                       $linkRenderer = $this->getLinkRenderer();
                        $out->addHTML(
                                "<tr style='text-align: center;'>
                                        <td>" .
@@ -147,8 +148,9 @@
                                                $percSynced .
                                        "</td>
                                        <td>" .
-                                               Linker::linkKnown( 
SpecialPage::getTitleFor( 'PendingChanges' ),
-                                                       htmlspecialchars( 
$outdated ),
+                                               $linkRenderer->makeKnownLink(
+                                                       
SpecialPage::getTitleFor( 'PendingChanges' ),
+                                                       $outdated,
                                                        [],
                                                        [ 'namespace' => 
$namespace ]
                                                ) .
@@ -157,8 +159,9 @@
                        if ( !$wgFlaggedRevsProtection ) {
                                $out->addHTML( "
                                        <td>" .
-                                               Linker::linkKnown( 
SpecialPage::getTitleFor( 'UnreviewedPages' ),
-                                                       htmlspecialchars( 
$unreviewed ),
+                                               $linkRenderer->makeKnownLink(
+                                                       
SpecialPage::getTitleFor( 'UnreviewedPages' ),
+                                                       $unreviewed,
                                                        [],
                                                        [ 'namespace' => 
$namespace ]
                                                ) .

-- 
To view, visit https://gerrit.wikimedia.org/r/359688
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4bf6bd1e585a671a77658d1b9a51a1f59a5a350
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <matejsuchane...@gmail.com>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Matthias Mullie <mmul...@wikimedia.org>
Gerrit-Reviewer: Matěj Suchánek <matejsuchane...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to