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

Public Member Functions

 __construct ( $obj, array $filterGroups=[])
 
 beginRecentChangesList ()
 Add the JavaScript file for enhanced changeslist. More...
 
 endRecentChangesList ()
 Returns text for the end of RC If enhanced RC is in use, returns pretty much all the text. More...
 
 getDiffHistLinks (RCCacheEntry $rc, array $query, $useParentheses=true)
 Returns value to be used in 'historyLink' element of $data param in EnhancedChangesListModifyBlockLineData hook. More...
 
 recentChangesLine (&$rc, $watched=false, $linenumber=null)
 Format a line for enhanced recentchange (aka with javascript and block of lines). More...
 
- Public Member Functions inherited from ChangesList
 __construct ( $obj, array $filterGroups=[])
 
 beginRecentChangesList ()
 Returns text for the start of the tabular part of RC. More...
 
 endRecentChangesList ()
 Returns text for the end of RC. More...
 
 formatCharacterDifference (RecentChange $old, RecentChange $new=null)
 Format the character difference of one or several changes. More...
 
 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. More...
 
 initChangesListRows ( $rows)
 
 insertComment ( $rc)
 Insert a formatted comment. More...
 
 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. More...
 
 insertRollback (&$s, &$rc)
 Insert a rollback link. More...
 
 insertTags (&$s, &$rc, &$classes)
 
 insertTimestamp (&$s, $rc)
 Insert time timestamp string from $rc into $s. More...
 
 insertUserRelatedLinks (&$s, &$rc)
 Insert links to user page, user talk page and eventually a blocking link. More...
 
 isWatchlist ()
 
 recentChangesFlags ( $flags, $nothing="\00A0}")
 Returns the appropriate flags for new page, minor change and patrolling. More...
 
 recentChangesLine (&$rc, $watched=false, $linenumber=null)
 Format a line. More...
 
 setChangeLinePrefixer (callable $prefixer)
 Sets the callable that generates a change line prefix added to the beginning of each line. More...
 
 setWatchlistDivs ( $value=true)
 Sets the list to use a "<li class='watchlist-(namespace)-(page)'>" tag. 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 ()
 
 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)
 

Protected Member Functions

 addCacheEntry (RCCacheEntry $cacheEntry)
 Put accumulated information into the cache, for later display. More...
 
 getLineData (array $block, RCCacheEntry $rcObj, array $queryParams=[])
 
 getLogText ( $block, $queryParams, $allLogs, $isnew, $namehidden)
 Generates amount of changes (linking to diff ) & link to history. More...
 
 makeCacheGroupingKey (RCCacheEntry $cacheEntry)
 
 recentChangesBlock ()
 If enhanced RC is in use, this function takes the previously cached RC lines, arranges them, and outputs the HTML. More...
 
 recentChangesBlockGroup ( $block)
 Enhanced RC group. More...
 
 recentChangesBlockLine ( $rcObj)
 Enhanced RC ungrouped line. More...
 
- Protected Member Functions inherited from ChangesList
 getDataAttributes (RecentChange $rc)
 Get recommended data attributes for a change line. More...
 
 getHighlightsContainerDiv ()
 Get the container for highlights that are used in the new StructuredFilters system. More...
 
 getHTMLClasses ( $rc, $watched)
 Get an array of default HTML class attributes for the change. More...
 
 getHTMLClassesForFilters ( $rc)
 Get an array of CSS classes attributed to filters for this row. More...
 
 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. More...
 
 maybeWatchedLink ( $link, $watched=false)
 
 numberofWatchingusers ( $count)
 Returns the string which indicates the number of watching users. More...
 
 showAsUnpatrolled (RecentChange $rc)
 

Protected Attributes

RCCacheEntryFactory $cacheEntryFactory
 
array $rc_cache
 Array of array of RCCacheEntry. More...
 
TemplateParser $templateParser
 
- Protected Attributes inherited from ChangesList
callable $changeLinePrefixer
 
array $filterGroups
 
 $lastdate
 
LinkRenderer $linkRenderer
 
 $message
 
 $rc_cache
 
 $rcCacheIndex
 
 $rclistOpen
 
 $rcMoveIndex
 
 $watchlist = false
 
MapCacheLRU $watchMsgCache
 

Additional Inherited Members

- Static Public Member Functions inherited from ChangesList
static flag ( $flag, IContextSource $context=null)
 Make an "<abbr>" element for a given change flag. More...
 
static isDeleted ( $rc, $field)
 Determine if said field of a revision is hidden. More...
 
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. More...
 
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. More...
 
static showCharacterDifference ( $old, $new, IContextSource $context=null)
 Show formatted char difference. More...
 
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. More...
 
- Public Attributes inherited from ChangesList
Skin $skin
 
