MediaWiki REL1_33
|
Public Member Functions | |
__construct ( $obj, 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) | |
getRollback (RecentChange $rc) | |
getTags (RecentChange $rc, array &$classes) | |
getTimestamp ( $rc) | |
Get the timestamp from $rc formatted with current user's settings and a separator. | |
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) | |
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 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. | |
getConfig () | |
getContext () | |
Get the base IContextSource object. | |
getLanguage () | |
getOutput () | |
getRequest () | |
getSkin () | |
getStats () | |
getTiming () | |
getTitle () | |
getUser () | |
getWikiPage () | |
Get the WikiPage object. | |
msg ( $key) | |
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 (Revision $rev, User $user, Language $lang, $title=null) |
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, User $user=null) |
Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted. | |
Public Attributes | |
Skin | $skin |
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 |
array | $filterGroups |
$lastdate | |
LinkRenderer | $linkRenderer |
$message | |
$rc_cache | |
$rcCacheIndex | |
$rclistOpen | |
$rcMoveIndex | |
$watchlist = false | |
MapCacheLRU | $watchMsgCache |
Private Member Functions | |
preCacheMessages () | |
As we use the same small set of messages in various methods and that they are called often, we call them once and save them in $this->message. | |
Definition at line 28 of file ChangesList.php.
ChangesList::__construct | ( | $obj, | |
array | $filterGroups = [] ) |
Skin | IContextSource | $obj | |
array | $filterGroups | Array of ChangesListFilterGroup objects (currently optional) |
Reimplemented in EnhancedChangesList.
Definition at line 64 of file ChangesList.php.
References $filterGroups, and(), preCacheMessages(), and ContextSource\setContext().
ChangesList::beginRecentChangesList | ( | ) |
Returns text for the start of the tabular part of RC.
Reimplemented in EnhancedChangesList.
Definition at line 286 of file ChangesList.php.
References ContextSource\getOutput().
ChangesList::endRecentChangesList | ( | ) |
Returns text for the end of RC.
Reimplemented in EnhancedChangesList.
Definition at line 391 of file ChangesList.php.
References $out.
|
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 "!".
string | $flag | One key of $wgRecentChangesFlags |
IContextSource | null | $context |
Definition at line 253 of file ChangesList.php.
References ContextSource\$context, $value, $wgRecentChangesFlags, and(), ContextSource\setContext(), text, and wfMessage().
Referenced by SpecialUndelete\diffHeader(), DeletedContribsPager\formatRevisionRow(), SpecialUndelete\formatRevisionRow(), ContribsPager\formatRow(), HistoryPager\historyLine(), recentChangesFlags(), and DifferenceEngine\showDiffPage().
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 371 of file ChangesList.php.
References ContextSource\getContext(), and showCharacterDifference().
Referenced by OldChangesList\formatChangeLine(), EnhancedChangesList\getLineData(), EnhancedChangesList\recentChangesBlockGroup(), and EnhancedChangesList\recentChangesBlockLine().
ChangesList::getArticleLink | ( | & | $rc, |
$unpatrolled, | |||
$watched ) |
RecentChange | &$rc | |
bool | $unpatrolled | |
bool | $watched |
Definition at line 515 of file ChangesList.php.
References $changesList, $params, $s, and(), Revision\DELETED_TEXT, ContextSource\getLanguage(), and isDeleted().
Referenced by OldChangesList\formatChangeLine(), EnhancedChangesList\recentChangesBlockGroup(), and EnhancedChangesList\recentChangesBlockLine().
|
protected |
Get recommended data attributes for a change line.
RecentChange | $rc |
Definition at line 817 of file ChangesList.php.
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 122 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 197 of file ChangesList.php.
References and(), and 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 228 of file ChangesList.php.
References $filter.
Referenced by getHTMLClasses(), and EnhancedChangesList\recentChangesBlockGroup().
ChangesList::getRollback | ( | RecentChange | $rc | ) |
RecentChange | $rc |
Definition at line 722 of file ChangesList.php.
References $s, and insertRollback().
Referenced by EnhancedChangesList\getLineData(), and EnhancedChangesList\recentChangesBlockLine().
ChangesList::getTags | ( | RecentChange | $rc, |
array & | $classes ) |
RecentChange | $rc | |
array | &$classes |
Definition at line 753 of file ChangesList.php.
References $s, and insertTags().
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 553 of file ChangesList.php.
References and(), and ContextSource\getLanguage().
Referenced by insertTimestamp().
ChangesList::initChangesListRows | ( | $rows | ) |
ResultWrapper | array | $rows |
Definition at line 303 of file ChangesList.php.
References $rows.
ChangesList::insertComment | ( | $rc | ) |
Insert a formatted comment.
RecentChange | $rc |
Definition at line 615 of file ChangesList.php.
References Linker\commentBlock(), Revision\DELETED_COMMENT, isDeleted(), and ContextSource\msg().
Referenced by OldChangesList\formatChangeLine(), EnhancedChangesList\getLineData(), and EnhancedChangesList\recentChangesBlockLine().
ChangesList::insertDateHeader | ( | & | $s, |
$rc_timestamp ) |
string | &$s | HTML to update |
mixed | $rc_timestamp |
Definition at line 432 of file ChangesList.php.
References $s, ContextSource\getLanguage(), and 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 463 of file ChangesList.php.
References $query, $s, and(), Revision\DELETED_TEXT, ContextSource\getUser(), RC_CATEGORIZE, RC_LOG, and RC_NEW.
Referenced by OldChangesList\formatChangeLine().
ChangesList::insertExtra | ( | & | $s, |
& | $rc, | ||
& | $classes ) |
Definition at line 759 of file ChangesList.php.
Referenced by OldChangesList\formatChangeLine().
ChangesList::insertLog | ( | & | $s, |
$title, | |||
$logtype ) |
string | &$s | HTML to update |
Title | $title | |
string | $logtype |
Definition at line 450 of file ChangesList.php.
References $s, ContextSource\getContext(), and ContextSource\msg().
Referenced by OldChangesList\formatChangeLine().
ChangesList::insertLogEntry | ( | $rc | ) |
Insert a formatted action.
RecentChange | $rc |
Definition at line 601 of file ChangesList.php.
References ContextSource\getContext(), ContextSource\getLanguage(), and LogFormatter\newFromRow().
Referenced by OldChangesList\formatChangeLine(), EnhancedChangesList\getLineData(), and EnhancedChangesList\recentChangesBlockLine().
ChangesList::insertRollback | ( | & | $s, |
& | $rc ) |
Insert a rollback link.
string | &$s | |
RecentChange | &$rc |
Definition at line 694 of file ChangesList.php.
References $rev, $s, Linker\generateRollback(), ContextSource\getContext(), and RC_EDIT.
Referenced by OldChangesList\formatChangeLine(), and getRollback().
ChangesList::insertTags | ( | & | $s, |
& | $rc, | ||
& | $classes ) |
string | &$s | |
RecentChange | &$rc | |
array | &$classes |
Definition at line 733 of file ChangesList.php.
References $s, and(), ChangeTags\formatSummaryRow(), and list.
Referenced by OldChangesList\formatChangeLine(), and getTags().
ChangesList::insertTimestamp | ( | & | $s, |
$rc ) |
Insert time timestamp string from $rc into $s.
string | &$s | HTML to update |
RecentChange | $rc |
Definition at line 568 of file ChangesList.php.
References $s, and getTimestamp().
Referenced by OldChangesList\formatChangeLine().
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 578 of file ChangesList.php.
References $s, Revision\DELETED_USER, ContextSource\getLanguage(), isDeleted(), ContextSource\msg(), Linker\userLink(), and Linker\userToolLinks().
Referenced by OldChangesList\formatChangeLine().
|
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 807 of file ChangesList.php.
References and(), and RC_CATEGORIZE.
Referenced by OldChangesList\formatChangeLine(), 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 655 of file ChangesList.php.
References and().
Referenced by getArticleLink(), EnhancedChangesList\getLineData(), RCCacheEntryFactory\getUserLink(), insertComment(), insertUserRelatedLinks(), RCCacheEntryFactory\newFromRecentChange(), and EnhancedChangesList\recentChangesBlockGroup().
|
static |
object | RecentChange | $rc | Database row from recentchanges or a RecentChange object |
User | $user |
Definition at line 772 of file ChangesList.php.
References RC_NEW.
Referenced by ApiQueryWatchlist\extractOutputData(), ApiQueryRecentChanges\extractRowInfo(), RCCacheEntryFactory\newFromRecentChange(), and showAsUnpatrolled().
ChangesList::isWatchlist | ( | ) |
Definition at line 153 of file ChangesList.php.
References $watchlist.
|
protected |
string | $link | |
bool | $watched |
Definition at line 680 of file ChangesList.php.
References $link.
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 86 of file ChangesList.php.
References ContextSource\$context, IContextSource\getRequest(), IContextSource\getSkin(), and IContextSource\getUser().
Referenced by SpecialRecentChanges\outputChangesList(), and SpecialWatchlist\outputChangesList().
|
protected |
Returns the string which indicates the number of watching users.
int | $count | Number of user watching a page |
Definition at line 635 of file ChangesList.php.
References ContextSource\msg().
Referenced by OldChangesList\formatChangeLine(), EnhancedChangesList\recentChangesBlockGroup(), and EnhancedChangesList\recentChangesBlockLine().
|
private |
As we use the same small set of messages in various methods and that they are called often, we call them once and save them in $this->message.
Definition at line 161 of file ChangesList.php.
References and(), and ContextSource\msg().
Referenced by __construct().
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 178 of file ChangesList.php.
References $f, and(), flag(), ContextSource\getConfig(), and ContextSource\getContext().
Referenced by OldChangesList\formatChangeLine(), 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 112 of file ChangesList.php.
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.
Revision | $rev | |
User | $user | |
Language | $lang | |
Title | null | $title | (optional) where Title does not match the Title associated with the Revision |
Definition at line 409 of file ChangesList.php.
References $lang, $link, $rev, and(), and Revision\DELETED_TEXT.
Referenced by ContribsPager\formatRow(), and HistoryPager\revLink().
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 845 of file ChangesList.php.
References and().
ChangesList::setWatchlistDivs | ( | $value = true | ) |
Sets the list to use a "<li class='watchlist-(namespace)-(page)'>" tag.
bool | $value |
Definition at line 145 of file ChangesList.php.
References $value.
|
protected |
Definition at line 763 of file ChangesList.php.
References ContextSource\getUser(), and isUnpatrolled().
Referenced by OldChangesList\formatChangeLine().
|
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 317 of file ChangesList.php.
References $code, ContextSource\$context, $lang, and(), IContextSource\getConfig(), IContextSource\getLanguage(), and MessageLocalizer\msg().
Referenced by formatCharacterDifference(), ContribsPager\formatRow(), RecentChange\getCharacterDifference(), and HistoryPager\historyLine().
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 | |
User | null | $user | User object to check, or null to use $wgUser |
Definition at line 667 of file ChangesList.php.
References RC_LOG, LogEventsList\userCanBitfield(), and Revision\userCanBitfield().
Referenced by EnhancedChangesList\getLineData(), EnhancedChangesList\getLogText(), and RCCacheEntryFactory\showDiffLinks().
|
protected |
Definition at line 45 of file ChangesList.php.
|
protected |
Definition at line 58 of file ChangesList.php.
Referenced by __construct(), and EnhancedChangesList\__construct().
|
protected |
Definition at line 37 of file ChangesList.php.
|
protected |
Definition at line 53 of file ChangesList.php.
|
protected |
Definition at line 38 of file ChangesList.php.
|
protected |
Definition at line 39 of file ChangesList.php.
|
protected |
Definition at line 40 of file ChangesList.php.
|
protected |
Definition at line 41 of file ChangesList.php.
|
protected |
Definition at line 42 of file ChangesList.php.
Skin ChangesList::$skin |
Definition at line 34 of file ChangesList.php.
|
protected |
Definition at line 36 of file ChangesList.php.
Referenced by isWatchlist().
|
protected |
Definition at line 48 of file ChangesList.php.
const ChangesList::CSS_CLASS_PREFIX = 'mw-changeslist-' |
Definition at line 29 of file ChangesList.php.
Referenced by ChangesListFilter\getCssClass().