MediaWiki
REL1_19
|
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. | |
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 | |
$action | |
$comment | |
$doer | |
$params | |
$sendToUDP | |
$target | |
$type | |
$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) |
TODO document. |
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.
$type | String: one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move' |
$rc | Boolean: whether to update recent changes as well as the logging table |
$udp | String: pass 'UDP' to send to the UDP feed if NOT sent to RC |
Definition at line 64 of file LogPage.php.
References $type.
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.
$type | String: log type |
$action | String: log action |
$title | Mixed: Title object or null |
$skin | Mixed: Skin object or null. If null, we want to use the wiki content language, since that will go to the IRC feed. |
$params | Array: parameters |
$filterWikilinks | Boolean: whether to filter wiki links |
Definition at line 216 of file LogPage.php.
References $params, $title, $type, $wgContLang, $wgLang, $wgLogActions, $wgLogActionsHandlers, formatBlockFlags(), getTitleLink(), wfDebug(), and wfMsgExt().
Referenced by addEntry(), LegacyLogFormatter\getActionMessage(), and getRcComment().
LogPage::addEntry | ( | $ | action, |
$ | target, | ||
$ | comment, | ||
$ | params = array() , |
||
$ | doer = null |
||
) |
Add a log entry.
$action | String: one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir' |
$target | Title object |
$comment | String: description associated |
$params | Array: parameters passed later to wfMsg.* functions |
$doer | User object: the user doing the action |
Definition at line 426 of file LogPage.php.
References $action, $comment, $doer, $params, $target, $wgContLang, $wgUser, actionText(), makeParamBlob(), RequestContext\newExtraneousContext(), LogFormatter\newFromEntry(), User\newFromId(), and saveContent().
LogPage::addRelations | ( | $ | field, |
$ | values, | ||
$ | logid | ||
) |
Add relations to log_search table.
$field | String |
$values | Array |
$logid | Integer |
Definition at line 476 of file LogPage.php.
References wfGetDB().
static LogPage::extractParams | ( | $ | blob | ) | [static] |
Extract a parameter array from a blob.
$blob | String |
Definition at line 513 of file LogPage.php.
References $blob.
Referenced by PopulateLogSearch\doDBUpdates(), and LogEventsList\logLine().
static LogPage::formatBlockFlag | ( | $ | flag, |
$ | lang | ||
) | [static] |
Translate a block log flag if possible.
$flag | int Flag to translate |
$lang | Language object to use |
Definition at line 549 of file LogPage.php.
References $messages, and wfMessage().
Referenced by formatBlockFlags().
static LogPage::formatBlockFlags | ( | $ | flags, |
$ | lang | ||
) | [static] |
Convert a comma-delimited list of block log flags into a more readable (and translated) form.
$flags | Flags to format |
$lang | Language object to use |
Definition at line 529 of file LogPage.php.
References formatBlockFlag().
Referenced by actionText().
Get the comment from the last addEntry() call.
Definition at line 146 of file LogPage.php.
Description of this log type.
Definition at line 597 of file LogPage.php.
References $wgLogHeaders, and wfMessage().
LogPage::getName | ( | ) |
Name of the log.
Definition at line 579 of file LogPage.php.
References $wgLogNames, and wfMessage().
Get the RC comment from the last addEntry() call.
Definition at line 129 of file LogPage.php.
References actionText(), and wfMsgForContent().
Referenced by saveContent().
Returns the right needed to read this log type.
Definition at line 613 of file LogPage.php.
References $wgLogRestrictions.
Referenced by isRestricted().
static LogPage::getTitleLink | ( | $ | type, |
$ | lang, | ||
$ | title, | ||
&$ | params | ||
) | [static, protected] |
TODO document.
Definition at line 330 of file LogPage.php.
References $params, $title, $type, $wgContLang, $wgUserrightsInterwikiDelimiter, WikiMap\foreignUserLink(), User\idFromName(), Linker\link(), logName(), Title\makeTitle(), Title\newFromText(), SpecialPageFactory\resolveAlias(), Linker\TOOL_LINKS_NOBLOCK, Linker\userLink(), and Linker\userToolLinks().
Referenced by actionText().
static LogPage::isLogType | ( | $ | type | ) | [static] |
Is $type a valid log type.
$type | String: log type to check |
Definition at line 166 of file LogPage.php.
References $type, and validTypes().
Referenced by SpecialLog\execute(), and LogEventsList\showHeader().
Tells if this log is not viewable by all.
Definition at line 629 of file LogPage.php.
References getRestriction().
static LogPage::logHeader | ( | $ | type | ) | [static] |
Get the log header for the given log type.
$type | String: logtype |
Definition at line 197 of file LogPage.php.
References $type, $wgLogHeaders, wfDeprecated(), and wfMsgExt().
static LogPage::logName | ( | $ | type | ) | [static] |
Get the name for the given log type.
$type | String: logtype |
Definition at line 177 of file LogPage.php.
References $type, $wgLogNames, wfDeprecated(), and wfMsg().
Referenced by Article\confirmDelete(), Article\delete(), Article\doDelete(), SpecialRevisionDelete\execute(), getTitleLink(), EnhancedChangesList\recentChangesBlockLine(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), FileDeleteForm\showLogEntries(), ProtectionForm\showLogExtract(), UserrightsPage\showLogFragment(), and MovePageForm\showLogFragment().
static LogPage::makeParamBlob | ( | $ | params | ) | [static] |
Create a blob from a parameter array.
$params | Array |
Definition at line 503 of file LogPage.php.
References $params.
Referenced by addEntry().
LogPage::saveContent | ( | ) | [protected] |
Definition at line 73 of file LogPage.php.
References $wgLogRestrictions, getRcComment(), SpecialPage\getTitleFor(), RecentChange\newLogEntry(), RecentChange\notifyLog(), wfGetDB(), and wfTimestampNow().
Referenced by addEntry().
static LogPage::validTypes | ( | ) | [static] |
Get the list of valid log types.
Definition at line 155 of file LogPage.php.
References $wgLogTypes.
Referenced by LogEventsList\getTypeSelector(), and isLogType().
LogPage::$action |
Definition at line 41 of file LogPage.php.
Referenced by addEntry().
LogPage::$comment |
Definition at line 41 of file LogPage.php.
Referenced by addEntry().
LogPage::$doer |
Definition at line 46 of file LogPage.php.
Referenced by addEntry().
LogPage::$params |
Definition at line 41 of file LogPage.php.
Referenced by actionText(), addEntry(), getTitleLink(), and makeParamBlob().
LogPage::$sendToUDP |
Definition at line 54 of file LogPage.php.
LogPage::$target |
Definition at line 51 of file LogPage.php.
Referenced by addEntry().
LogPage::$type |
Definition at line 41 of file LogPage.php.
Referenced by __construct(), actionText(), getTitleLink(), isLogType(), logHeader(), and logName().
LogPage::$updateRecentChanges |
Definition at line 54 of file LogPage.php.
const LogPage::DELETED_ACTION = 1 |
Definition at line 33 of file LogPage.php.
Referenced by SpecialWatchlist\execute(), ApiQueryLogEvents\execute(), ApiQueryLogEvents\extractRowInfo(), LogFormatter\getActionText(), LogPager\limitTitle(), LogEventsList\logActionLinks(), EnhancedChangesList\recentChangesBlockGroup(), RevisionDeleteUser\setUsernameBitfields(), and XmlDumpWriter\writeLogItem().
const LogPage::DELETED_COMMENT = 2 |
Definition at line 34 of file LogPage.php.
Referenced by ApiQueryLogEvents\extractRowInfo(), LogFormatter\getComment(), RevDel_LogItem\getHTML(), EditPage\getLastDelete(), and XmlDumpWriter\writeLogItem().
const LogPage::DELETED_RESTRICTED = 8 |
Definition at line 36 of file LogPage.php.
Referenced by SpecialWatchlist\execute(), LogEventsList\getShowHideLinks(), and LogEventsList\userCanBitfield().
const LogPage::DELETED_USER = 4 |
Definition at line 35 of file LogPage.php.
Referenced by ApiQueryLogEvents\execute(), ApiQueryLogEvents\extractRowInfo(), EditPage\getLastDelete(), LogFormatter\getPerformerElement(), LogPager\limitPerformer(), and XmlDumpWriter\writeLogItem().
const LogPage::SUPPRESSED_ACTION = 9 |
Definition at line 39 of file LogPage.php.
Referenced by LogPager\limitTitle().
const LogPage::SUPPRESSED_USER = 12 |
Definition at line 38 of file LogPage.php.
Referenced by LogPager\limitPerformer().