MediaWiki master
MediaWiki\Logging\LogEventsList Class Reference

Inherits MediaWiki\Context\ContextSource.

Collaboration diagram for MediaWiki\Logging\LogEventsList:

Public Member Functions

 __construct ( $context, $linkRenderer=null, $flags=0)
 
 beginLogEventsList ()
 
 endLogEventsList ()
 
 logLine ( $row)
 
 showOptions ( $type='', $year=0, $month=0, $day=0)
 Show options for the log list.
 
- Public Member Functions inherited from MediaWiki\Context\ContextSource
 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage().
 
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID.
 
 getActionName ()
 Get the action name for the current web request.
 
 getAuthority ()
 
 getConfig ()
 
 getContext ()
 Get the base IContextSource object.
 
 getCsrfTokenSet ()
 Get a repository to obtain and match CSRF tokens.
 
 getLanguage ()
 
 getLanguageCode ()
 
 getOutput ()
 
 getRequest ()
 
 getSkin ()
 
 getTiming ()
 
 getTitle ()
 
 getUser ()
 
 getWikiPage ()
 Get the WikiPage object.
 
 msg ( $key,... $params)
 Get a Message object with context set Parameters are the same as wfMessage()
 
 setContext (IContextSource $context)
 

Static Public Member Functions

static getBlockLogWarningBox (DatabaseBlockStore $blockStore, NamespaceInfo $namespaceInfo, MessageLocalizer $localizer, LinkRenderer $linkRenderer, $user, Title $title)
 
static getExcludeClause ( $db, $audience='public', ?Authority $performer=null)
 SQL clause to skip forbidden log types for this user.
 
static isDeleted ( $row, $field)
 
static showLogExtract (&$out, $types=[], $page='', $user='', $param=[])
 Show log extract.
 
static typeAction ( $row, $type, $action)
 
static userCan ( $row, $field, Authority $performer)
 Determine if the current user is allowed to view a particular field of this log row, if it's marked as deleted and/or restricted log type.
 
static userCanBitfield ( $bitfield, $field, Authority $performer)
 Determine if the current user is allowed to view a particular field of this log row, if it's marked as deleted.
 
static userCanViewLogType ( $type, Authority $performer)
 Determine if the current user is allowed to view a particular field of this log row, if it's marked as restricted log type.
 

Public Attributes

int $flags
 
const NO_ACTION_LINK = 1
 
const NO_EXTRA_USER_LINKS = 2
 
const USE_CHECKBOXES = 4
 

Protected Member Functions

 getLinkRenderer ()
 

Protected Attributes

bool $showTagEditUI
 

Detailed Description

Definition at line 60 of file LogEventsList.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Logging\LogEventsList::__construct ( $context,
$linkRenderer = null,
$flags = 0 )
Parameters
IContextSource$context
LinkRenderer | null$linkRenderer
int$flagsCan be a combination of self::NO_ACTION_LINK, self::NO_EXTRA_USER_LINKS or self::USE_CHECKBOXES.

Definition at line 92 of file LogEventsList.php.

References MediaWiki\Logging\LogEventsList\$flags, MediaWiki\Context\ContextSource\getAuthority(), MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\Context\ContextSource\setContext().

Member Function Documentation

◆ beginLogEventsList()

MediaWiki\Logging\LogEventsList::beginLogEventsList ( )
Returns
string

Definition at line 319 of file LogEventsList.php.

◆ endLogEventsList()

MediaWiki\Logging\LogEventsList::endLogEventsList ( )
Returns
string

Definition at line 326 of file LogEventsList.php.

◆ getBlockLogWarningBox()

static MediaWiki\Logging\LogEventsList::getBlockLogWarningBox ( DatabaseBlockStore $blockStore,
NamespaceInfo $namespaceInfo,
MessageLocalizer $localizer,
LinkRenderer $linkRenderer,
$user,
Title $title )
static
Access: internal
– shared code for IntroMessageBuilder and Article::showMissingArticle

