return 'rev_id';
}
+ public static function getRestriction() {
+ return 'deleterevision';
+ }
+
+ public static function getRevdelConstant() {
+ return Revision::DELETED_TEXT;
+ }
+
+ public static function suggestTarget( $target, array $ids ) {
+ $rev = Revision::newFromId( $ids[0] );
+ return $rev ? $rev->getTitle() : $target;
+ }
+
/**
* @param $db DatabaseBase
* @return mixed
return 'oi_archive_name';
}
+ public static function getRestriction() {
+ return 'deleterevision';
+ }
+
+ public static function getRevdelConstant() {
+ return File::DELETED_FILE;
+ }
+
var $storeBatch, $deleteBatch, $cleanupBatch;
/**
}
public function doPostCommitUpdates() {
+ global $wgUseSquid;
$file = wfLocalFile( $this->title );
$file->purgeCache();
$file->purgeDescription();
+ $purgeUrls = array();
foreach ( $this->ids as $timestamp ) {
- $file->purgeOldThumbnails( $timestamp . '!' . $this->title->getDBkey() );
+ $archiveName = $timestamp . '!' . $this->title->getDBkey();
+ $file->purgeOldThumbnails( $archiveName );
+ $purgeUrls[] = $file->getArchiveUrl( $archiveName );
+ }
+ if ( $wgUseSquid ) {
+ // purge full images from cache
+ SquidUpdate::purge( $purgeUrls );
}
return Status::newGood();
}
*/
protected function getUserTools() {
if ( $this->file->userCan( Revision::DELETED_USER, $this->list->getUser() ) ) {
- $link = Linker::userLink( $this->file->user, $this->file->user_text ) .
- Linker::userToolLinks( $this->file->user, $this->file->user_text );
+ $uid = $this->file->getUser( 'id' );
+ $name = $this->file->getUser( 'text' );
+ $link = Linker::userLink( $uid, $name ) . Linker::userToolLinks( $uid, $name );
} else {
$link = $this->list->msg( 'rev-deleted-user' )->escaped();
}
*/
protected function getComment() {
if ( $this->file->userCan( File::DELETED_COMMENT, $this->list->getUser() ) ) {
- $block = Linker::commentBlock( $this->file->description );
+ $block = Linker::commentBlock( $this->file->getDescription() );
} else {
$block = ' ' . $this->list->msg( 'rev-deleted-comment' )->escaped();
}
return 'log_id';
}
+ public static function getRestriction() {
+ return 'deletelogentry';
+ }
+
+ public static function getRevdelConstant() {
+ return LogPage::DELETED_ACTION;
+ }
+
+ public static function suggestTarget( $target, array $ids ) {
+ $result = wfGetDB( DB_SLAVE )->select( 'logging',
+ 'log_type',
+ array( 'log_id' => $ids ),
+ __METHOD__,
+ array( 'DISTINCT' )
+ );
+ if ( $result->numRows() == 1 ) {
+ // If there's only one type, the target can be set to include it.
+ return SpecialPage::getTitleFor( 'Log', $result->current()->log_type );
+ }
+ return SpecialPage::getTitleFor( 'Log' );
+ }
+
/**
* @param $db DatabaseBase
* @return mixed