From f41c8a05161a472395f651db7a1aa9f45cb02399 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Sun, 1 Jan 2012 12:30:26 +0000 Subject: [PATCH] (bug 33447) Link to the broken image tracking category from Special:Wantedfiles Also add a note about how if you use a foreign repo, you're going to get plenty false positives. --- RELEASE-NOTES-1.19 | 1 + includes/specials/SpecialWantedfiles.php | 26 ++++++++++++++++++++++++ languages/messages/MessagesEn.php | 2 ++ languages/messages/MessagesQqq.php | 2 ++ maintenance/language/messages.inc | 2 ++ 5 files changed, 33 insertions(+) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 689ee6d713..021db41e62 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -110,6 +110,7 @@ production. * Added $wgSend404Code, true by default, which can be set to false to send a 200 status code instead of 404 for nonexistent articles. * (bug 23427) Introduced {{PAGEID}} variable to expose page.page_id +* (bug 33447) Link to the broken image tracking category from Special:Wantedfiles === Bug fixes in 1.19 === * $wgUploadNavigationUrl should be used for file redlinks if. diff --git a/includes/specials/SpecialWantedfiles.php b/includes/specials/SpecialWantedfiles.php index 8a4fe56fcc..ec0912df62 100644 --- a/includes/specials/SpecialWantedfiles.php +++ b/includes/specials/SpecialWantedfiles.php @@ -35,6 +35,32 @@ class WantedFilesPage extends WantedQueryPage { parent::__construct( $name ); } + function getPageHeader() { + # Specifically setting to use "Wanted Files" (NS_MAIN) as title, so as to get what + # category would be used on main namespace pages, for those tricky wikipedia + # admins who like to do {{#ifeq:{{NAMESPACE}}|foo|bar|....}}. + $catMessage = wfMessage( 'broken-file-category' ) + ->title( Title::newFromText( "Wanted Files", NS_MAIN ) ) + ->inContentLanguage(); + + if ( !$catMessage->isDisabled() ) { + $category = Title::makeTitleSafe( NS_CATEGORY, $catMessage->text() ); + } else { + $category = false; + } + + if ( $category ) { + return $this + ->msg( 'wantedfiletext-cat' ) + ->params( $category->getFullText() ) + ->parseAsBlock(); + } else { + return $this + ->msg( 'wantedfiletext-nocat' ) + ->parseAsBlock(); + } + } + /** * KLUGE: The results may contain false positives for files * that exist e.g. in a shared repo. Setting this at least diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 6148d927a0..ca647f7e8f 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2529,6 +2529,8 @@ It now redirects to [[$2]].', 'wantedpages-badtitle' => 'Invalid title in result set: $1', 'wantedfiles' => 'Wanted files', 'wantedfiles-summary' => '', # do not translate or duplicate this message to other languages +'wantedfiletext-cat' => 'The following images are used but do not exist. Images from foreign repositories may be listed despite existing. Any such false positives will be struck out. Additionally, pages that embed images that do not exist are listed in [[:$1]].', +'wantedfiletext-nocat' => 'The following images are used but do not exist. Images from foreign repositories may be listed despite existing. Any such false positives will be struck out.', 'wantedtemplates' => 'Wanted templates', 'wantedtemplates-summary' => '', # do not translate or duplicate this message to other languages 'mostlinked' => 'Most linked-to pages', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 5b99d784d7..41c6255c8d 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -2219,6 +2219,8 @@ Possible alternatives to the word 'content' are 'subject matter' or 'wiki subjec $1 is a page title", 'wantedfiles' => 'Name of special page displayed in [[Special:SpecialPages]] and title of [[Special:WantedFiles]].', +'wantedfiletext-cat' => 'Message displayed at top of [[special:WantedFiles]]. $1 contains the name of the tracking category for broken files (Including Category prefix). {{msg-mw|wantedfiletext-nocat}} is used if the tracking category is disabled.', +'wantedfiletext-nocat' => 'Message displayed at top of [[special:WantedFiles]] when broken file tracking category is disabled. See {{msg-mw|wantedfiletext-cat}}.', 'wantedtemplates' => 'The page name of [[Special:WantedTemplates]].', 'mostlinked' => 'Name of special page displayed in [[Special:SpecialPages]]', 'mostlinkedcategories' => 'Name of special page displayed in [[Special:SpecialPages]]', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 3fbf447b5c..c8115d0a1f 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1628,6 +1628,8 @@ $wgMessageStructure = array( 'wantedpages-badtitle', 'wantedfiles', 'wantedfiles-summary', + 'wantedfiletext-cat', + 'wantedfiletext-nocat', 'wantedtemplates', 'wantedtemplates-summary', 'mostlinked', -- 2.20.1