r112612 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112611‎ | r112612 | r112613 >
Date:17:05, 28 February 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r112609;
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.php (modified) (history)
  • /trunk/extensions/EducationProgram/actions/EPRestoreAction.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPRevisions.php (modified) (history)
  • /trunk/extensions/EducationProgram/pages/EPPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/EducationProgram.php
@@ -70,6 +70,7 @@
7171 $wgAutoloadClasses['EPRemoveReviewerAction'] = dirname( __FILE__ ) . '/actions/EPRemoveReviewerAction.php';
7272 $wgAutoloadClasses['EPRemoveStudentAction'] = dirname( __FILE__ ) . '/actions/EPRemoveStudentAction.php';
7373 $wgAutoloadClasses['EPRestoreAction'] = dirname( __FILE__ ) . '/actions/EPRestoreAction.php';
 74+$wgAutoloadClasses['EPUndeleteAction'] = dirname( __FILE__ ) . '/actions/EPUndeleteAction.php';
7475 $wgAutoloadClasses['EPUndoAction'] = dirname( __FILE__ ) . '/actions/EPUndoAction.php';
7576 $wgAutoloadClasses['EPViewAction'] = dirname( __FILE__ ) . '/actions/EPViewAction.php';
7677 $wgAutoloadClasses['ViewCourseAction'] = dirname( __FILE__ ) . '/actions/ViewCourseAction.php';
Index: trunk/extensions/EducationProgram/pages/EPPage.php
@@ -169,9 +169,27 @@
170170 return static::$info['log-type'];
171171 }
172172
 173+ // TODO
173174 public static function displayDeletionLog( IContextSource $context, $messageKey ) {
174175 $out = $context->getOutput();
175176
 177+ if ( true ) { // $context->getUser()->isAllowed( '' )
 178+ $revisionCount = EPRevisions::singleton()->count( array(
 179+ 'object_identifier' => $context->getTitle()->getText()
 180+ ) );
 181+
 182+ if ( $revisionCount > 0 ) {
 183+ $out->addHTML( $context->msg( 'thisisdeleted' )->rawParams(
 184+ Linker::linkKnown(
 185+ $context->getTitle(),
 186+ $context->msg( 'restorelink' )->numParams( $revisionCount )->escaped(),
 187+ array(),
 188+ array( 'action' => 'epundelete' )
 189+ )
 190+ )->text() );
 191+ }
 192+ }
 193+
176194 LogEventsList::showLogExtract(
177195 $out,
178196 array( static::$info['log-type'] ),
Index: trunk/extensions/EducationProgram/actions/EPRestoreAction.php
@@ -102,6 +102,7 @@
103103
104104 if ( $success ) {
105105 // TODO: log
 106+ // Already logged - just alter message?
106107 }
107108 }
108109
Index: trunk/extensions/EducationProgram/includes/EPRevisions.php
@@ -99,4 +99,24 @@
100100 return new EPRevision( $this, $fields );
101101 }
102102
 103+ /**
 104+ * Returns the most recent revision matching the provided conditions.
 105+ *
 106+ * @since 0.1
 107+ *
 108+ * @param array $conds
 109+ *
 110+ * @return EPRevision|false
 111+ */
 112+ public function getLatestRevision( array $conds ) {
 113+ return $this->selectRow(
 114+ null,
 115+ $conds,
 116+ array(
 117+ 'SORT BY' => $this->getPrefixedField( 'id' ),
 118+ 'ORDER' => 'DESC',
 119+ )
 120+ );
 121+ }
 122+
103123 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112609initial work on undeletion actionjeroendedauw16:14, 28 February 2012

Status & tagging log