From ddee457293d195da12ef5302355a36dbb17a5df2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 23 Feb 2009 09:30:14 +0000 Subject: [PATCH] * (bug 17621) Special:WantedFiles has no link to Special:Whatlinkshere * Use nlinks instead of nmembers in Wantedfiles (does anybody use this page?) * Removed dead code in Wantedtemplates --- RELEASE-NOTES | 1 + includes/specials/SpecialWantedfiles.php | 23 +++++++++++++++++--- includes/specials/SpecialWantedtemplates.php | 2 -- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a668e20cd7..a9d613fccb 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -218,6 +218,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 14414) maintenance/updateSpecialPages.php no longer throws error with PostgreSQL * (bug 17546) Correct Tongan language native name is "lea faka-Tonga" +* (bug 17621) Special:WantedFiles has no link to Special:Whatlinkshere == API changes in 1.15 == * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions diff --git a/includes/specials/SpecialWantedfiles.php b/includes/specials/SpecialWantedfiles.php index c2731fa9ac..4957531e6d 100644 --- a/includes/specials/SpecialWantedfiles.php +++ b/includes/specials/SpecialWantedfiles.php @@ -72,9 +72,26 @@ class WantedFilesPage extends QueryPage { $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ) : $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) ); - $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'), - $wgLang->formatNum( $result->value ) ); - return wfSpecialList($plink, $nlinks); + return wfSpecialList( + $plink, + $this->makeWlhLink( $nt, $skin, $result ) + ); + } + + /** + * Make a "what links here" link for a given title + * + * @param Title $title Title to make the link for + * @param Skin $skin Skin to use + * @param object $result Result row + * @return string + */ + private function makeWlhLink( $title, $skin, $result ) { + global $wgLang; + $wlh = SpecialPage::getTitleFor( 'Whatlinkshere' ); + $label = wfMsgExt( 'nlinks', array( 'parsemag', 'escape' ), + $wgLang->formatNum( $result->value ) ); + return $skin->link( $wlh, $label, array(), array( 'target' => $title->getPrefixedText() ) ); } } diff --git a/includes/specials/SpecialWantedtemplates.php b/includes/specials/SpecialWantedtemplates.php index 4010ef89e2..7dd9a26208 100644 --- a/includes/specials/SpecialWantedtemplates.php +++ b/includes/specials/SpecialWantedtemplates.php @@ -73,8 +73,6 @@ class WantedTemplatesPage extends QueryPage { $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ) : $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) ); - $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'), - $wgLang->formatNum( $result->value ) ); return wfSpecialList( $plink, $this->makeWlhLink( $nt, $skin, $result ) -- 2.20.1