From bf0d92d5473b0ab6455b2a6ee60d0689726b0738 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 23 Aug 2005 17:25:22 +0000 Subject: [PATCH] permalink --- includes/SkinTemplate.php | 13 ++++++++++++- languages/Language.php | 1 + skins/MonoBook.php | 9 ++++++++- skins/monobook/main.css | 3 +++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 55edcd8aed..bed9e52bdc 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -733,7 +733,7 @@ class SkinTemplate extends Skin { * @access private */ function buildNavUrls () { - global $wgUseTrackbacks, $wgTitle; + global $wgUseTrackbacks, $wgTitle, $wgArticle; $fname = 'SkinTemplate::buildNavUrls'; wfProfileIn( $fname ); @@ -773,6 +773,17 @@ class SkinTemplate extends Skin { $nav_urls['print'] = array( 'text' => wfMsg( 'printableversion' ), 'href' => $wgRequest->appendQuery( 'printable=yes' ) ); + + // Also add a "permalink" while we're at it + if ( $wgRequest->getInt( 'oldid' ) ) { + $nav_urls['permalink'] = array( + 'text' => wfMsg( 'permalink' ), + 'href' => '' ); + } else { + $nav_urls['permalink'] = array( + 'text' => wfMsg( 'permalink' ), + 'href' => $wgTitle->getLocalURL( 'oldid=' . $wgArticle->getRevIdFetched() ) ); + } } if( $this->mTitle->getNamespace() != NS_SPECIAL) { diff --git a/languages/Language.php b/languages/Language.php index c88d0225d6..328f4cdaf0 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -406,6 +406,7 @@ and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide] f 'updatedmarker' => 'updated since my last visit', 'info_short' => 'Information', 'printableversion' => 'Printable version', +'permalink' => 'Permalink', 'print' => 'Print', 'edit' => 'Edit', 'editthispage' => 'Edit this page', diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 2556c4b0b1..f46a9b3e60 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -180,7 +180,14 @@ class MonoBookTemplate extends QuickTemplate {
  • msg('printableversion') ?>
  • - + + data['nav_urls']['permalink']['href'])) { ?> + + data['nav_urls']['permalink']['href'] === '') { ?> + + diff --git a/skins/monobook/main.css b/skins/monobook/main.css index fd94017a3f..3388d1aec1 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -873,6 +873,9 @@ li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print { z-index: 3; } +#t-ispermalink { + color: #999; +} /* ** footer */ -- 2.20.1