If the user associated with the current page is blocked, get a warning box with a block log extract in it. Otherwise, return null.

Parameters
DatabaseBlockStore$blockStore
NamespaceInfo$namespaceInfo
MessageLocalizer$localizer
LinkRenderer$linkRenderer
UserIdentity | false | null$userThe user which may be blocked
Title$titleThe title being viewed
Returns
string|null

Definition at line 823 of file LogEventsList.php.

References MediaWiki\Title\NamespaceInfo\getCanonicalName(), MediaWiki\SpecialPage\SpecialPage\getTitleFor(), MediaWiki\Linker\LinkRenderer\makeKnownLink(), MessageLocalizer\msg(), MediaWiki\Block\DatabaseBlockStore\newListFromTarget(), NS_USER, and MediaWiki\Logging\LogEventsList\showLogExtract().

◆ getExcludeClause()

static MediaWiki\Logging\LogEventsList::getExcludeClause ( $db,
$audience = 'public',
?Authority $performer = null )
static

SQL clause to skip forbidden log types for this user.

Parameters
\\Wikimedia\\Rdbms\\IReadableDatabase$db
string$audiencePublic/user
Authority | null$performerUser to check, required when audience isn't public
Returns
string|false String on success, false on failure.
Exceptions
InvalidArgumentException

Definition at line 782 of file LogEventsList.php.

References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\MainConfigNames\LogRestrictions.

◆ getLinkRenderer()

MediaWiki\Logging\LogEventsList::getLinkRenderer ( )
protected
Since
1.30
Returns
LinkRenderer

Definition at line 109 of file LogEventsList.php.

References MediaWiki\MediaWikiServices\getInstance().

Referenced by MediaWiki\Logging\LogEventsList\logLine().

◆ isDeleted()

static MediaWiki\Logging\LogEventsList::isDeleted ( $row,
$field )
static
Parameters
stdClass$row
int$fieldOne of LogPage::DELETED_ACTION, ::DELETED_COMMENT, ::DELETED_USER, ::DELETED_RESTRICTED
Returns
bool

Definition at line 540 of file LogEventsList.php.

◆ logLine()

MediaWiki\Logging\LogEventsList::logLine ( $row)

◆ showLogExtract()

static MediaWiki\Logging\LogEventsList::showLogExtract ( & $out,
$types = [],
$page = '',
$user = '',
$param = [] )
static

Show log extract.

