MediaWiki
REL1_24
|
Class to simplify the use of log pages. More...
Public Member Functions | |
__construct ($type, $rc=true, $udp= 'skipUDP') | |
Constructor. | |
addEntry ($action, $target, $comment, $params=array(), $doer=null) | |
Add a log entry. | |
addRelations ($field, $values, $logid) | |
Add relations to log_search table. | |
getComment () | |
Get the comment from the last addEntry() call. | |
getDescription () | |
Description of this log type. | |
getName () | |
Name of the log. | |
getRcComment () | |
Get the RC comment from the last addEntry() call. | |
getRcCommentIRC () | |
Get the RC comment from the last addEntry() call for IRC. | |
getRestriction () | |
Returns the right needed to read this log type. | |
isRestricted () | |
Tells if this log is not viewable by all. | |
Static Public Member Functions | |
static | actionText ($type, $action, $title=null, $skin=null, $params=array(), $filterWikilinks=false) |
Generate text for a log entry. | |
static | extractParams ($blob) |
Extract a parameter array from a blob. | |
static | formatBlockFlag ($flag, $lang) |
Translate a block log flag if possible. | |
static | formatBlockFlags ($flags, $lang) |
Convert a comma-delimited list of block log flags into a more readable (and translated) form. | |
static | isLogType ($type) |
Is $type a valid log type. | |
static | logHeader ($type) |
Get the log header for the given log type. | |
static | logName ($type) |
Get the name for the given log type. | |
static | makeParamBlob ($params) |
Create a blob from a parameter array. | |
static | validTypes () |
Get the list of valid log types. | |
Public Attributes | |
bool | $sendToUDP |
* | |
bool | $updateRecentChanges |
* | |
const | DELETED_ACTION = 1 |
const | DELETED_COMMENT = 2 |
const | DELETED_RESTRICTED = 8 |
const | DELETED_USER = 4 |
const | SUPPRESSED_ACTION = 9 |
const | SUPPRESSED_USER = 12 |
Protected Member Functions | |
saveContent () | |
Static Protected Member Functions | |
static | getTitleLink ($type, $lang, $title, &$params) |
Private Attributes | |
string | $action |
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir' *. | |
string | $actionText |
Plaintext version of the message *. | |
string | $comment |
Comment associated with action *. | |
User | $doer |
The user doing the action *. | |
string | $ircActionText |
Plaintext version of the message for IRC *. | |
string | $params |
Blob made of a parameters array *. | |
Title | $target |
* | |
string | $type |
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move'. |
Class to simplify the use of log pages.
The logs are now kept in a table which is easier to manage and trim than ever-growing wiki pages.
Definition at line 32 of file LogPage.php.
LogPage::__construct | ( | $ | type, |
$ | rc = true , |
||
$ | udp = 'skipUDP' |
||
) |
Constructor.
string | $type | One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move' |
bool | $rc | Whether to update recent changes as well as the logging table |
string | $udp | Pass 'UDP' to send to the UDP feed if NOT sent to RC |
Definition at line 73 of file LogPage.php.
static LogPage::actionText | ( | $ | type, |
$ | action, | ||
$ | title = null , |
||
$ | skin = null , |
||
$ | params = array() , |
||
$ | filterWikilinks = false |
||
) | [static] |
Generate text for a log entry.
Only LogFormatter should call this function.
string | $type | Log type |
string | $action | Log action |
Title | null | $title | Title object or null |
Skin | null | $skin | Skin object or null. If null, we want to use the wiki content language, since that will go to the IRC feed. |
array | $params | Parameters |
bool | $filterWikilinks | Whether to filter wiki links |
Definition at line 253 of file LogPage.php.
LogPage::addEntry | ( | $ | action, |
$ | target, | ||
$ | comment, | ||
$ | params = array() , |
||
$ | doer = null |
||
) |
Add a log entry.
string | $action | One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir' |
Title | $target | Title object |
string | $comment | Description associated |
array | $params | Parameters passed later to wfMessage function |
null | int | User | $doer | The user doing the action. null for $wgUser |
Definition at line 443 of file LogPage.php.
LogPage::addRelations | ( | $ | field, |
$ | values, | ||
$ | logid | ||
) |
Add relations to log_search table.
string | $field | |
array | $values | |
int | $logid |
Definition at line 497 of file LogPage.php.
static LogPage::extractParams | ( | $ | blob | ) | [static] |
Extract a parameter array from a blob.
string | $blob |
Definition at line 534 of file LogPage.php.
Referenced by PopulateLogSearch\doDBUpdates().
static LogPage::formatBlockFlag | ( | $ | flag, |
$ | lang | ||
) | [static] |
static LogPage::formatBlockFlags | ( | $ | flags, |
$ | lang | ||
) | [static] |
Convert a comma-delimited list of block log flags into a more readable (and translated) form.
string | $flags | Flags to format |
Language | $lang |
Definition at line 550 of file LogPage.php.
Get the comment from the last addEntry() call.
Definition at line 179 of file LogPage.php.
Description of this log type.
Definition at line 620 of file LogPage.php.
LogPage::getName | ( | ) |
Get the RC comment from the last addEntry() call.
Definition at line 140 of file LogPage.php.
Get the RC comment from the last addEntry() call for IRC.
Definition at line 160 of file LogPage.php.
Returns the right needed to read this log type.
Definition at line 637 of file LogPage.php.
static LogPage::getTitleLink | ( | $ | type, |
$ | lang, | ||
$ | title, | ||
&$ | params | ||
) | [static, protected] |
static LogPage::isLogType | ( | $ | type | ) | [static] |
Is $type a valid log type.
string | $type | Log type to check |
Definition at line 200 of file LogPage.php.
Referenced by SpecialLog\execute().
Tells if this log is not viewable by all.
Definition at line 654 of file LogPage.php.
static LogPage::logHeader | ( | $ | type | ) | [static] |
Get the log header for the given log type.
string | $type | Logtype |
Definition at line 232 of file LogPage.php.
static LogPage::logName | ( | $ | type | ) | [static] |
Get the name for the given log type.
string | $type | Log type |
Definition at line 211 of file LogPage.php.
static LogPage::makeParamBlob | ( | $ | params | ) | [static] |
Create a blob from a parameter array.
array | $params |
Definition at line 524 of file LogPage.php.
LogPage::saveContent | ( | ) | [protected] |
Definition at line 82 of file LogPage.php.
static LogPage::validTypes | ( | ) | [static] |
Get the list of valid log types.
Definition at line 188 of file LogPage.php.
string LogPage::$action [private] |
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir' *.
Definition at line 55 of file LogPage.php.
string LogPage::$actionText [private] |
Plaintext version of the message *.
Definition at line 48 of file LogPage.php.
string LogPage::$comment [private] |
Comment associated with action *.
Definition at line 57 of file LogPage.php.
User LogPage::$doer [private] |
The user doing the action *.
Definition at line 61 of file LogPage.php.
string LogPage::$ircActionText [private] |
Plaintext version of the message for IRC *.
Definition at line 46 of file LogPage.php.
string LogPage::$params [private] |
Blob made of a parameters array *.
Definition at line 59 of file LogPage.php.
bool LogPage::$sendToUDP |
*
Definition at line 44 of file LogPage.php.
Title LogPage::$target [private] |
*
Definition at line 63 of file LogPage.php.
string LogPage::$type [private] |
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move'.
Definition at line 52 of file LogPage.php.
Referenced by __construct().
bool LogPage::$updateRecentChanges |
*
Definition at line 42 of file LogPage.php.
const LogPage::DELETED_ACTION = 1 |
Definition at line 33 of file LogPage.php.
Referenced by SpecialWatchlist\doMainQuery(), ApiQueryLogEvents\execute(), ApiQueryWatchlist\extractRowInfo(), ApiQueryLogEvents\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), MoveLogFormatter\getActionLinks(), DeleteLogFormatter\getActionLinks(), LogFormatter\getActionText(), RevDelLogItem\getApiData(), RevDelLogList\getRevdelConstant(), ApiQueryWatchlist\run(), ApiQueryRecentChanges\run(), and RevisionDeleteUser\setUsernameBitfields().
const LogPage::DELETED_COMMENT = 2 |
Definition at line 34 of file LogPage.php.
Referenced by ApiQueryLogEvents\extractRowInfo(), ProtectedPagesPager\formatValue(), RevDelLogItem\getApiData(), LogFormatter\getComment(), and RevDelLogItem\getHTML().
const LogPage::DELETED_RESTRICTED = 8 |
Definition at line 36 of file LogPage.php.
Referenced by SpecialWatchlist\doMainQuery(), ApiQueryLogEvents\execute(), ApiQueryLogEvents\extractRowInfo(), ApiQueryWatchlist\run(), and ApiQueryRecentChanges\run().
const LogPage::DELETED_USER = 4 |
Definition at line 35 of file LogPage.php.
Referenced by ApiQueryLogEvents\execute(), ApiQueryLogEvents\extractRowInfo(), ProtectedPagesPager\formatValue(), and RevDelLogItem\getApiData().
const LogPage::SUPPRESSED_ACTION = 9 |
Definition at line 40 of file LogPage.php.
const LogPage::SUPPRESSED_USER = 12 |
Definition at line 39 of file LogPage.php.