From: Alex Monk Date: Mon, 10 Sep 2012 23:45:12 +0000 (+0100) Subject: (bug 16362) Add action=info link to toolbox. X-Git-Tag: 1.31.0-rc.0~22170^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%2C%22id_auteur=%24connecte%22%29%20.%20%22?a=commitdiff_plain;h=8da6b425ee5fecff64a0c0a83d82a79f4470e5e2;p=lhc%2Fweb%2Fwiklou.git (bug 16362) Add action=info link to toolbox. MZMcBride asked me to split this away from https://gerrit.wikimedia.org/r/#/c/22547 Change-Id: I392d823e02a26e45134a175fc215b658a90ebb41 --- diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index d574562b72..803876deb7 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -1137,6 +1137,7 @@ class SkinTemplate extends Skin { $nav_urls['print'] = false; $nav_urls['permalink'] = false; + $nav_urls['info'] = false; $nav_urls['whatlinkshere'] = false; $nav_urls['recentchangeslinked'] = false; $nav_urls['contributions'] = false; @@ -1164,6 +1165,11 @@ class SkinTemplate extends Skin { ); } + $nav_urls['info'] = array( + 'text' => $this->msg( 'pageinfo-toolboxlink' )->text(), + 'href' => $out->getTitle()->getLocalURL( "action=info" ) + ); + // Use the copy of revision ID in case this undocumented, shady hook tries to mess with internals wfRunHooks( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink', array( &$this, &$nav_urls, &$revid, &$revid ) ); @@ -1424,6 +1430,10 @@ abstract class BaseTemplate extends QuickTemplate { $toolbox['permalink']['id'] = 't-permalink'; } } + if ( isset( $this->data['nav_urls']['info'] ) && $this->data['nav_urls']['info'] ) { + $toolbox['info'] = $this->data['nav_urls']['info']; + } + wfRunHooks( 'BaseTemplateToolbox', array( &$this, &$toolbox ) ); wfProfileOut( __METHOD__ ); return $toolbox; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 097199b293..c72eb1c426 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -3767,6 +3767,7 @@ This is probably caused by a link to a blacklisted external site.', 'pageinfo-hidden-categories' => 'Hidden {{PLURAL:$1|category|categories}} ($1)', 'pageinfo-templates' => 'Transcluded {{PLURAL:$1|template|templates}} ($1)', 'pageinfo-footer' => '-', # do not translate or duplicate this message to other languages +'pageinfo-toolboxlink' => 'Page information', # 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 d20b731cd1..845d4f8762 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -3507,6 +3507,7 @@ See also {{msg-mw|Anonuser}} and {{msg-mw|Siteusers}}.', * $1 is the number of hidden categories on the page.', '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)', # Skin names 'skinname-standard' => '{{optional}} diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index b644d8e6f0..27a3d9f677 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2696,6 +2696,7 @@ $wgMessageStructure = array( 'pageinfo-hidden-categories', 'pageinfo-templates', 'pageinfo-footer', + 'pageinfo-toolboxlink', ), 'skin' => array( 'skinname-standard',