MediaWiki  master
LogEventsList Class Reference
Inheritance diagram for LogEventsList:
Collaboration diagram for LogEventsList:

Public Member Functions

 __construct ( $context, $linkRenderer=null, $flags=0)
 The first two parameters used to be $skin and $out, but now only a context is needed, that's why there's a second unused parameter. More...
 
 beginLogEventsList ()
 
 endLogEventsList ()
 
 logLine ( $row)
 
 setAllowedActions ( $actions)
 Sets the action types allowed for log filtering To one action type may correspond several log_actions. More...
 
 showOptions ( $types=[], $user='', $page='', $pattern=false, $year=0, $month=0, $day=0, $filter=null, $tagFilter='', $action=null)
 Show options for the log list. More...
 
- Public Member Functions inherited from ContextSource
 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage(). More...
 
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID. More...
 
 getConfig ()
 
 getContext ()
 Get the base IContextSource object. More...
 
 getLanguage ()
 
 getOutput ()
 
 getRequest ()
 
 getSkin ()
 
 getStats ()
 
 getTiming ()
 
 getTitle ()
 
 getUser ()
 Stable to override. More...
 
 getWikiPage ()
 Get the WikiPage object. More...
 
 msg ( $key,... $params)
 Get a Message object with context set Parameters are the same as wfMessage() More...
 
 setContext (IContextSource $context)
 

Static Public Member Functions

static getExcludeClause ( $db, $audience='public', User $user=null)
 SQL clause to skip forbidden log types for this user. More...
 
static isDeleted ( $row, $field)
 
static showLogExtract (&$out, $types=[], $page='', $user='', $param=[])
 Show log extract. More...
 
static typeAction ( $row, $type, $action)
 
static userCan ( $row, $field, User $user)
 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. More...
 
static userCanBitfield ( $bitfield, $field, User $user)
 Determine if the current user is allowed to view a particular field of this log row, if it's marked as deleted. More...
 
static userCanViewLogType ( $type, User $user)
 Determine if the current user is allowed to view a particular field of this log row, if it's marked as restricted log type. More...
 

Public Attributes

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

Protected Member Functions

 getLinkRenderer ()
 

Protected Attributes

array $allowedActions = null
 
array $mDefaultQuery
 
bool $showTagEditUI
 

Private Member Functions

 getActionSelectorDesc ( $types, $action)
 Drop down menu for selection of actions that can be used to filter the log. More...
 
 getExtraInputsDesc ( $types)
 
 getFiltersDesc ( $filter)
 
 getShowHideLinks ( $row)
 
 getTitleInputDesc ( $title)
 
 getTitlePatternDesc ( $pattern)
 
 getTypeMenuDesc ( $queryTypes)
 
 getUserInputDesc ( $user)
 

Private Attributes

HookRunner $hookRunner
 
LinkRenderer null $linkRenderer
 

Detailed Description

Definition at line 31 of file LogEventsList.php.

Constructor & Destructor Documentation

◆ __construct()

LogEventsList::__construct (   $context,
  $linkRenderer = null,
  $flags = 0 
)

The first two parameters used to be $skin and $out, but now only a context is needed, that's why there's a second unused parameter.

Parameters
IContextSource | Skin$contextContext to use; formerly it was a Skin object. Use of Skin is deprecated.
LinkRenderer | null$linkRendererpreviously unused
int$flagsCan be a combination of self::NO_ACTION_LINK, self::NO_EXTRA_USER_LINKS or self::USE_CHECKBOXES.

Definition at line 72 of file LogEventsList.php.

References ContextSource\$context, $flags, $linkRenderer, ContextSource\getUser(), Hooks\runner(), ContextSource\setContext(), and ChangeTags\showTagEditingUI().

Member Function Documentation

◆ beginLogEventsList()

LogEventsList::beginLogEventsList ( )
Returns
string

Definition at line 361 of file LogEventsList.php.

◆ endLogEventsList()

LogEventsList::endLogEventsList ( )
Returns
string

Definition at line 368 of file LogEventsList.php.

◆ getActionSelectorDesc()

LogEventsList::getActionSelectorDesc (   $types,
  $action 
)
private

Drop down menu for selection of actions that can be used to filter the log.

Parameters
array$types
string$action
Returns
array Form descriptor

Definition at line 330 of file LogEventsList.php.

References ContextSource\msg().

Referenced by showOptions().

