From 5e1e5df968c589d62ece2e0a58038eb81793331c Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Mon, 8 Oct 2012 00:26:42 +0100 Subject: [PATCH] (bug 40154) On action=info show where this page redirects to and whether it's a content page or not. Change-Id: I17ab90af902b3b23d5c9bc23f0c71a18d1006cb8 --- includes/actions/InfoAction.php | 22 ++++++++++++++++++++++ languages/messages/MessagesEn.php | 4 ++++ languages/messages/MessagesQqq.php | 4 ++++ maintenance/language/messages.inc | 4 ++++ 4 files changed, 34 insertions(+) diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index e09cd20568..e74e2f74b9 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -189,6 +189,20 @@ class InfoAction extends FormlessAction { $this->msg( 'pageinfo-display-title' ), $displayTitle ); + // Is it a redirect? If so, where to? + if ( $title->isRedirect() ) { + $pageInfo['header-basic'][] = array( + $this->msg( 'pageinfo-redirectsto' ), + Linker::link( $this->page->getRedirectTarget() ) . ' ' . + $this->msg( 'parentheses', Linker::link( + $this->page->getRedirectTarget(), + $this->msg( 'pageinfo-redirectsto-info' ), + array(), + array( 'action' => 'info' ) + ) )->text() + ); + } + // Default sort key $sortKey = $title->getCategorySortKey(); if ( !empty( $pageProperties['defaultsort'] ) ) { @@ -244,6 +258,14 @@ class InfoAction extends FormlessAction { ->numParams( count( $title->getRedirectsHere() ) ) ); + // Is it counted as a content page? + if ( $this->page->isCountable() ) { + $pageInfo['header-basic'][] = array( + $this->msg( 'pageinfo-contentpage' ), + $this->msg( 'pageinfo-contentpage-yes' ) + ); + } + // Subpages of this page, if subpages are enabled for the current NS if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) { $prefixIndex = SpecialPage::getTitleFor( 'Prefixindex', $title->getPrefixedText() . '/' ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index bcff6420b3..e0f2841172 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -3763,6 +3763,10 @@ This is probably caused by a link to a blacklisted external site.', 'pageinfo-templates' => 'Transcluded {{PLURAL:$1|template|templates}} ($1)', 'pageinfo-footer' => '-', # do not translate or duplicate this message to other languages 'pageinfo-toolboxlink' => 'Page information', +'pageinfo-redirectsto' => 'Redirects to', +'pageinfo-redirectsto-info' => 'info', +'pageinfo-contentpage' => 'Counted as a content page', +'pageinfo-contentpage-yes' => 'Yes', # Skin names 'skinname-standard' => 'Classic', # only translate this message to other languages if you have to change it diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 95f1083a21..8730a4feee 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -3507,6 +3507,10 @@ See also {{msg-mw|Anonuser}} and {{msg-mw|Siteusers}}.', 'pageinfo-templates' => 'The list of templates transcluded within the page. Parameters: * $1 is the number of templates transcluded within the page.', 'pageinfo-toolboxlink' => "Information link for the page (like 'What links here', but to action=info for the current page instead)", +'pageinfo-redirectsto' => 'Key for the row shown if this page is a redirect.', +'pageinfo-redirectsto-info' => 'Text to put in parentheses for the link to the action=info of the redirect target.', +'pageinfo-contentpage' => 'Key for the row shown if this page is counted as a content page', +'pageinfo-contentpage-yes' => 'Yes, this page is a content page', # Skin names 'skinname-standard' => '{{optional}} diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 4d2542f9dc..f22cbea0fd 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2693,6 +2693,10 @@ $wgMessageStructure = array( 'pageinfo-templates', 'pageinfo-footer', 'pageinfo-toolboxlink', + 'pageinfo-redirectsto', + 'pageinfo-redirectsto-info', + 'pageinfo-contentpage', + 'pageinfo-contentpage-yes', ), 'skin' => array( 'skinname-standard', -- 2.20.1