From 0b7738803bc50db3aa9301151757cc10f461b3a6 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Tue, 20 Apr 2004 10:52:56 +0000 Subject: [PATCH] undelete action --- includes/SkinPHPTal.php | 49 ++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index 12c4140d6a..f5774b8af3 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -297,24 +297,30 @@ if($wgUser->isSysop()){ if(!$wgTitle->isProtected()){ - $content_actions['protect'] = array('class' => ($action == 'protect') ? 'selected' : '', - 'text' => wfMsg('protect'), - 'href' => $this->makeUrl($this->thispage, 'action=protect'), - 'ttip' => wfMsg('tooltip-protect'), - 'akey' => wfMsg('accesskey-protect')); + $content_actions['protect'] = array( + 'class' => ($action == 'protect') ? 'selected' : '', + 'text' => wfMsg('protect'), + 'href' => $this->makeUrl($this->thispage, 'action=protect'), + 'ttip' => wfMsg('tooltip-protect'), + 'akey' => wfMsg('accesskey-protect') + ); } else { - $content_actions['unprotect'] = array('class' => ($action == 'unprotect') ? 'selected' : '', - 'text' => wfMsg('unprotect'), - 'href' => $this->makeUrl($this->thispage, 'action=unprotect'), - 'ttip' => wfMsg('tooltip-protect'), - 'akey' => wfMsg('accesskey-protect')); + $content_actions['unprotect'] = array( + 'class' => ($action == 'unprotect') ? 'selected' : '', + 'text' => wfMsg('unprotect'), + 'href' => $this->makeUrl($this->thispage, 'action=unprotect'), + 'ttip' => wfMsg('tooltip-protect'), + 'akey' => wfMsg('accesskey-protect') + ); } - $content_actions['delete'] = array('class' => ($action == 'delete') ? 'selected' : '', - 'text' => wfMsg('delete'), - 'href' => $this->makeUrl($this->thispage, 'action=delete'), - 'ttip' => wfMsg('tooltip-delete'), - 'akey' => wfMsg('accesskey-delete')); + $content_actions['delete'] = array( + 'class' => ($action == 'delete') ? 'selected' : '', + 'text' => wfMsg('delete'), + 'href' => $this->makeUrl($this->thispage, 'action=delete'), + 'ttip' => wfMsg('tooltip-delete'), + 'akey' => wfMsg('accesskey-delete') + ); } if ( $wgUser->getID() != 0 ) { if ( $wgTitle->userCanEdit()) { @@ -332,6 +338,19 @@ } } + } else { + //article doesn't exist or is deleted + if($wgUser->isSysop()){ + if( $n = $wgTitle->isDeleted() ) { + $content_actions['delete'] = array( + 'class' => '', + 'text' => wfMsg( "undelete_short", $n ), + 'href' => $this->makeSpecialUrl('Undelete/'.$this->thispage), + 'ttip' => wfMsg('tooltip-undelete', $n), + 'akey' => wfMsg('accesskey-undelete') + ); + } + } } if ( $wgUser->getID() != 0 and $action != 'edit' and $action != 'submit' ) { -- 2.20.1