const CSS_CLASS_PREFIX = 'mw-changeslist-'
 

Detailed Description

Definition at line 26 of file EnhancedChangesList.php.

Constructor & Destructor Documentation

◆ __construct()

EnhancedChangesList::__construct (   $obj,
array  $filterGroups = [] 
)
Parameters
IContextSource | Skin$obj
array$filterGroupsArray of ChangesListFilterGroup objects (currently optional)
Exceptions
MWException

Definition at line 48 of file EnhancedChangesList.php.

References ContextSource\$context, and ChangesList\$filterGroups.

Member Function Documentation

◆ addCacheEntry()

EnhancedChangesList::addCacheEntry ( RCCacheEntry  $cacheEntry)
protected

Put accumulated information into the cache, for later display.

Page moves go on their own line.

Parameters
RCCacheEntry$cacheEntry

Definition at line 135 of file EnhancedChangesList.php.

References makeCacheGroupingKey().

Referenced by recentChangesLine().

◆ beginRecentChangesList()

EnhancedChangesList::beginRecentChangesList ( )

Add the JavaScript file for enhanced changeslist.

Returns
string

Definition at line 76 of file EnhancedChangesList.php.

References ContextSource\getOutput().

◆ endRecentChangesList()

EnhancedChangesList::endRecentChangesList ( )

Returns text for the end of RC If enhanced RC is in use, returns pretty much all the text.

Returns
string

Definition at line 843 of file EnhancedChangesList.php.

References recentChangesBlock().

◆ getDiffHistLinks()

EnhancedChangesList::getDiffHistLinks ( RCCacheEntry  $rc,
array  $query,
  $useParentheses = true 
)

Returns value to be used in 'historyLink' element of $data param in EnhancedChangesListModifyBlockLineData hook.

Since
1.27
Parameters
RCCacheEntry$rc
array$queryarray of key/value pairs to append as a query string
bool$useParentheses(optional) Wrap comments in parentheses where needed
Returns
string HTML

Definition at line 780 of file EnhancedChangesList.php.

References RecentChange\getAttribute(), RecentChange\getTitle(), ContextSource\msg(), Title\newFromID(), Html\rawElement(), and RC_CATEGORIZE.

Referenced by recentChangesBlockLine().

◆ getLineData()

◆ getLogText()

EnhancedChangesList::getLogText (   $block,
  $queryParams,
  $allLogs,
  $isnew,
  $namehidden 
)
protected

Generates amount of changes (linking to diff ) & link to history.

Parameters
RCCacheEntry[]$block
array$queryParams
bool$allLogs
bool$isnew
bool$namehidden
Returns
string

Definition at line 513 of file EnhancedChangesList.php.

References ContextSource\msg(), Html\rawElement(), RC_CATEGORIZE, Hooks\run(), and ChangesList\userCan().

Referenced by recentChangesBlockGroup().

◆ makeCacheGroupingKey()

EnhancedChangesList::makeCacheGroupingKey ( RCCacheEntry  $cacheEntry)
protected
Todo:
use rc_source to group, if set; fallback to rc_type
Parameters
RCCacheEntry$cacheEntry
Returns
string

Definition at line 152 of file EnhancedChangesList.php.

References $title, $type, RecentChange\getTitle(), SpecialPage\getTitleFor(), and RC_LOG.

Referenced by addCacheEntry().

◆ recentChangesBlock()

EnhancedChangesList::recentChangesBlock ( )
protected

If enhanced RC is in use, this function takes the previously cached RC lines, arranges them, and outputs the HTML.

Returns
string

Definition at line 817 of file EnhancedChangesList.php.

References Xml\element(), recentChangesBlockGroup(), and recentChangesBlockLine().

Referenced by endRecentChangesList(), and recentChangesLine().

◆ recentChangesBlockGroup()

◆ recentChangesBlockLine()

◆ recentChangesLine()

EnhancedChangesList::recentChangesLine ( $rc,
  $watched = false,
  $linenumber = null 
)

Format a line for enhanced recentchange (aka with javascript and block of lines).

Parameters
RecentChange&$rc
bool$watched
int | null$linenumber(default null)
Returns
string

Definition at line 104 of file EnhancedChangesList.php.

References addCacheEntry(), ContextSource\getLanguage(), and recentChangesBlock().

Member Data Documentation

◆ $cacheEntryFactory

RCCacheEntryFactory EnhancedChangesList::$cacheEntryFactory
protected

Definition at line 31 of file EnhancedChangesList.php.

◆ $rc_cache

array EnhancedChangesList::$rc_cache
protected

Array of array of RCCacheEntry.

Definition at line 36 of file EnhancedChangesList.php.

◆ $templateParser

TemplateParser EnhancedChangesList::$templateParser
protected

Definition at line 41 of file EnhancedChangesList.php.


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