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

Public Member Functions

 __construct ($context, $unused=null, $flags=0)
 Constructor. More...
 
 beginLogEventsList ()
 
 endLogEventsList ()
 
 getTypeSelector ()
 Returns log page selector. More...
 
 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= '', $year=0, $month=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 ()
 Get the Config object. More...
 
 getContext ()
 Get the base IContextSource object. More...
 
 getLanguage ()
 Get the Language object. More...
 
 getOutput ()
 Get the OutputPage object. More...
 
 getRequest ()
 Get the WebRequest object. More...
 
 getSkin ()
 Get the Skin object. More...
 
 getStats ()
 Get the Stats object. More...
 
 getTiming ()
 Get the Timing object. More...
 
 getTitle ()
 Get the Title object. More...
 
 getUser ()
 Get the User object. More...
 
 getWikiPage ()
 Get the WikiPage object. More...
 
 msg ()
 Get a Message object with context set Parameters are the same as wfMessage() More...
 
 setContext (IContextSource $context)
 Set the IContextSource object. More...
 

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, $right= '')
 
static userCan ($row, $field, User $user=null)
 Determine if the current user is allowed to view a particular field of this log row, if it's marked as deleted. More...
 
static userCanBitfield ($bitfield, $field, User $user=null)
 Determine if the current user is allowed to view a particular field of this log row, if it's marked as deleted. More...
 

Public Attributes

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

Protected Attributes

array $allowedActions = null
 
array $mDefaultQuery
 
bool $showTagEditUI
 

Private Member Functions

 getActionSelector ($types, $action)
 Drop down menu for selection of actions that can be used to filter the log. More...
 
 getDefaultQuery ()
 
 getExtraInputs ($types)
 
 getFilterLinks ($filter)
 
 getShowHideLinks ($row)
 
 getTitleInput ($title)
 
 getTitlePattern ($pattern)
 
 getTypeMenu ($queryTypes)
 
 getUserInput ($user)
 

Detailed Description

Definition at line 26 of file LogEventsList.php.

Constructor & Destructor Documentation

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

Constructor.

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.
null$unusedUnused; used to be an OutputPage object.
int$flagsCan be a combination of self::NO_ACTION_LINK, self::NO_EXTRA_USER_LINKS or self::USE_CHECKBOXES.

Definition at line 59 of file LogEventsList.php.

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

Member Function Documentation

LogEventsList::beginLogEventsList ( )
Returns
string

Definition at line 339 of file LogEventsList.php.

LogEventsList::endLogEventsList ( )
Returns
string

Definition at line 346 of file LogEventsList.php.

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

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

Parameters
array$types
string$action
Returns
string
Since
1.27

Definition at line 308 of file LogEventsList.php.

References $html, $value, as, Xml\label(), text, and wfMessage().

Referenced by showOptions().

LogEventsList::getDefaultQuery ( )
private

Definition at line 174 of file LogEventsList.php.

References $mDefaultQuery, and ContextSource\getRequest().

Referenced by getFilterLinks().

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$userUser to check, or null to use $wgUser
Returns
string|bool String on success, false on failure.

Definition at line 712 of file LogEventsList.php.

References $user, $wgUser, as, and global.

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

LogEventsList::getExtraInputs (   $types)
private
Parameters
array$types
Returns
string

Definition at line 280 of file LogEventsList.php.

References $user, ContextSource\getRequest(), Xml\inputLabel(), IP\isIPAddress(), ContextSource\msg(), User\newFromName(), Hooks\run(), and text.

Referenced by showOptions().

LogEventsList::getFilterLinks (   $filter)
private
Parameters
array$filter
Returns
string Formatted HTML

Definition at line 143 of file LogEventsList.php.

References $link, $messages, $query, $type, as, getDefaultQuery(), ContextSource\getLanguage(), ContextSource\getTitle(), Html\hidden(), Linker\linkKnown(), and ContextSource\msg().

Referenced by showOptions().

LogEventsList::getShowHideLinks (   $row)
private
LogEventsList::getTitleInput (   $title)
private
Parameters
string$title
Returns
string Formatted HTML

Definition at line 254 of file LogEventsList.php.

References $title, Xml\inputLabel(), ContextSource\msg(), and text.

Referenced by showOptions().

