* (bug 6997) Link from Special:log/block to unblock form
authorRaimond Spekking <raymond@users.mediawiki.org>
Fri, 9 Mar 2007 15:43:42 +0000 (15:43 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Fri, 9 Mar 2007 15:43:42 +0000 (15:43 +0000)
* (bug 9117) Link from Special:log/delete to undelete form
  based on a patch from Sui Min
* Link from Special:log/protect to change protection form

RELEASE-NOTES
includes/SpecialLog.php
languages/messages/MessagesDe.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index efcf993..151c578 100644 (file)
@@ -256,7 +256,9 @@ lighter making things easier to read.
 * (bug 1723) Article size in history
 * (bug 9223) Disallow magic tilde sequences in page titles and usernames
 * dumpBackup / importDump now work with PostgreSQL
-
+* (bug 6997) Link from Special:log/block to unblock form
+* (bug 9117) Link from Special:log/delete to undelete form
+* Link from Special:log/protect to change protection form
 
 == Languages updated ==
 
index 8fd8d2c..c1b103d 100644 (file)
@@ -298,7 +298,8 @@ class LogViewer {
         * @private
         */
        function logLine( $s ) {
-               global $wgLang;
+               global $wgLang, $wgUser;;
+               $skin = $wgUser->getSkin();
                $title = Title::makeTitle( $s->log_namespace, $s->log_title );
                $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $s->log_timestamp), true );
 
@@ -315,16 +316,33 @@ class LogViewer {
                $comment = $this->skin->commentBlock( $s->log_comment );
                $paramArray = LogPage::extractParams( $s->log_params );
                $revert = '';
+               // show revertmove link
                if ( $s->log_type == 'move' && isset( $paramArray[0] ) ) {
-                       $specialTitle = SpecialPage::getTitleFor( 'Movepage' );
                        $destTitle = Title::newFromText( $paramArray[0] );
                        if ( $destTitle ) {
-                               $revert = '(' . $this->skin->makeKnownLinkObj( $specialTitle, wfMsg( 'revertmove' ),
+                               $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
+                                       wfMsg( 'revertmove' ),
                                        'wpOldTitle=' . urlencode( $destTitle->getPrefixedDBkey() ) .
                                        '&wpNewTitle=' . urlencode( $title->getPrefixedDBkey() ) .
                                        '&wpReason=' . urlencode( wfMsgForContent( 'revertmove' ) ) .
                                        '&wpMovetalk=0' ) . ')';
                        }
+               // show undelete link
+               } elseif ( $s->log_action == 'delete' && $wgUser->isAllowed( 'delete' ) ) {
+                       $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Undelete' ),
+                               wfMsg( 'undeletebtn' ) ,
+                               'target='. urlencode( $title->getPrefixedDBkey() ) ) . ')';
+               
+               // show unblock link
+               } elseif ( $s->log_action == 'block' && $wgUser->isAllowed( 'block' ) ) {
+                       $revert = '(' .  $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Ipblocklist' ),
+                               wfMsg( 'unblocklink' ),
+                               'action=unblock&ip=' . urlencode( $s->log_title ) ) . ')';
+               // show change protection link
+               } elseif ( $s->log_action == 'protect' && $wgUser->isAllowed( 'protect' ) ) {
+                       $revert = '(' .  $skin->makeKnownLink( $title->getPrefixedDBkey() ,
+                               wfMsg( 'protect_change' ),
+                               'action=unprotect' ) . ')';
                }
 
                $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true, true );
index b8a05c7..c9c7a16 100644 (file)
@@ -296,6 +296,7 @@ $messages = array(
 'deletethispage'    => 'Diese Seite löschen',
 'undelete_short'    => '{{PLURAL:$1|1 Version|$1 Versionen}} wiederherstellen',
 'protect'           => 'schützen',
+'protect_change'    => 'Schutz ändern',
 'protectthispage'   => 'Seite schützen',
 'unprotect'         => 'freigeben',
 'unprotectthispage' => 'Schutz aufheben',
@@ -1373,7 +1374,7 @@ Bitte gehen Sie zurück und versuchen den Vorgang erneut auszuführen.',
 
 # Undelete
 'undelete'                 => 'Gelöschte Seite wiederherstellen',
-'undeletepage'             => 'Gelöschte Seiten wiederherstellen',
+'undeletepage'             => 'Gelöschte Seite wiederherstellen',
 'viewdeletedpage'          => 'Gelöschte Seiten anzeigen',
 'undeletepagetext'         => 'Die folgenden Seiten wurden gelöscht und können von Administratoren wiederhergestellt werden:',
 'undeleteextrahelp'        => '* Um die Seite komplett mit allen Versionen wiederherzustellen, geben Sie bitte eine Begründung an und klicken auf „Wiederherstellen“.
index 3df62c6..228024e 100644 (file)
@@ -633,6 +633,7 @@ parent class in order maintain consistency across languages.
 'deletethispage' => 'Delete this page',
 'undelete_short' => 'Undelete {{PLURAL:$1|one edit|$1 edits}}',
 'protect' => 'Protect',
+'protect_change' => 'change protection',
 'protectthispage' => 'Protect this page',
 'unprotect' => 'unprotect',
 'unprotectthispage' => 'Unprotect this page',
index 8df952e..4d9e392 100644 (file)
@@ -167,6 +167,7 @@ $wgMessageStructure = array(
                'deletethispage',
                'undelete_short',
                'protect',
+               'protect_change',
                'protectthispage',
                'unprotect',
                'unprotectthispage',