r20293 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20292‎ | r20293 | r20294 >
Date:15:43, 9 March 2007
Author:raymond
Status:old
Tags:
Comment:
* (bug 6997) Link from Special:log/block to unblock form
* (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
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialLog.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -167,6 +167,7 @@
168168 'deletethispage',
169169 'undelete_short',
170170 'protect',
 171+ 'protect_change',
171172 'protectthispage',
172173 'unprotect',
173174 'unprotectthispage',
Index: trunk/phase3/includes/SpecialLog.php
@@ -298,7 +298,8 @@
299299 * @private
300300 */
301301 function logLine( $s ) {
302 - global $wgLang;
 302+ global $wgLang, $wgUser;;
 303+ $skin = $wgUser->getSkin();
303304 $title = Title::makeTitle( $s->log_namespace, $s->log_title );
304305 $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $s->log_timestamp), true );
305306
@@ -315,16 +316,33 @@
316317 $comment = $this->skin->commentBlock( $s->log_comment );
317318 $paramArray = LogPage::extractParams( $s->log_params );
318319 $revert = '';
 320+ // show revertmove link
319321 if ( $s->log_type == 'move' && isset( $paramArray[0] ) ) {
320 - $specialTitle = SpecialPage::getTitleFor( 'Movepage' );
321322 $destTitle = Title::newFromText( $paramArray[0] );
322323 if ( $destTitle ) {
323 - $revert = '(' . $this->skin->makeKnownLinkObj( $specialTitle, wfMsg( 'revertmove' ),
 324+ $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
 325+ wfMsg( 'revertmove' ),
324326 'wpOldTitle=' . urlencode( $destTitle->getPrefixedDBkey() ) .
325327 '&wpNewTitle=' . urlencode( $title->getPrefixedDBkey() ) .
326328 '&wpReason=' . urlencode( wfMsgForContent( 'revertmove' ) ) .
327329 '&wpMovetalk=0' ) . ')';
328330 }
 331+ // show undelete link
 332+ } elseif ( $s->log_action == 'delete' && $wgUser->isAllowed( 'delete' ) ) {
 333+ $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Undelete' ),
 334+ wfMsg( 'undeletebtn' ) ,
 335+ 'target='. urlencode( $title->getPrefixedDBkey() ) ) . ')';
 336+
 337+ // show unblock link
 338+ } elseif ( $s->log_action == 'block' && $wgUser->isAllowed( 'block' ) ) {
 339+ $revert = '(' . $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Ipblocklist' ),
 340+ wfMsg( 'unblocklink' ),
 341+ 'action=unblock&ip=' . urlencode( $s->log_title ) ) . ')';
 342+ // show change protection link
 343+ } elseif ( $s->log_action == 'protect' && $wgUser->isAllowed( 'protect' ) ) {
 344+ $revert = '(' . $skin->makeKnownLink( $title->getPrefixedDBkey() ,
 345+ wfMsg( 'protect_change' ),
 346+ 'action=unprotect' ) . ')';
329347 }
330348
331349 $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true, true );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -633,6 +633,7 @@
634634 'deletethispage' => 'Delete this page',
635635 'undelete_short' => 'Undelete {{PLURAL:$1|one edit|$1 edits}}',
636636 'protect' => 'Protect',
 637+'protect_change' => 'change protection',
637638 'protectthispage' => 'Protect this page',
638639 'unprotect' => 'unprotect',
639640 'unprotectthispage' => 'Unprotect this page',
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -296,6 +296,7 @@
297297 'deletethispage' => 'Diese Seite löschen',
298298 'undelete_short' => '{{PLURAL:$1|1 Version|$1 Versionen}} wiederherstellen',
299299 'protect' => 'schützen',
 300+'protect_change' => 'Schutz ändern',
300301 'protectthispage' => 'Seite schützen',
301302 'unprotect' => 'freigeben',
302303 'unprotectthispage' => 'Schutz aufheben',
@@ -1373,7 +1374,7 @@
13741375
13751376 # Undelete
13761377 'undelete' => 'Gelöschte Seite wiederherstellen',
1377 -'undeletepage' => 'Gelöschte Seiten wiederherstellen',
 1378+'undeletepage' => 'Gelöschte Seite wiederherstellen',
13781379 'viewdeletedpage' => 'Gelöschte Seiten anzeigen',
13791380 'undeletepagetext' => 'Die folgenden Seiten wurden gelöscht und können von Administratoren wiederhergestellt werden:',
13801381 'undeleteextrahelp' => '* Um die Seite komplett mit allen Versionen wiederherzustellen, geben Sie bitte eine Begründung an und klicken auf „Wiederherstellen“.
Index: trunk/phase3/RELEASE-NOTES
@@ -256,8 +256,10 @@
257257 * (bug 1723) Article size in history
258258 * (bug 9223) Disallow magic tilde sequences in page titles and usernames
259259 * dumpBackup / importDump now work with PostgreSQL
 260+* (bug 6997) Link from Special:log/block to unblock form
 261+* (bug 9117) Link from Special:log/delete to undelete form
 262+* Link from Special:log/protect to change protection form
260263
261 -
262264 == Languages updated ==
263265
264266 * Arabic (ar)