r113521 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113520‎ | r113521 | r113522 >
Date:20:49, 9 March 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r113520; similar handling on other places as well
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/actions/EPRestoreAction.php (modified) (history)
  • /trunk/extensions/EducationProgram/actions/EPUndeleteAction.php (modified) (history)
  • /trunk/extensions/EducationProgram/actions/EPUndoAction.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/actions/EPRestoreAction.php
@@ -72,13 +72,19 @@
7373
7474 if ( !is_null( $success ) ) {
7575 if ( $success ) {
76 - $query = array( 'restored' => '1' ); // TODO: handle
 76+ $this->getRequest()->setSessionData(
 77+ 'epsuccess',
 78+ $this->msg( $this->prefixMsg( 'restored' ), $this->getTitle()->getText() )->text()
 79+ );
7780 }
7881 else {
79 - $query = array( 'restorefailed' => '1' ); // TODO: handle
 82+ $this->getRequest()->setSessionData(
 83+ 'epfail',
 84+ $this->msg( $this->prefixMsg( 'restore-failed' ), $this->getTitle()->getText() )->text()
 85+ );
8086 }
8187
82 - $this->getOutput()->redirect( $object->getTitle()->getLocalURL( $query ) );
 88+ $this->getOutput()->redirect( $object->getTitle()->getLocalURL() );
8389 }
8490 }
8591
Index: trunk/extensions/EducationProgram/actions/EPUndeleteAction.php
@@ -54,8 +54,11 @@
5555 ) );
5656
5757 if ( $revision === false ) {
58 - $query = array( 'undeletefailed' => 'norevs' ); // TODO: handle
59 - $this->getOutput()->redirect( $this->getTitle()->getLocalURL( $query ) );
 58+ $this->getRequest()->setSessionData(
 59+ 'epfail',
 60+ $this->msg( $this->prefixMsg( 'failed-norevs' ), $this->getTitle()->getText() )->text()
 61+ );
 62+ $this->getOutput()->redirect( $this->getTitle()->getLocalURL() );
6063 }
6164 else {
6265 $req = $this->getRequest();
@@ -64,13 +67,19 @@
6568 $success = $this->doUndelete( $revision );
6669
6770 if ( $success ) {
68 - $query = array( 'undeleted' => '1' ); // TODO: handle
 71+ $this->getRequest()->setSessionData(
 72+ 'epsuccess',
 73+ $this->msg( $this->prefixMsg( 'undeleted' ), $this->getTitle()->getText() )->text()
 74+ );
6975 }
7076 else {
71 - $query = array( 'undeletefailed' => 'fail' ); // TODO: handle
 77+ $this->getRequest()->setSessionData(
 78+ 'epfail',
 79+ $this->msg( $this->prefixMsg( 'undelete-failed' ), $this->getTitle()->getText() )->text()
 80+ );
7281 }
7382
74 - $this->getOutput()->redirect( $this->getTitle()->getLocalURL( $query ) );
 83+ $this->getOutput()->redirect( $this->getTitle()->getLocalURL() );
7584 }
7685 else {
7786 $this->displayForm( $revision );
@@ -78,8 +87,11 @@
7988 }
8089 }
8190 else {
82 - $query = array( 'undeletefailed' => 'exists' ); // TODO: handle
83 - $this->getOutput()->redirect( $this->getTitle()->getLocalURL( $query ) );
 91+ $this->getRequest()->setSessionData(
 92+ 'epfail',
 93+ $this->msg( $this->prefixMsg( 'failed-exists' ), $this->getTitle()->getText() )->text()
 94+ );
 95+ $this->getOutput()->redirect( $this->getTitle()->getLocalURL() );
8496 }
8597
8698 return '';
Index: trunk/extensions/EducationProgram/actions/EPUndoAction.php
@@ -72,13 +72,19 @@
7373
7474 if ( !is_null( $success ) ) {
7575 if ( $success ) {
76 - $query = array( 'undid' => '1' ); // TODO: handle
 76+ $this->getRequest()->setSessionData(
 77+ 'epsuccess',
 78+ $this->msg( $this->prefixMsg( 'undid' ), $this->getTitle()->getText() )->text()
 79+ );
7780 }
7881 else {
79 - $query = array( 'undofailed' => '1' ); // TODO: handle
 82+ $this->getRequest()->setSessionData(
 83+ 'epfail',
 84+ $this->msg( $this->prefixMsg( 'undo-failed' ), $this->getTitle()->getText() )->text()
 85+ );
8086 }
8187
82 - $this->getOutput()->redirect( $object->getTitle()->getLocalURL( $query ) );
 88+ $this->getOutput()->redirect( $object->getTitle()->getLocalURL() );
8389 }
8490 }
8591
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -501,8 +501,8 @@
502502 'orgpage-delete-cancel-button' => 'Cancel',
503503 'orgpage-delete-delete-button' => 'Delete institution',
504504 'orgpage-delete-none' => 'There is no institution titled "$1". Existing institutions can be found in [[Special:Courses|the institution list]].',
505 - 'coursepage-delete-deleted' => 'Successfully deleted institution $1 and its associated courses.',
506 - 'coursepage-delete-delete-failed' => 'Failed to deleted institution [[Institution:$1|$1]].',
 505+ 'orgpage-delete-deleted' => 'Successfully deleted institution $1 and its associated courses.',
 506+ 'orgpage-delete-delete-failed' => 'Failed to deleted institution [[Institution:$1|$1]].',
