RevisionDeleter Class Reference
[SpecialPage]

Implements the actions for Revision Deletion. More...

List of all members.

Public Member Functions

 __construct ($db)
 setRevVisibility ($title, $items, $bitfield, $comment)
 setArchiveVisibility ($title, $items, $bitfield, $comment)
 setOldImgVisibility ($title, $items, $bitfield, $comment)
 setArchFileVisibility ($title, $items, $bitfield, $comment)
 setEventVisibility ($title, $items, $bitfield, $comment)
 makeOldImagePrivate ($oimage)
 Moves an image to a safe private location Caller is responsible for clearing caches.
 makeOldImagePublic ($oimage)
 Moves an image from a safe private location Caller is responsible for clearing caches.
 updateRevision ($rev, $bitfield)
 Update the revision's rev_deleted field.
 updateArchive ($rev, $title, $bitfield)
 Update the revision's rev_deleted field.
 updateOldFiles ($file, $bitfield)
 Update the images's oi_deleted field.
 updateArchFiles ($file, $bitfield)
 Update the images's fa_deleted field.
 updateLogs ($row, $bitfield)
 Update the logging log_deleted field.
 updateRecentChangesEdits ($rev, $bitfield)
 Update the revision's recentchanges record if fields have been hidden.
 updateRecentChangesLog ($row, $bitfield)
 Update the revision's recentchanges record if fields have been hidden.
 updatePage ($title)
 Touch the page's cache invalidation timestamp; this forces cached history views to refresh, so any newly hidden or shown fields will update properly.
 checkItem ($desc, $field, $diff, $new, &$arr)
 Checks for a change in the bitfield for a certain option and updates the provided array accordingly.
 getChanges ($n, $o)
 Gets an array describing the changes made to the visibilit of the revision.
 getLogMessage ($count, $nbitfield, $obitfield, $comment, $isForLog=false)
 Gets a log message to describe the given revision visibility change.
 updateLog ($title, $count, $nbitfield, $obitfield, $comment, $target, $param, $items=array())
 Record a log entry on the action.


Detailed Description

Implements the actions for Revision Deletion.

Definition at line 835 of file SpecialRevisiondelete.php.


Constructor & Destructor Documentation

RevisionDeleter::__construct ( db  ) 

Definition at line 836 of file SpecialRevisiondelete.php.

References $db.


Member Function Documentation

RevisionDeleter::checkItem ( desc,
field,
diff,
new,
&$  arr 
)

Checks for a change in the bitfield for a certain option and updates the provided array accordingly.

Parameters:
String $desc Description to add to the array if the option was enabled / disabled.
int $field The bitmask describing the single option.
int $diff The xor of the old and new bitfields.
array $arr The array to update.

Definition at line 1404 of file SpecialRevisiondelete.php.

Referenced by getChanges().

RevisionDeleter::getChanges ( n,
o 
)

Gets an array describing the changes made to the visibilit of the revision.

If the resulting array is $arr, then $arr[0] will contain an array of strings describing the items that were hidden, $arr[2] will contain an array of strings describing the items that were unhidden, and $arr[3] will contain an array with a single string, which can be one of "applied restrictions to sysops", "removed restrictions from sysops", or null.

Parameters:
int $n The new bitfield.
int $o The old bitfield.
Returns:
An array as described above.

Definition at line 1422 of file SpecialRevisiondelete.php.

References $n, checkItem(), Revision::DELETED_COMMENT, Revision::DELETED_RESTRICTED, Revision::DELETED_TEXT, Revision::DELETED_USER, and wfMsgForContent().

Referenced by getLogMessage().

RevisionDeleter::getLogMessage ( count,
nbitfield,
obitfield,
comment,
isForLog = false 
)

Gets a log message to describe the given revision visibility change.

This message will be of the form "[hid {content, edit summary, username}]; [unhid {...}][applied restrictions to sysops] for $count revisions: $comment".

Parameters:
int $count The number of effected revisions.
int $nbitfield The new bitfield for the revision.
int $obitfield The old bitfield for the revision.
string $comment The comment associated with the change.
bool $isForLog

Definition at line 1455 of file SpecialRevisiondelete.php.

References $count, $msg, $s, $wgContLang, getChanges(), wfMsgExt(), and wfMsgForContent().

Referenced by updateLog().

RevisionDeleter::makeOldImagePrivate ( oimage  ) 

Moves an image to a safe private location Caller is responsible for clearing caches.

Parameters:
File $oimage
Returns:
mixed, timestamp string on success, false on failure

Definition at line 1183 of file SpecialRevisiondelete.php.

References $key, FileStore::DELETE_ORIGINAL, FileStore::get(), FileStore::lock(), FileStore::unlock(), and wfDebug().

Referenced by setOldImgVisibility().

RevisionDeleter::makeOldImagePublic ( oimage  ) 

Moves an image from a safe private location Caller is responsible for clearing caches.

Parameters:
File $oimage
Returns:
mixed, string timestamp on success, false on failure

Definition at line 1234 of file SpecialRevisiondelete.php.

References $flags, $key, FileStore::DELETE_ORIGINAL, File::DELETED_FILE, FileStore::get(), FileStore::lock(), FileStore::unlock(), wfDebug(), and wfMkdirParents().

Referenced by setOldImgVisibility().

RevisionDeleter::setArchFileVisibility ( title,
items,
bitfield,
comment 
)

Parameters:
$title,the page these events apply to
array $items list of revision ID numbers
int $bitfield new rev_deleted value
string $comment Comment for log records

