(bug 16362) Add action=info link to toolbox.
authorAlex Monk <krenair@gmail.com>
Mon, 10 Sep 2012 23:45:12 +0000 (00:45 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 29 Sep 2012 00:14:49 +0000 (00:14 +0000)
MZMcBride asked me to split this away from https://gerrit.wikimedia.org/r/#/c/22547

Change-Id: I392d823e02a26e45134a175fc215b658a90ebb41

includes/SkinTemplate.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index d574562..803876d 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 097199b..c72eb1c 100644 (file)
@@ -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
index d20b731..845d4f8 100644 (file)
@@ -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}}
index b644d8e..27a3d9f 100644 (file)
@@ -2696,6 +2696,7 @@ $wgMessageStructure = array(
                'pageinfo-hidden-categories',
                'pageinfo-templates',
                'pageinfo-footer',
+               'pageinfo-toolboxlink',
        ),
        'skin' => array(
                'skinname-standard',