LogEventsList::getTitlePattern (   $pattern)
private
Parameters
string$pattern
Returns
string Checkbox

Definition at line 270 of file LogEventsList.php.

References Xml\checkLabel(), ContextSource\msg(), and text.

Referenced by showOptions().

LogEventsList::getTypeMenu (   $queryTypes)
private
Parameters
array$queryTypes
Returns
string Formatted HTML

Definition at line 193 of file LogEventsList.php.

References $selector, and getTypeSelector().

Referenced by showOptions().

LogEventsList::getTypeSelector ( )

Returns log page selector.

Returns
XmlSelect
Since
1.19

Definition at line 206 of file LogEventsList.php.

References $name, $page, $type, as, ContextSource\getUser(), and LogPage\validTypes().

Referenced by getTypeMenu().

LogEventsList::getUserInput (   $user)
private
Parameters
string$user
Returns
string Formatted HTML

Definition at line 237 of file LogEventsList.php.

References $user, Xml\inputLabel(), ContextSource\msg(), and text.

Referenced by showOptions().

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

Definition at line 531 of file LogEventsList.php.

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

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

Definition at line 354 of file LogEventsList.php.

References $comment, $revert, $time, flags, ChangeTags\formatSummaryRow(), ContextSource\getContext(), ContextSource\getLanguage(), getShowHideLinks(), ContextSource\getUser(), list, LogFormatter\newFromEntry(), DatabaseLogEntry\newFromRow(), and Html\rawElement().

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 332 of file LogEventsList.php.

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$outBy-reference
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 != '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 559 of file LogEventsList.php.

References $args, ContextSource\$context, $dir, $flags, $lang, $out, $page, $s, $user, array(), DB_MASTER, IContextSource\getLanguage(), RequestContext\getMain(), link, message, IContextSource\msg(), Xml\openElement(), Html\rawElement(), Hooks\run(), the, type, and wfGetDB().

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

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

Show options for the log list.

Parameters
array | string$types
string$user
string$page
string$pattern
int$yearYear
int$monthMonth
array$filter
string$tagFilterTag to select by default
string$action

Definition at line 84 of file LogEventsList.php.

References $html, $page, $title, $user, $wgMiserMode, $wgScript, array(), ChangeTags\buildTagFilterSelector(), Xml\dateMenu(), Xml\fieldset(), getActionSelector(), getExtraInputs(), getFilterLinks(), ContextSource\getOutput(), SpecialPage\getTitleFor(), getTitleInput(), getTitlePattern(), getTypeMenu(), getUserInput(), global, Html\hidden(), ContextSource\msg(), Xml\submitButton(), Xml\tags(), and text.

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

Definition at line 471 of file LogEventsList.php.

References $type, $wgUser, and global.

Referenced by PopulateLogSearch\doDBUpdates().

static LogEventsList::userCan (   $row,
  $field,
User  $user = null 
)
static

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

Parameters
stdClass$rowRow
int$field
User$userUser to check, or null to use $wgUser
Returns
bool

Definition at line 495 of file LogEventsList.php.

References $user.

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

static LogEventsList::userCanBitfield (   $bitfield,
  $field,
User  $user = null 
)
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, or null to use $wgUser
Returns
bool

Definition at line 508 of file LogEventsList.php.

References $user, $wgUser, LogPage\DELETED_RESTRICTED, global, and wfDebug().

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

Member Data Documentation

array LogEventsList::$allowedActions = null
protected

Definition at line 46 of file LogEventsList.php.

LogEventsList::$flags

Definition at line 31 of file LogEventsList.php.

Referenced by __construct(), and showLogExtract().

array LogEventsList::$mDefaultQuery
protected

Definition at line 36 of file LogEventsList.php.

Referenced by getDefaultQuery().

bool LogEventsList::$showTagEditUI
protected

Definition at line 41 of file LogEventsList.php.

const LogEventsList::NO_ACTION_LINK = 1

Definition at line 27 of file LogEventsList.php.

const LogEventsList::NO_EXTRA_USER_LINKS = 2

Definition at line 28 of file LogEventsList.php.

const LogEventsList::USE_CHECKBOXES = 4

Definition at line 29 of file LogEventsList.php.

Referenced by SpecialLog\show().


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