LogPage Class Reference

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

List of all members.

Public Member Functions

 __construct ($type, $rc=true, $udp= 'skipUDP')
 Constructor.
 getRcComment ()
 Get the RC comment from the last addEntry() call.
 getComment ()
 Get the comment from the last addEntry() call.
 addEntry ($action, $target, $comment, $params=array(), $doer=null)
 Add a log entry.

Static Public Member Functions

static validTypes ()
static isLogType ($type)
static logName ($type)
static logHeader ($type)
static actionText ($type, $action, $title=NULL, $skin=NULL, $params=array(), $filterWikilinks=false)
static makeParamBlob ($params)
 Create a blob from a parameter array.
static extractParams ($blob)
 Extract a parameter array from a blob.
static formatBlockFlags ($flags, $forContent=false)
 Convert a comma-delimited list of block log flags into a more readable (and translated) form.
static formatBlockFlag ($flag, $forContent=false)
 Translate a block log flag if possible.

Public Attributes

const DELETED_ACTION = 1
const DELETED_COMMENT = 2
const DELETED_USER = 4
const DELETED_RESTRICTED = 8
 $type
 $action
 $comment
 $params
 $target
 $doer
 $updateRecentChanges
 $sendToUDP

Protected Member Functions

 saveContent ()

Static Protected Member Functions

static getTitleLink ($type, $skin, $title, &$params)


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:
string $type One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move'
bool $rc Whether to update recent changes as well as the logging table
bool $udp Whether to send to the UDP feed if NOT sent to RC

Definition at line 50 of file LogPage.php.

References $type.


Member Function Documentation

static LogPage::actionText ( type,
action,
title = NULL,
skin = NULL,
params = array(),
filterWikilinks = false 
) [static]

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

Add a log entry.

Parameters:
string $action one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'
object &$target A title object.
string $comment Description associated
array $params Parameters passed later to wfMsg.* functions
User $doer The user doing the action

Definition at line 323 of file LogPage.php.

References $action, $comment, $doer, $params, $target, $wgUser, actionText(), makeParamBlob(), User::newFromId(), and saveContent().

static LogPage::extractParams ( blob  )  [static]

static LogPage::formatBlockFlag ( flag,
forContent = false 
) [static]

Translate a block log flag if possible.

Parameters:
$flag Flag to translate
$forContent Whether to localize the message depending of the user language
Returns:
string

Definition at line 397 of file LogPage.php.

References $messages, $msg, wfEmptyMsg(), wfMsg(), and wfMsgForContent().

static LogPage::formatBlockFlags ( flags,
forContent = false 
) [static]

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

Parameters:
$flags Flags to format
$forContent Whether to localize the message depending of the user language
Returns:
string

Definition at line 376 of file LogPage.php.

References $flags, $i, and $wgLang.

Referenced by actionText().

LogPage::getComment (  ) 

Get the comment from the last addEntry() call.

Definition at line 114 of file LogPage.php.

LogPage::getRcComment (  ) 

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

Definition at line 100 of file LogPage.php.

References actionText(), and wfMsgForContent().

Referenced by saveContent().

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

static LogPage::isLogType ( type  )  [static]

Definition at line 129 of file LogPage.php.

References $type, and validTypes().

Referenced by LogEventsList::showHeader().

static LogPage::logHeader ( type  )  [static]

Todo:
handle missing log types
Parameters:
string $type logtype
Returns:
string Headertext of this logtype

Definition at line 153 of file LogPage.php.

References $type, $wgLogHeaders, $wgMessageCache, and wfMsgExt().

Referenced by LogEventsList::showHeader().

static LogPage::logName ( type  )  [static]

static LogPage::makeParamBlob ( params  )  [static]

Create a blob from a parameter array.

Definition at line 351 of file LogPage.php.

References $params.

Referenced by addEntry().

LogPage::saveContent (  )  [protected]

static LogPage::validTypes (  )  [static]

Definition at line 121 of file LogPage.php.

References $wgLogTypes.

Referenced by LogEventsList::getTypeMenu(), and isLogType().


Member Data Documentation

LogPage::$action

Definition at line 38 of file LogPage.php.

Referenced by addEntry().

LogPage::$comment

Definition at line 38 of file LogPage.php.

Referenced by addEntry().

LogPage::$doer

Definition at line 38 of file LogPage.php.

Referenced by addEntry().

LogPage::$params

Definition at line 38 of file LogPage.php.

Referenced by actionText(), addEntry(), getTitleLink(), and makeParamBlob().

LogPage::$sendToUDP

Definition at line 40 of file LogPage.php.

LogPage::$target

Definition at line 38 of file LogPage.php.

Referenced by addEntry().

LogPage::$type

Definition at line 38 of file LogPage.php.

Referenced by __construct(), actionText(), getTitleLink(), isLogType(), logHeader(), and logName().

LogPage::$updateRecentChanges

Definition at line 40 of file LogPage.php.


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

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