From 4737e60075e7cc7315254ff27b9ed980bd567cb0 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 1 Jun 2004 03:41:00 +0000 Subject: [PATCH] Include undelete link in Monobook skin --- includes/Skin.php | 24 +++++++++++++++++------- includes/SkinPHPTal.php | 7 +++++++ templates/xhtml_slim.pt | 1 + 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index be19c19a96..095c10f98a 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -496,17 +496,27 @@ class Skin { $s.=" | ". wfMsg( "newmessages", $tl ) . ""; } } - if( $wgUser->isSysop() && - (($wgTitle->getArticleId() == 0) || ($action == "history")) && - ($n = $wgTitle->isDeleted() ) ) { - $s .= " | " . wfMsg( "thisisdeleted", - $this->makeKnownLink( - $wgLang->SpecialPage( "Undelete/" . $wgTitle->getPrefixedDBkey() ), - wfMsg( "restorelink", $n ) ) ); + + $undelete = $this->getUndeleteLink(); + if( !empty( $undelete ) ) { + $s .= " | $undelete"; } return $s; } + function getUndeleteLink() { + global $wgUser, $wgTitle, $wgLang, $action; + if( $wgUser->isSysop() && + (($wgTitle->getArticleId() == 0) || ($action == "history")) && + ($n = $wgTitle->isDeleted() ) ) { + return wfMsg( "thisisdeleted", + $this->makeKnownLink( + $wgLang->SpecialPage( "Undelete/" . $wgTitle->getPrefixedDBkey() ), + wfMsg( "restorelink", $n ) ) ); + } + return ""; + } + function printableLink() { global $wgOut, $wgFeedClasses, $wgRequest; diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index 3ce8d22201..b28a74412c 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -97,6 +97,13 @@ ''.$subpagestr.''.$out->getSubtitle(): $out->getSubtitle() ); + $undelete = $this->getUndeleteLink(); + $tpl->set( + "undelete", !empty($undelete)? + ''.$undelete.'': + '' + ); + $tpl->set( 'catlinks', $this->getCategories()); if( $wgOut->isSyndicated() ) { $feeds = array(); diff --git a/templates/xhtml_slim.pt b/templates/xhtml_slim.pt index 6062192198..293002b65d 100644 --- a/templates/xhtml_slim.pt +++ b/templates/xhtml_slim.pt @@ -29,6 +29,7 @@

From Wikipedia, the free encyclopedia.

+
-- 2.20.1