Definition at line 1068 of file SpecialRevisiondelete.php.

References $count, $result, $row, $success, $title, $wgOut, File::DELETED_RESTRICTED, ArchivedFile::newFromRow(), updateArchFiles(), and updateLog().

RevisionDeleter::setArchiveVisibility ( title,
items,
bitfield,
comment 
)

Parameters:
$title,the page these events apply to
array $items list of revision ID numbers
int $bitfield new rev_deleted value
string $comment Comment for log records

Definition at line 905 of file SpecialRevisiondelete.php.

References $count, $result, $row, $success, $title, $wgOut, Revision::DELETED_RESTRICTED, updateArchive(), updateLog(), and wfTimestamp().

RevisionDeleter::setEventVisibility ( title,
items,
bitfield,
comment 
)

Parameters:
$title,the log page these events apply to
array $items list of log ID numbers
int $bitfield new log_deleted value
string $comment Comment for log records

Definition at line 1123 of file SpecialRevisiondelete.php.

References $count, $result, $row, $success, $title, $wgOut, LogPage::DELETED_RESTRICTED, updateLog(), updateLogs(), updateRecentChangesLog(), and LogEventsList::userCan().

RevisionDeleter::setOldImgVisibility ( title,
items,
bitfield,
comment 
)

Parameters:
$title,the page these events apply to
array $items list of revision ID numbers
int $bitfield new rev_deleted value
string $comment Comment for log records

Definition at line 976 of file SpecialRevisiondelete.php.

References $count, $file, $result, $row, $success, $title, $wgOut, File::DELETED_FILE, File::DELETED_RESTRICTED, makeOldImagePrivate(), makeOldImagePublic(), RepoGroup::singleton(), updateLog(), updateOldFiles(), and wfLocalFile().

RevisionDeleter::setRevVisibility ( title,
items,
bitfield,
comment 
)

Parameters:
$title,the page these events apply to
array $items list of revision ID numbers
int $bitfield new rev_deleted value
string $comment Comment for log records

Definition at line 846 of file SpecialRevisiondelete.php.

References $result, $row, $success, $title, $wgOut, Revision::DELETED_RESTRICTED, updateLog(), updatePage(), updateRecentChangesEdits(), and updateRevision().

RevisionDeleter::updateArchFiles ( file,
bitfield 
)

Update the images's fa_deleted field.

Parameters:
ArchivedFile $file
int $bitfield new rev_deleted bitfield value

Definition at line 1333 of file SpecialRevisiondelete.php.

References $file.

Referenced by setArchFileVisibility().

RevisionDeleter::updateArchive ( rev,
title,
bitfield 
)

Update the revision's rev_deleted field.

Parameters:
Revision $rev
Title $title
int $bitfield new rev_deleted bitfield value

Definition at line 1305 of file SpecialRevisiondelete.php.

References $title.

Referenced by setArchiveVisibility().

RevisionDeleter::updateLog ( title,
count,
nbitfield,
obitfield,
comment,
target,
param,
items = array() 
)

Record a log entry on the action.

Parameters:
Title $title, page where item was removed from
int $count the number of revisions altered for this page
int $nbitfield the new _deleted value
int $obitfield the old _deleted value
string $comment
Title $target, the relevant page
string $param, URL param
Array $items

Definition at line 1500 of file SpecialRevisiondelete.php.

References $count, $reason, $title, Revision::DELETED_RESTRICTED, and getLogMessage().

Referenced by setArchFileVisibility(), setArchiveVisibility(), setEventVisibility(), setOldImgVisibility(), and setRevVisibility().

RevisionDeleter::updateLogs ( row,
bitfield 
)

Update the logging log_deleted field.

Parameters:
Row $row
int $bitfield new rev_deleted bitfield value

Definition at line 1345 of file SpecialRevisiondelete.php.

References $row.

Referenced by setEventVisibility().

RevisionDeleter::updateOldFiles ( file,
bitfield 
)

Update the images's oi_deleted field.

Parameters:
File $file
int $bitfield new rev_deleted bitfield value

Definition at line 1320 of file SpecialRevisiondelete.php.

References $file.

Referenced by setOldImgVisibility().

RevisionDeleter::updatePage ( title  ) 

Touch the page's cache invalidation timestamp; this forces cached history views to refresh, so any newly hidden or shown fields will update properly.

Parameters:
Title $title

Definition at line 1386 of file SpecialRevisiondelete.php.

References $title, and wfRunHooks().

Referenced by setRevVisibility().

RevisionDeleter::updateRecentChangesEdits ( rev,
bitfield 
)

Update the revision's recentchanges record if fields have been hidden.

Parameters:
Revision $rev
int $bitfield new rev_deleted bitfield value

Definition at line 1357 of file SpecialRevisiondelete.php.

Referenced by setRevVisibility().

RevisionDeleter::updateRecentChangesLog ( row,
bitfield 
)

Update the revision's recentchanges record if fields have been hidden.

Parameters:
Row $row
int $bitfield new rev_deleted bitfield value

Definition at line 1371 of file SpecialRevisiondelete.php.

References $row.

Referenced by setEventVisibility().

RevisionDeleter::updateRevision ( rev,
bitfield 
)

Update the revision's rev_deleted field.

Parameters:
Revision $rev
int $bitfield new rev_deleted bitfield value

Definition at line 1291 of file SpecialRevisiondelete.php.

Referenced by setRevVisibility().


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:46 2009 for MediaWiki by  doxygen 1.5.9