MediaWiki
REL1_22
|
General controller for RevDel, used by both SpecialRevisiondelete and ApiRevisionDelete. More...
Static Public Member Functions | |
static | checkRevisionExistence ($title, $revid) |
Checks if a revision still exists in the revision table. | |
static | createList ($typeName, IContextSource $context, Title $title, array $ids) |
Instantiate the appropriate list class for a given list of IDs. | |
static | extractBitfield ($bitPars, $oldfield) |
Put together a rev_deleted bitfield. | |
static | getCanonicalTypeName ($typeName) |
Gets the canonical type name, if any. | |
static | getChanges ($n, $o) |
Gets an array of message keys describing the changes made to the visibility of the revision. | |
static | getRelationType ($typeName) |
Get DB field name for URL param... | |
static | getRestriction ($typeName) |
Get the user right required for the RevDel type. | |
static | getRevdelConstant ($typeName) |
Get the revision deletion constant for the RevDel type. | |
static | getTypes () |
Lists the valid possible types for revision deletion. | |
static | suggestTarget ($typeName, $target, array $ids) |
Suggest a target for the revision deletion. | |
Static Protected Member Functions | |
static | checkItem ($desc, $field, $diff, $new, &$arr) |
Checks for a change in the bitfield for a certain option and updates the provided array accordingly. | |
Static Private Attributes | |
static | $allowedTypes |
List of known revdel types, with their corresponding list classes. | |
static | $deprecatedTypeMap |
Type map to support old log entries. |
General controller for RevDel, used by both SpecialRevisiondelete and ApiRevisionDelete.
Definition at line 29 of file RevisionDeleter.php.
static RevisionDeleter::checkItem | ( | $ | desc, |
$ | field, | ||
$ | diff, | ||
$ | new, | ||
&$ | arr | ||
) | [static, protected] |
Checks for a change in the bitfield for a certain option and updates the provided array accordingly.
string | $desc | description to add to the array if the option was enabled / disabled. |
$field | Integer: the bitmask describing the single option. | |
$diff | Integer: the xor of the old and new bitfields. | |
$new | Integer: the new bitfield | |
array | $arr | the array to update. |
Definition at line 101 of file RevisionDeleter.php.
Referenced by getChanges().
static RevisionDeleter::checkRevisionExistence | ( | $ | title, |
$ | revid | ||
) | [static] |
Checks if a revision still exists in the revision table.
If it doesn't, returns the corresponding ar_timestamp field so that this key can be used instead.
$title | Title |
$revid |
Definition at line 214 of file RevisionDeleter.php.
References $dbr, $timestamp, $title, array(), and wfGetDB().
static RevisionDeleter::createList | ( | $ | typeName, |
IContextSource $ | context, | ||
Title $ | title, | ||
array $ | ids | ||
) | [static] |
Instantiate the appropriate list class for a given list of IDs.
string | $typeName | RevDel type, see RevisionDeleter::getTypes() |
IContextSource | $context | |
Title | $title | |
array | $ids |
Definition at line 82 of file RevisionDeleter.php.
References $title, and getCanonicalTypeName().
Referenced by SpecialRevisionDelete\getList().
static RevisionDeleter::extractBitfield | ( | $ | bitPars, |
$ | oldfield | ||
) | [static] |
Put together a rev_deleted bitfield.
array | $bitPars | extractBitParams() params |
int | $oldfield | current bitfield |
Definition at line 238 of file RevisionDeleter.php.
References as.
Referenced by RevDel_List\setVisibility().
static RevisionDeleter::getCanonicalTypeName | ( | $ | typeName | ) | [static] |
Gets the canonical type name, if any.
string | $typeName |
Definition at line 65 of file RevisionDeleter.php.
Referenced by createList(), SpecialRevisionDelete\execute(), getRelationType(), getRestriction(), getRevdelConstant(), and suggestTarget().
static RevisionDeleter::getChanges | ( | $ | n, |
$ | o | ||
) | [static] |
Gets an array of message keys describing the changes made to the visibility of the revision.
If the resulting array is $arr, then $arr[0] will contain an array of keys describing the items that were hidden, $arr[1] will contain an array of keys describing the items that were unhidden, and $arr[2] will contain an array with a single message key, which can be one of "revdelete-restricted", "revdelete-unrestricted" indicating (un)suppression or null to indicate nothing in particular. You can turn the keys in $arr[0] and $arr[1] into message keys by appending -hid and and -unhid to the keys respectively.
$n | Integer: the new bitfield. |
$o | Integer: the old bitfield. |
Definition at line 125 of file RevisionDeleter.php.
References $n, $ret, array(), checkItem(), Revision\DELETED_COMMENT, Revision\DELETED_RESTRICTED, Revision\DELETED_TEXT, and Revision\DELETED_USER.
Referenced by DeleteLogFormatter\getMessageParameters().
static RevisionDeleter::getRelationType | ( | $ | typeName | ) | [static] |
Get DB field name for URL param...
Future code for other things may also track other types of revision-specific changes.
string | $typeName |
Definition at line 152 of file RevisionDeleter.php.
References array(), and getCanonicalTypeName().
Referenced by PopulateLogSearch\doDBUpdates(), and SpecialRevisionDelete\getLogQueryCond().
static RevisionDeleter::getRestriction | ( | $ | typeName | ) | [static] |
Get the user right required for the RevDel type.
string | $typeName |
Definition at line 166 of file RevisionDeleter.php.
References array(), and getCanonicalTypeName().
Referenced by SpecialRevisionDelete\execute().
static RevisionDeleter::getRevdelConstant | ( | $ | typeName | ) | [static] |
Get the revision deletion constant for the RevDel type.
string | $typeName |
Definition at line 180 of file RevisionDeleter.php.
References array(), and getCanonicalTypeName().
Referenced by SpecialRevisionDelete\execute().
static RevisionDeleter::getTypes | ( | ) | [static] |
Lists the valid possible types for revision deletion.
Definition at line 54 of file RevisionDeleter.php.
static RevisionDeleter::suggestTarget | ( | $ | typeName, |
$ | target, | ||
array $ | ids | ||
) | [static] |
Suggest a target for the revision deletion.
string | $typeName | |
Title | null | $title | User-supplied target |
array | $ids |
Definition at line 196 of file RevisionDeleter.php.
References array(), and getCanonicalTypeName().
Referenced by SpecialRevisionDelete\execute().
RevisionDeleter::$allowedTypes [static, private] |
array( 'revision' => 'RevDel_RevisionList', 'archive' => 'RevDel_ArchiveList', 'oldimage' => 'RevDel_FileList', 'filearchive' => 'RevDel_ArchivedFileList', 'logging' => 'RevDel_LogList', )
List of known revdel types, with their corresponding list classes.
Definition at line 31 of file RevisionDeleter.php.
RevisionDeleter::$deprecatedTypeMap [static, private] |
array( 'oldid' => 'revision', 'artimestamp' => 'archive', 'oldimage' => 'oldimage', 'fileid' => 'filearchive', 'logid' => 'logging', )
Type map to support old log entries.
Definition at line 40 of file RevisionDeleter.php.