◆ getExcludeClause()

static LogEventsList::getExcludeClause (   $db,
  $audience = 'public',
User  $user = null 
)
static

SQL clause to skip forbidden log types for this user.

Parameters
IDatabase$db
string$audiencePublic/user
User | null$userUser to check, required when audience isn't public
Returns
string|bool String on success, false on failure.
Exceptions
InvalidArgumentException

Definition at line 787 of file LogEventsList.php.

References $wgLogRestrictions, and getPermissionManager().

Referenced by WikiExporter\dumpLogs(), ApiQueryLogEvents\execute(), ApiQueryLogEvents\getCacheMode(), and LogPager\limitType().

◆ getExtraInputsDesc()

LogEventsList::getExtraInputsDesc (   $types)
private
Parameters
array$types
Returns
array|string Form descriptor or string with HTML

Definition at line 302 of file LogEventsList.php.

Referenced by showOptions().

◆ getFiltersDesc()

LogEventsList::getFiltersDesc (   $filter)
private
Parameters
array$filter
Returns
array Form descriptor

Definition at line 205 of file LogEventsList.php.

References $type.

Referenced by showOptions().

◆ getLinkRenderer()

LogEventsList::getLinkRenderer ( )
protected
Since
1.30
Returns
LinkRenderer

Definition at line 92 of file LogEventsList.php.

References $linkRenderer.

Referenced by logLine().

◆ getShowHideLinks()

LogEventsList::getShowHideLinks (   $row)
private

◆ getTitleInputDesc()

LogEventsList::getTitleInputDesc (   $title)
private
Parameters
string$title
Returns
array Form descriptor

Definition at line 277 of file LogEventsList.php.

Referenced by showOptions().

◆ getTitlePatternDesc()

LogEventsList::getTitlePatternDesc (   $pattern)
private
Parameters
bool$pattern
Returns
array Form descriptor

Definition at line 290 of file LogEventsList.php.

Referenced by showOptions().

◆ getTypeMenuDesc()

LogEventsList::getTypeMenuDesc (   $queryTypes)
private
Parameters
array$queryTypes
Returns
array Form descriptor

Definition at line 228 of file LogEventsList.php.

References $type, getPermissionManager(), ContextSource\getUser(), and LogPage\validTypes().

Referenced by showOptions().

◆ getUserInputDesc()

LogEventsList::getUserInputDesc (   $user)
private
Parameters
string$user
Returns
array Form descriptor

Definition at line 264 of file LogEventsList.php.

Referenced by showOptions().

◆ isDeleted()

static LogEventsList::isDeleted (   $row,
  $field 
)
static
Parameters
stdClass$row
int$fieldOne of DELETED_* bitfield constants
Returns
bool

Definition at line 580 of file LogEventsList.php.

Referenced by ApiQueryLogEvents\extractRowInfo(), ProtectedPagesPager\formatValue(), ChangeTagsLogItem\getHTML(), RevDelLogItem\getHTML(), and getShowHideLinks().

◆ logLine()

LogEventsList::logLine (   $row)
Parameters
stdClass$rowA single row from the result set
Returns
string Formatted HTML list item

Definition at line 376 of file LogEventsList.php.

References ChangeTags\formatSummaryRow(), ContextSource\getContext(), ContextSource\getLanguage(), getLinkRenderer(), getShowHideLinks(), LogFormatter\newFromEntry(), DatabaseLogEntry\newFromRow(), and Html\rawElement().

◆ setAllowedActions()

LogEventsList::setAllowedActions (   $actions)

Sets the action types allowed for log filtering To one action type may correspond several log_actions.

Parameters
array$actions
Since
1.27

Definition at line 354 of file LogEventsList.php.

◆ showLogExtract()

static 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 | Title$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. 'log_action != ' . $dbr->addQuotes( '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 master DB
  • extraUrlParams array|bool Additional url parameters for "full log" link (if it is shown)
Returns
int Number of total log items (not limited by $lim)

Definition at line 609 of file LogEventsList.php.

References $args, ContextSource\$context, $flags, $lang, $linkRenderer, $s, DB_MASTER, IContextSource\getLanguage(), RequestContext\getMain(), IContextSource\getOutput(), MessageLocalizer\msg(), Xml\openElement(), Html\rawElement(), Hooks\runner(), and wfGetDB().

Referenced by EditPage\addPageProtectionWarningHeaders(), Article\confirmDelete(), SpecialContributions\contributionsSub(), Article\delete(), Article\doDelete(), SpecialEditTags\execute(), SpecialRevisionDelete\execute(), SpecialDeletedContributions\getSubTitle(), SpecialUpload\getUploadForm(), HistoryAction\onView(), ImagePage\openShowImage(), SpecialBlock\postText(), SpecialChangeContentModel\postText(), MovePageForm\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), EditPage\showIntro(), FileDeleteForm\showLogEntries(), ProtectionForm\showLogExtract(), MovePageForm\showLogFragment(), SpecialPageLanguage\showLogFragment(), UserrightsPage\showLogFragment(), and Article\showMissingArticle().