Either with text and a box (set $msgKey) or without (don't set $msgKey)

Parameters
OutputPage | string&$out
string | array$typesLog types to show
string | PageReference$pageThe page title to show log entries for
string$userThe user who made the log entries
array$paramAssociative Array with the following additional options:
  • lim Integer Limit of items to show, default is 50
  • conds Array Extra conditions for the query (e.g. $dbr->expr( 'log_action', '!=', 'revision' ))
  • showIfEmpty boolean Set to false if you don't want any output in case the loglist is empty if set to true (default), "No matching items in log" is displayed if loglist is empty
  • msgKey Array If you want a nice box with a message, set this to the key of the message. First element is the message key, additional optional elements are parameters for the key that are processed with wfMessage
  • offset Set to overwrite offset parameter in WebRequest set to '' to unset offset
  • wrap String Wrap the message in html (usually something like "<div ...>$1</div>").
  • flags Integer display flags (NO_ACTION_LINK,NO_EXTRA_USER_LINKS)
  • useRequestParams boolean Set true to use Pager-related parameters in the WebRequest
  • useMaster boolean Use primary DB
  • extraUrlParams array|bool Additional url parameters for "full log" link (if it is shown)
  • footerHtmlItems: string[] Extra HTML to add as horizontal list items after the end of the log
Returns
int Number of total log items (not limited by $lim)

Definition at line 571 of file LogEventsList.php.

References MediaWiki\Logging\LogEventsList\$flags, MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\HookContainer\HookRunner\onLogEventsListShowLogExtract().

Referenced by MediaWiki\Logging\LogEventsList\getBlockLogWarningBox().

◆ showOptions()

MediaWiki\Logging\LogEventsList::showOptions ( $type = '',
$year = 0,
$month = 0,
$day = 0 )

Show options for the log list.

Parameters
string$typeLog type
int | string$yearUse 0 to start with no year preselected.
int | string$monthA month in the 1..12 range. Use 0 to start with no month preselected.
int | string$dayA day in the 1..31 range. Use 0 to start with no month preselected.
Returns
bool Whether the options are valid

Definition at line 128 of file LogEventsList.php.

References MediaWiki\MainConfigNames\ActionFilteredLogs, MediaWiki\Context\ContextSource\getConfig(), MediaWiki\Context\ContextSource\getContext(), MediaWiki\SpecialPage\SpecialPage\getTitleFor(), StatusValue\isGood(), MediaWiki\MainConfigNames\MiserMode, and MediaWiki\Context\ContextSource\setContext().

◆ typeAction()

static MediaWiki\Logging\LogEventsList::typeAction ( $row,
$type,
$action )
static
Parameters
stdClass$row
string | array$type
string | array$action
Returns
bool

Definition at line 474 of file LogEventsList.php.

◆ userCan()

static MediaWiki\Logging\LogEventsList::userCan ( $row,
$field,
Authority $performer )
static

Determine if the current user is allowed to view a particular field of this log row, if it's marked as deleted and/or restricted log type.

Parameters
stdClass$row
int$fieldOne of LogPage::DELETED_ACTION, ::DELETED_COMMENT, ::DELETED_USER, ::DELETED_RESTRICTED
Authority$performerUser to check
Returns
bool

Definition at line 494 of file LogEventsList.php.

References MediaWiki\Logging\LogEventsList\userCanBitfield(), and MediaWiki\Logging\LogEventsList\userCanViewLogType().

◆ userCanBitfield()

static MediaWiki\Logging\LogEventsList::userCanBitfield ( $bitfield,
$field,
Authority $performer )
static

Determine if the current user is allowed to view a particular field of this log row, if it's marked as deleted.

Parameters
int$bitfieldCurrent field
int$fieldOne of LogPage::DELETED_ACTION, ::DELETED_COMMENT, ::DELETED_USER, ::DELETED_RESTRICTED
Authority$performerUser to check
Returns
bool

Definition at line 508 of file LogEventsList.php.

References MediaWiki\Logging\LogPage\DELETED_RESTRICTED, MediaWiki\Permissions\Authority\isAllowed(), and MediaWiki\Permissions\Authority\isAllowedAny().

Referenced by MediaWiki\Logging\LogEventsList\userCan().

◆ userCanViewLogType()

static MediaWiki\Logging\LogEventsList::userCanViewLogType ( $type,
Authority $performer )
static

Determine if the current user is allowed to view a particular field of this log row, if it's marked as restricted log type.

Parameters
string$type
Authority$performerUser to check
Returns
bool

Definition at line 527 of file LogEventsList.php.

References MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Permissions\Authority\isAllowed(), and MediaWiki\MainConfigNames\LogRestrictions.

Referenced by MediaWiki\Logging\LogEventsList\userCan().

Member Data Documentation

◆ $flags

int MediaWiki\Logging\LogEventsList::$flags

◆ $showTagEditUI

bool MediaWiki\Logging\LogEventsList::$showTagEditUI
protected

Definition at line 71 of file LogEventsList.php.

◆ NO_ACTION_LINK

const MediaWiki\Logging\LogEventsList::NO_ACTION_LINK = 1

Definition at line 61 of file LogEventsList.php.

◆ NO_EXTRA_USER_LINKS

const MediaWiki\Logging\LogEventsList::NO_EXTRA_USER_LINKS = 2

Definition at line 62 of file LogEventsList.php.

◆ USE_CHECKBOXES

const MediaWiki\Logging\LogEventsList::USE_CHECKBOXES = 4

Definition at line 63 of file LogEventsList.php.


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