undelete action
authorGabriel Wicke <gwicke@users.mediawiki.org>
Tue, 20 Apr 2004 10:52:56 +0000 (10:52 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Tue, 20 Apr 2004 10:52:56 +0000 (10:52 +0000)
includes/SkinPHPTal.php

index 12c4140..f5774b8 100644 (file)
 
                                        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()) {
 
                                                }
                                        }
+                               } 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' ) {