◆ showOptions()

LogEventsList::showOptions (   $types = [],
  $user = '',
  $page = '',
  $pattern = false,
  $year = 0,
  $month = 0,
  $day = 0,
  $filter = null,
  $tagFilter = '',
  $action = null 
)

Show options for the log list.

Parameters
array | string$types
string$user
string$page
bool$pattern
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.
array | null$filter
string$tagFilterTag to select by default
string | null$action

Definition at line 116 of file LogEventsList.php.

References ContextSource\$context, HTMLForm\factory(), getActionSelectorDesc(), ContextSource\getConfig(), ContextSource\getContext(), getExtraInputsDesc(), getFiltersDesc(), SpecialPage\getTitleFor(), getTitleInputDesc(), getTitlePatternDesc(), getTypeMenuDesc(), getUserInputDesc(), ContextSource\msg(), Html\rawElement(), and wfDeprecated().

◆ typeAction()

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

Definition at line 506 of file LogEventsList.php.

References $type.

Referenced by PopulateLogSearch\doDBUpdates().

◆ userCan()

static LogEventsList::userCan (   $row,
  $field,
User  $user 
)
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$field
User$userUser to check
Returns
bool

Definition at line 526 of file LogEventsList.php.

References userCanBitfield(), and userCanViewLogType().

Referenced by ChangeTagsLogItem\canView(), RevDelLogItem\canView(), ApiQueryLogEvents\extractRowInfo(), and RevDelLogItem\getApiData().

◆ userCanBitfield()

static LogEventsList::userCanBitfield (   $bitfield,
  $field,
User  $user 
)
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$field
User$userUser to check
Returns
bool

Definition at line 540 of file LogEventsList.php.

References LogPage\DELETED_RESTRICTED, and wfDebug().

Referenced by LogFormatter\canView(), ApiQueryWatchlist\extractOutputData(), ApiQueryRecentChanges\extractRowInfo(), ProtectedPagesPager\formatValue(), ChangesList\userCan(), and userCan().

◆ userCanViewLogType()

static LogEventsList::userCanViewLogType (   $type,
User  $user 
)
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
User$userUser to check
Returns
bool

Definition at line 564 of file LogEventsList.php.

References $type, and getPermissionManager().

Referenced by userCan().

Member Data Documentation

◆ $allowedActions

array LogEventsList::$allowedActions = null
protected

Definition at line 52 of file LogEventsList.php.

◆ $flags

LogEventsList::$flags

Definition at line 36 of file LogEventsList.php.

Referenced by __construct(), and showLogExtract().

◆ $hookRunner

HookRunner LogEventsList::$hookRunner
private

Definition at line 60 of file LogEventsList.php.

◆ $linkRenderer

LinkRenderer null LogEventsList::$linkRenderer
private

Definition at line 57 of file LogEventsList.php.

Referenced by __construct(), getLinkRenderer(), and showLogExtract().

◆ $mDefaultQuery

array LogEventsList::$mDefaultQuery
protected
Deprecated:
since 1.34, no longer used.

Definition at line 42 of file LogEventsList.php.

◆ $showTagEditUI

bool LogEventsList::$showTagEditUI
protected

Definition at line 47 of file LogEventsList.php.

◆ NO_ACTION_LINK

const LogEventsList::NO_ACTION_LINK = 1

Definition at line 32 of file LogEventsList.php.

◆ NO_EXTRA_USER_LINKS

const LogEventsList::NO_EXTRA_USER_LINKS = 2

Definition at line 33 of file LogEventsList.php.

◆ USE_CHECKBOXES

const LogEventsList::USE_CHECKBOXES = 4

Definition at line 34 of file LogEventsList.php.

Referenced by SpecialLog\show().


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