507507
508508 // Institution restoration
509509 'orgpage-eprestore-title' => 'Restore institution "$1"',
@@ -511,6 +511,8 @@
512512 'orgpage-eprestore-restore-button' => 'Restore revision',
513513 'orgpage-eprestore-cancel-button' => 'Cancel',
514514 'orgpage-eprestore-summary-value' => 'Restore institution to the revision made on $1 by $2',
 515+ 'orgpage-eprestore-restored' => 'Successfully restored institution $1.',
 516+ 'orgpage-eprestore-restore-failed' => 'Failed to restore institution $1.',
515517
516518 // Course restoration
517519 'coursepage-eprestore-title' => 'Restore course "$1"',
@@ -519,6 +521,8 @@
520522 'coursepage-eprestore-restore-button' => 'Restore revision',
521523 'coursepage-eprestore-cancel-button' => 'Cancel',
522524 'coursepage-eprestore-summary-value' => 'Restore course to the revision made on $1 by $2',
 525+ 'coursepage-eprestore-restored' => 'Successfully restored course $1.',
 526+ 'coursepage-eprestore-restore-failed' => 'Failed to restore course $1.',
523527
524528 // Institution undo revision
525529 'orgpage-epundo-title' => 'Undo revision of institution "$1"',
@@ -527,6 +531,8 @@
528532 'orgpage-epundo-undo-button' => 'Undo revision',
529533 'orgpage-epundo-cancel-button' => 'Cancel',
530534 'orgpage-epundo-summary-value' => 'Undo revision made on $1 by $2',
 535+ 'orgpage-epundo-undid' => 'Successfully undid revision of institution $1.',
 536+ 'orgpage-epundo-undo-failed' => 'Failed to undo revision of institution $1.',
531537
532538 // Course undo revision
533539 'coursepage-epundo-title' => 'Undo revision of course "$1"',
@@ -535,6 +541,8 @@
536542 'coursepage-epundo-undo-button' => 'Undo revision',
537543 'coursepage-epundo-cancel-button' => 'Cancel',
538544 'coursepage-epundo-summary-value' => 'Undo revision made on $1 by $2',
 545+ 'coursepage-epundo-undid' => 'Successfully undid revision of course $1.',
 546+ 'coursepage-epundo-undo-failed' => 'Failed to undo revision of course $1.',
539547
540548 // Course undeletion
541549 'coursepage-epundelete-title' => 'Undelete course "$1"',
@@ -542,6 +550,10 @@
543551 'coursepage-epundelete-summary' => 'Reason for undeletion:',
544552 'coursepage-epundelete-undelete-button' => 'Undelete course',
545553 'coursepage-epundelete-cancel-button' => 'Cancel',
 554+ 'coursepage-epundelete-undid' => 'Successfully undeleted course $1.',
 555+ 'coursepage-epundelete-undo-failed' => 'Failed to undelete course $1.',
 556+ 'coursepage-epundelete-failed-norevs' => 'Failed to undelete course $1. It has no revisions to undelete.',
 557+ 'coursepage-epundelete-failed-exists' => 'Failed to undelete course $1. It already exists.',
546558
547559 // Institution undeletion
548560 'orgpage-epundelete-title' => 'Undelete institution "$1"',
@@ -549,6 +561,10 @@
550562 'orgpage-epundelete-summary' => 'Reason for undeletion:',
551563 'orgpage-epundelete-undelete-button' => 'Undelete institution',
552564 'orgpage-epundelete-cancel-button' => 'Cancel',
 565+ 'orgpage-epundelete-undid' => 'Successfully undeleted institution $1.',
 566+ 'orgpage-epundelete-undo-failed' => 'Failed to undelete institution $1.',
 567+ 'orgpage-epundelete-failed-norevs' => 'Failed to undelete institution $1. It has no revisions to undelete.',
 568+ 'orgpage-epundelete-failed-exists' => 'Failed to undelete institution $1. It already exists.',
553569
554570 // Special:Ambassador
555571 'ep-ambassador-does-not-exist' => 'There is no ambassador with name "$1". See [[Special:Ambassadors|here]] for a list of ambassadors.',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113520Follow up to r113507; finish up code I accidentally comited earlier onjeroendedauw20:38, 9 March 2012

Status & tagging log