MediaWiki master
|
Base class for lists of recent changes shown on special pages. More...
Inherits MediaWiki\Context\ContextSource.
Inherited by EnhancedChangesList, and OldChangesList.
Public Member Functions | |
__construct ( $context, array $filterGroups=[]) | |
beginRecentChangesList () | |
Returns text for the start of the tabular part of RC. | |
endRecentChangesList () | |
Returns text for the end of RC. | |
formatCharacterDifference (RecentChange $old, RecentChange $new=null) | |
Format the character difference of one or several changes. | |
getArticleLink (&$rc, $unpatrolled, $watched) | |
Get the HTML link to the changed page, possibly with a prefix from hook handlers, and a suffix for temporarily watched items. | |
getRollback (RecentChange $rc) | |
getTags (RecentChange $rc, array &$classes) | |
getTimestamp ( $rc) | |
Get the timestamp from $rc formatted with current user's settings and a separator. | |
getWatchlistExpiry (RecentChange $recentChange) | |
Get HTML to display the clock icon for watched items that have a watchlist expiry time. | |
initChangesListRows ( $rows) | |
insertComment ( $rc) | |
Insert a formatted comment. | |
insertDateHeader (&$s, $rc_timestamp) | |
insertDiffHist (&$s, &$rc, $unpatrolled=null) | |
insertExtra (&$s, &$rc, &$classes) | |
insertLog (&$s, $title, $logtype, $useParentheses=true) | |
insertLogEntry ( $rc) | |
Insert a formatted action. | |
insertRollback (&$s, &$rc) | |
Insert a rollback link. | |
insertTags (&$s, &$rc, &$classes) | |
insertTimestamp (&$s, $rc) | |
Insert time timestamp string from $rc into $s. | |
insertUserRelatedLinks (&$s, &$rc) | |
Insert links to user page, user talk page and eventually a blocking link. | |
isWatchlist () | |
recentChangesFlags ( $flags, $nothing="\u{00A0}") | |
Returns the appropriate flags for new page, minor change and patrolling. | |
recentChangesLine (&$rc, $watched=false, $linenumber=null) | |
Format a line. | |
setChangeLinePrefixer (callable $prefixer) | |
Sets the callable that generates a change line prefix added to the beginning of each line. | |
setWatchlistDivs ( $value=true) | |
Sets the list to use a "<li class='watchlist-(namespace)-(page)'>" tag. | |
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 | flag ( $flag, IContextSource $context=null) |
Make an "<abbr>" element for a given change flag. | |
static | isDeleted ( $rc, $field) |
Determine if said field of a revision is hidden. | |
static | isUnpatrolled ( $rc, User $user) |
static | newFromContext (IContextSource $context, array $groups=[]) |
Fetch an appropriate changes list class for the specified context Some users might want to use an enhanced list format, for instance. | |
static | revDateLink (RevisionRecord $rev, Authority $performer, Language $lang, $title=null, $className='') |
Render the date and time of a revision in the current user language based on whether the user is able to view this information or not. | |
static | showCharacterDifference ( $old, $new, IContextSource $context=null) |
Show formatted char difference. | |
static | userCan ( $rc, $field, Authority $performer=null) |
Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted. | |
Public Attributes | |
const | CSS_CLASS_PREFIX = 'mw-changeslist-' |
Protected Member Functions | |
getDataAttributes (RecentChange $rc) | |
Get recommended data attributes for a change line. | |
getHighlightsContainerDiv () | |
Get the container for highlights that are used in the new StructuredFilters system. | |
getHTMLClasses ( $rc, $watched) | |
Get an array of default HTML class attributes for the change. | |
getHTMLClassesForFilters ( $rc) | |
Get an array of CSS classes attributed to filters for this row. | |
isCategorizationWithoutRevision ( $rcObj) | |
Determines whether a revision is linked to this change; this may not be the case when the categorization wasn't done by an edit but a conditional parser function. | |
maybeWatchedLink ( $link, $watched=false) | |
numberofWatchingusers ( $count) | |
Returns the string which indicates the number of watching users. | |
showAsUnpatrolled (RecentChange $rc) | |
Protected Attributes | |
callable | $changeLinePrefixer |
RowCommentFormatter | $commentFormatter |
ChangesListFilterGroup[] | $filterGroups |
string[] | $formattedComments |
Comments indexed by rc_id. | |
string | $lastdate |
LinkRenderer | $linkRenderer |
string[] | $message |
array | $rc_cache |
int | $rcCacheIndex |
bool | $rclistOpen |
int | $rcMoveIndex |
MapCacheLRU | $tagsCache |
MapCacheLRU | $userLinkCache |
bool | $watchlist = false |
MapCacheLRU | $watchMsgCache |
Base class for lists of recent changes shown on special pages.
This is used via ChangesListSpecialPage by recent changes (SpecialRecentChanges), related changes (SpecialRecentChangesLinked), and watchlist (SpecialWatchlist).
Definition at line 52 of file ChangesList.php.
ChangesList::__construct | ( | $context, | |
array | $filterGroups = [] ) |
IContextSource | $context | |
ChangesListFilterGroup[] | $filterGroups | Array of ChangesListFilterGroup objects (currently optional) |
Reimplemented in EnhancedChangesList.
Definition at line 114 of file ChangesList.php.
References MediaWiki\Context\ContextSource\setContext().
ChangesList::beginRecentChangesList | ( | ) |
Returns text for the start of the tabular part of RC.
Reimplemented in EnhancedChangesList.
Definition at line 352 of file ChangesList.php.
References MediaWiki\Context\ContextSource\getOutput().
ChangesList::endRecentChangesList | ( | ) |
Returns text for the end of RC.
Reimplemented in EnhancedChangesList.
Definition at line 467 of file ChangesList.php.
|
static |
Make an "<abbr>" element for a given change flag.
The flag indicating a new page, minor edit, bot edit, or unpatrolled edit. In English it typically contains "N", "m", "b", or "!".
Styling for these flags is provided through mediawiki.interface.helpers.styles.
string | $flag | One key of $wgRecentChangesFlags |
IContextSource | null | $context |
Definition at line 318 of file ChangesList.php.
References MediaWiki\Context\ContextSource\setContext(), and wfMessage().
ChangesList::formatCharacterDifference | ( | RecentChange | $old, |
RecentChange | $new = null ) |
Format the character difference of one or several changes.
RecentChange | $old | |
RecentChange | null | $new | Last change to use, if not provided, $old will be used |
Definition at line 447 of file ChangesList.php.
References MediaWiki\Context\ContextSource\getContext().
Referenced by EnhancedChangesList\getLineData(), EnhancedChangesList\recentChangesBlockGroup(), and EnhancedChangesList\recentChangesBlockLine().
ChangesList::getArticleLink | ( | & | $rc, |
$unpatrolled, | |||
$watched ) |
Get the HTML link to the changed page, possibly with a prefix from hook handlers, and a suffix for temporarily watched items.
RecentChange | &$rc | |
bool | $unpatrolled | |
bool | $watched |
Definition at line 617 of file ChangesList.php.
References $params, MediaWiki\Context\ContextSource\getLanguage(), and getWatchlistExpiry().
Referenced by EnhancedChangesList\recentChangesBlockGroup(), and EnhancedChangesList\recentChangesBlockLine().
|
protected |
Get recommended data attributes for a change line.
RecentChange | $rc |
Definition at line 1046 of file ChangesList.php.
References RecentChange\getAttribute().
Referenced by EnhancedChangesList\getLineData(), EnhancedChangesList\recentChangesBlockLine(), and OldChangesList\recentChangesLine().
|
protected |
Get the container for highlights that are used in the new StructuredFilters system.
Definition at line 177 of file ChangesList.php.
Referenced by EnhancedChangesList\recentChangesBlockLine(), and OldChangesList\recentChangesLine().
|
protected |
Get an array of default HTML class attributes for the change.
RecentChange | RCCacheEntry | $rc | |
string | bool | $watched | Optionally timestamp for adding watched class |
Definition at line 255 of file ChangesList.php.
References getHTMLClassesForFilters().
Referenced by EnhancedChangesList\getLineData(), EnhancedChangesList\recentChangesBlockLine(), and OldChangesList\recentChangesLine().
|
protected |
Get an array of CSS classes attributed to filters for this row.
Used for highlighting in the front-end.
RecentChange | $rc |
Definition at line 286 of file ChangesList.php.
Referenced by getHTMLClasses(), and EnhancedChangesList\recentChangesBlockGroup().
ChangesList::getRollback | ( | RecentChange | $rc | ) |
RecentChange | $rc |
Definition at line 945 of file ChangesList.php.
Referenced by EnhancedChangesList\getLineData(), and EnhancedChangesList\recentChangesBlockLine().
ChangesList::getTags | ( | RecentChange | $rc, |
array & | $classes ) |
RecentChange | $rc | |
string[] | &$classes |
Definition at line 988 of file ChangesList.php.
Referenced by EnhancedChangesList\getLineData(), EnhancedChangesList\recentChangesBlockGroup(), and EnhancedChangesList\recentChangesBlockLine().
ChangesList::getTimestamp | ( | $rc | ) |
Get the timestamp from $rc formatted with current user's settings and a separator.
RecentChange | $rc |
Definition at line 694 of file ChangesList.php.
ChangesList::getWatchlistExpiry | ( | RecentChange | $recentChange | ) |
Get HTML to display the clock icon for watched items that have a watchlist expiry time.
RecentChange | $recentChange |
Definition at line 661 of file ChangesList.php.
References MediaWiki\Context\ContextSource\getUser().
Referenced by getArticleLink().
ChangesList::initChangesListRows | ( | $rows | ) |
IResultWrapper | stdClass[] | $rows |
Definition at line 369 of file ChangesList.php.
ChangesList::insertComment | ( | $rc | ) |
Insert a formatted comment.
RecentChange | $rc |
Definition at line 793 of file ChangesList.php.
Referenced by EnhancedChangesList\getLineData(), and EnhancedChangesList\recentChangesBlockLine().
ChangesList::insertDateHeader | ( | & | $s, |
$rc_timestamp ) |
string | &$s | HTML to update |
mixed | $rc_timestamp |
Definition at line 523 of file ChangesList.php.
References MediaWiki\Context\ContextSource\getLanguage(), and MediaWiki\Context\ContextSource\getUser().
Referenced by OldChangesList\recentChangesLine().
ChangesList::insertDiffHist | ( | & | $s, |
& | $rc, | ||
$unpatrolled = null ) |
string | &$s | HTML to update |
RecentChange | &$rc | |
bool | null | $unpatrolled | Unused variable, since 1.27. |
Definition at line 562 of file ChangesList.php.
References MediaWiki\Context\ContextSource\getAuthority(), RC_CATEGORIZE, RC_LOG, and RC_NEW.
ChangesList::insertExtra | ( | & | $s, |
& | $rc, | ||
& | $classes ) |
Definition at line 994 of file ChangesList.php.
ChangesList::insertLog | ( | & | $s, |
$title, | |||
$logtype, | |||
$useParentheses = true ) |
string | &$s | HTML to update |
Title | $title | |
string | $logtype | |
bool | $useParentheses | (optional) Wrap log entry in parentheses where needed |
Definition at line 542 of file ChangesList.php.
References MediaWiki\Context\ContextSource\getContext(), and MediaWiki\Context\ContextSource\msg().
ChangesList::insertLogEntry | ( | $rc | ) |
Insert a formatted action.
RecentChange | $rc |
Definition at line 769 of file ChangesList.php.
Referenced by EnhancedChangesList\getLineData(), and EnhancedChangesList\recentChangesBlockLine().
ChangesList::insertRollback | ( | & | $s, |
& | $rc ) |
Insert a rollback link.
string | &$s | |
RecentChange | &$rc |
Definition at line 891 of file ChangesList.php.
ChangesList::insertTags | ( | & | $s, |
& | $rc, | ||
& | $classes ) |
string | &$s | |
RecentChange | &$rc | |
string[] | &$classes |
Definition at line 956 of file ChangesList.php.
References ChangeTags\formatSummaryRow().
ChangesList::insertTimestamp | ( | & | $s, |
$rc ) |
Insert time timestamp string from $rc into $s.
string | &$s | HTML to update |
RecentChange | $rc |
Definition at line 721 of file ChangesList.php.
References getTimestamp().
ChangesList::insertUserRelatedLinks | ( | & | $s, |
& | $rc ) |
Insert links to user page, user talk page and eventually a blocking link.
string | &$s | HTML to update |
RecentChange | &$rc |
Definition at line 731 of file ChangesList.php.
|
protected |
Determines whether a revision is linked to this change; this may not be the case when the categorization wasn't done by an edit but a conditional parser function.
RecentChange | RCCacheEntry | $rcObj |
Definition at line 1036 of file ChangesList.php.
References RC_CATEGORIZE.
Referenced by EnhancedChangesList\getLineData(), and EnhancedChangesList\recentChangesBlockLine().
|
static |
Determine if said field of a revision is hidden.
RCCacheEntry | RecentChange | $rc | |
int | $field | One of DELETED_* bitfield constants |
Definition at line 849 of file ChangesList.php.
|
static |
stdClass | RecentChange | $rc | Database row from recentchanges or a RecentChange object |
User | $user |
Definition at line 1007 of file ChangesList.php.
References RC_NEW, MediaWiki\User\User\useFilePatrol(), MediaWiki\User\User\useNPPatrol(), and MediaWiki\User\User\useRCPatrol().
ChangesList::isWatchlist | ( | ) |
Definition at line 208 of file ChangesList.php.
|
protected |
string | $link | |
bool | $watched |
Definition at line 877 of file ChangesList.php.
Referenced by EnhancedChangesList\recentChangesBlockGroup().
|
static |
Fetch an appropriate changes list class for the specified context Some users might want to use an enhanced list format, for instance.
IContextSource | $context | |
array | $groups | Array of ChangesListFilterGroup objects (currently optional) |
Definition at line 136 of file ChangesList.php.
References MediaWiki\User\Options\UserOptionsLookup\getBoolOption(), MediaWiki\Context\IContextSource\getRequest(), MediaWiki\Context\IContextSource\getSkin(), and MediaWiki\Context\IContextSource\getUser().
|
protected |
Returns the string which indicates the number of watching users.
int | $count | Number of user watching a page |
Definition at line 824 of file ChangesList.php.
Referenced by EnhancedChangesList\recentChangesBlockGroup(), and EnhancedChangesList\recentChangesBlockLine().
ChangesList::recentChangesFlags | ( | $flags, | |
$nothing = "\u{00A0}" ) |
Returns the appropriate flags for new page, minor change and patrolling.
array | $flags | Associative array of 'flag' => Bool |
string | $nothing | To use for empty space |
Definition at line 234 of file ChangesList.php.
References MediaWiki\Context\ContextSource\getConfig(), and MediaWiki\Context\ContextSource\getContext().
Referenced by EnhancedChangesList\getLineData(), EnhancedChangesList\recentChangesBlockGroup(), and EnhancedChangesList\recentChangesBlockLine().
ChangesList::recentChangesLine | ( | & | $rc, |
$watched = false, | |||
$linenumber = null ) |
Format a line.
RecentChange | &$rc | Passed by reference |
bool | $watched | (default false) |
int | null | $linenumber | (default null) |
Reimplemented in EnhancedChangesList, and OldChangesList.
Definition at line 167 of file ChangesList.php.
|
static |
Render the date and time of a revision in the current user language based on whether the user is able to view this information or not.
RevisionRecord | $rev | |
Authority | $performer | |
Language | $lang | |
Title | null | $title | (optional) where Title does not match the Title associated with the RevisionRecord |
string | $className | (optional) to append to .mw-changelist-date element for access to the associated timestamp string. |
Definition at line 487 of file ChangesList.php.
References MediaWiki\Revision\RevisionRecord\getId(), MediaWiki\Revision\RevisionRecord\getPageAsLinkTarget(), MediaWiki\Revision\RevisionRecord\getTimestamp(), MediaWiki\Permissions\Authority\getUser(), MediaWiki\Revision\RevisionRecord\isDeleted(), and MediaWiki\Revision\RevisionRecord\userCan().
ChangesList::setChangeLinePrefixer | ( | callable | $prefixer | ) |
Sets the callable that generates a change line prefix added to the beginning of each line.
callable | $prefixer | Callable to run that generates the change line prefix. Takes three parameters: a RecentChange object, a ChangesList object, and whether the current entry is a grouped entry. |
Definition at line 1075 of file ChangesList.php.
ChangesList::setWatchlistDivs | ( | $value = true | ) |
Sets the list to use a "<li class='watchlist-(namespace)-(page)'>" tag.
bool | $value |
Definition at line 200 of file ChangesList.php.
|
protected |
Definition at line 998 of file ChangesList.php.
|
static |
Show formatted char difference.
Needs the css module 'mediawiki.special.changeslist' to style output
int | $old | Number of bytes |
int | $new | Number of bytes |
IContextSource | null | $context |
Definition at line 393 of file ChangesList.php.
|
static |
Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted.
RCCacheEntry | RecentChange | $rc | |
int | $field | |
Authority | null | $performer | to check permissions against. If null, the global RequestContext's User is assumed instead. |
Definition at line 862 of file ChangesList.php.
References RC_LOG.
Referenced by EnhancedChangesList\getLineData().
|
protected |
Definition at line 73 of file ChangesList.php.
|
protected |
Definition at line 86 of file ChangesList.php.
|
protected |
Definition at line 96 of file ChangesList.php.
Referenced by EnhancedChangesList\__construct().
|
protected |
Comments indexed by rc_id.
Definition at line 91 of file ChangesList.php.
|
protected |
Definition at line 60 of file ChangesList.php.
|
protected |
Definition at line 81 of file ChangesList.php.
|
protected |
Definition at line 62 of file ChangesList.php.
|
protected |
Definition at line 64 of file ChangesList.php.
|
protected |
Definition at line 66 of file ChangesList.php.
|
protected |
Definition at line 68 of file ChangesList.php.
|
protected |
Definition at line 70 of file ChangesList.php.
|
protected |
Definition at line 101 of file ChangesList.php.
|
protected |
Definition at line 106 of file ChangesList.php.
|
protected |
Definition at line 58 of file ChangesList.php.
|
protected |
Definition at line 76 of file ChangesList.php.
const ChangesList::CSS_CLASS_PREFIX = 'mw-changeslist-' |
Definition at line 55 of file ChangesList.php.