MediaWiki  REL1_20
LogPage Class Reference

Class to simplify the use of log pages. More...

Collaboration diagram for LogPage:

List of all members.

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

 $action
 $comment
User $doer
 $params
 $sendToUDP
Title $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.

Detailed Description

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.


Constructor & Destructor Documentation

LogPage::__construct ( type,
rc = true,
udp = 'skipUDP' 
)

Constructor.

Parameters:
$typeString: one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move'
$rcBoolean: whether to update recent changes as well as the logging table
$udpString: pass 'UDP' to send to the UDP feed if NOT sent to RC

Definition at line 62 of file LogPage.php.


Member Function Documentation

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.

Parameters:
$typeString: log type
$actionString: log action
$titleMixed: Title object or null
$skinMixed: Skin object or null. If null, we want to use the wiki content language, since that will go to the IRC feed.
$paramsArray: parameters
$filterWikilinksBoolean: whether to filter wiki links
Returns:
HTML string

Definition at line 233 of file LogPage.php.

LogPage::addEntry ( action,
target,
comment,
params = array(),
doer = null 
)

Add a log entry.

Parameters:
$actionString: one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'
$targetTitle object
$commentString: description associated
$paramsArray: parameters passed later to wfMessage function
$doerUser object: the user doing the action
Returns:
int log_id of the inserted log entry

Definition at line 450 of file LogPage.php.

LogPage::addRelations ( field,
values,
logid 
)

Add relations to log_search table.

Parameters:
$fieldString
$valuesArray
$logidInteger
Returns:
Boolean

Definition at line 501 of file LogPage.php.

static LogPage::extractParams ( blob) [static]

Extract a parameter array from a blob.

Parameters:
$blobString
Returns:
Array

Definition at line 538 of file LogPage.php.

Referenced by PopulateLogSearch\doDBUpdates().

static LogPage::formatBlockFlag ( flag,
lang 
) [static]

Translate a block log flag if possible.

Parameters:
$flagint Flag to translate
$langLanguage object to use
Returns:
String

Definition at line 575 of file LogPage.php.

static LogPage::formatBlockFlags ( flags,
lang 
) [static]

Convert a comma-delimited list of block log flags into a more readable (and translated) form.

Parameters:
$flagsstring Flags to format
$langLanguage object to use
Returns:
String

Definition at line 554 of file LogPage.php.

Get the comment from the last addEntry() call.

Definition at line 165 of file LogPage.php.

Description of this log type.

Returns:
Message
Since:
1.19

Definition at line 623 of file LogPage.php.

Name of the log.

Returns:
Message
Since:
1.19

Definition at line 605 of file LogPage.php.

Get the RC comment from the last addEntry() call.

Returns:
string

Definition at line 127 of file LogPage.php.

Get the RC comment from the last addEntry() call for IRC.

Returns:
string

Definition at line 147 of file LogPage.php.

Returns the right needed to read this log type.

Returns:
string
Since:
1.19

Definition at line 639 of file LogPage.php.

static LogPage::getTitleLink ( type,
lang,
title,
&$  params 
) [static, protected]

TODO document.

Parameters:
$typeString
$langLanguage or null
$titleTitle
$paramsArray
Returns:
String

Definition at line 350 of file LogPage.php.

static LogPage::isLogType ( type) [static]

Is $type a valid log type.

Parameters:
$typeString: log type to check
Returns:
Boolean

Definition at line 185 of file LogPage.php.

Referenced by SpecialLog\execute().

Tells if this log is not viewable by all.

Returns:
bool
Since:
1.19

Definition at line 655 of file LogPage.php.

static LogPage::logHeader ( type) [static]

Get the log header for the given log type.

Todo:
handle missing log types
Parameters:
$typeString: logtype
Returns:
String: headertext of this logtype
Deprecated:
in 1.19, warnings in 1.21. Use getDescription()

Definition at line 215 of file LogPage.php.

static LogPage::logName ( type) [static]

Get the name for the given log type.

Parameters:
$typeString: logtype
Returns:
String: log name
Deprecated:
in 1.19, warnings in 1.21. Use getName()

Definition at line 196 of file LogPage.php.

static LogPage::makeParamBlob ( params) [static]

Create a blob from a parameter array.

Parameters:
$paramsArray
Returns:
String

Definition at line 528 of file LogPage.php.

LogPage::saveContent ( ) [protected]
Returns:
int log_id of the inserted log entry

Definition at line 71 of file LogPage.php.

static LogPage::validTypes ( ) [static]

Get the list of valid log types.

Returns:
Array of strings

Definition at line 174 of file LogPage.php.


Member Data Documentation

LogPage::$action

Definition at line 41 of file LogPage.php.

LogPage::$comment

Definition at line 41 of file LogPage.php.

User LogPage::$doer

Definition at line 45 of file LogPage.php.

LogPage::$params

Definition at line 41 of file LogPage.php.

LogPage::$sendToUDP

Definition at line 52 of file LogPage.php.

Title LogPage::$target

Definition at line 49 of file LogPage.php.

LogPage::$type

Definition at line 41 of file LogPage.php.

LogPage::$updateRecentChanges

Definition at line 52 of file LogPage.php.

Definition at line 34 of file LogPage.php.

Referenced by ApiQueryLogEvents\extractRowInfo(), and RevDel_LogItem\getHTML().

Definition at line 36 of file LogPage.php.

Definition at line 39 of file LogPage.php.

Referenced by LogPager\limitTitle().

Definition at line 38 of file LogPage.php.

Referenced by LogPager\limitPerformer().


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