Merge "(bug 16362) Add action=info link to toolbox."
authorReedy <reedy@wikimedia.org>
Thu, 4 Oct 2012 15:10:03 +0000 (15:10 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 4 Oct 2012 15:10:03 +0000 (15:10 +0000)
includes/SkinTemplate.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index b4da525..457e35e 100644 (file)
@@ -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;
index 132161c..0f2e520 100644 (file)
@@ -3763,6 +3763,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
index 6977d5f..95a8051 100644 (file)
@@ -3506,6 +3506,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}}
index e12b26b..3cc394b 100644 (file)
@@ -2693,6 +2693,7 @@ $wgMessageStructure = array(
                'pageinfo-hidden-categories',
                'pageinfo-templates',
                'pageinfo-footer',
+               'pageinfo-toolboxlink',
        ),
        'skin' => array(
                'skinname-standard',