Go to the documentation of this file.
96 if ( !isset( $this->
message ) ) {
98 'cur',
'diff',
'hist',
'enhancedrc-history',
'last',
'blocklink',
'history',
99 'semicolon-separator',
'pipe-separator' )
as $msg
101 $this->
message[$msg] = $this->
msg( $msg )->escaped();
113 global $wgRecentChangesFlags;
115 foreach ( array_keys( $wgRecentChangesFlags )
as $flag ) {
133 public static function flag( $flag ) {
134 static $flagInfos =
null;
135 if ( is_null( $flagInfos ) ) {
136 global $wgRecentChangesFlags;
137 $flagInfos =
array();
138 foreach ( $wgRecentChangesFlags
as $key =>
$value ) {
149 'minoredit' =>
'minor',
152 if ( isset( $map[$flag] ) ) {
156 return "<abbr class='" . $flagInfos[$flag][
'class'] .
"' title='" .
157 $flagInfos[$flag][
'title'] .
"'>" . $flagInfos[$flag][
'letter'] .
166 $this->rc_cache =
array();
167 $this->rcMoveIndex = 0;
168 $this->rcCacheIndex = 0;
169 $this->lastdate =
'';
170 $this->rclistOpen =
false;
171 $this->
getOutput()->addModuleStyles(
'mediawiki.special.changeslist' );
173 return '<div class="mw-changeslist">';
191 global $wgRCChangedSizeThreshold, $wgMiserMode;
199 $szdiff = $new - $old;
202 $code = $lang->getCode();
203 static $fastCharDiff =
array();
204 if ( !isset( $fastCharDiff[$code] ) ) {
205 $fastCharDiff[$code] = $wgMiserMode ||
$context->
msg(
'rc-change-size' )->plain() ===
'$1';
208 $formattedSize = $lang->formatNum( $szdiff );
210 if ( !$fastCharDiff[$code] ) {
211 $formattedSize =
$context->
msg(
'rc-change-size', $formattedSize )->text();
214 if ( abs( $szdiff ) > abs( $wgRCChangedSizeThreshold ) ) {
220 if ( $szdiff === 0 ) {
221 $formattedSizeClass =
'mw-plusminus-null';
222 } elseif ( $szdiff > 0 ) {
223 $formattedSize =
'+' . $formattedSize;
224 $formattedSizeClass =
'mw-plusminus-pos';
226 $formattedSizeClass =
'mw-plusminus-neg';
229 $formattedTotalSize =
$context->
msg(
'rc-change-size-new' )->numParams( $new )->text();
232 array(
'dir' =>
'ltr',
'class' => $formattedSizeClass,
'title' => $formattedTotalSize ),
233 $context->
msg(
'parentheses', $formattedSize )->plain() ) . $lang->getDirMark();
244 $oldlen = $old->mAttribs[
'rc_old_len'];
247 $newlen = $new->mAttribs[
'rc_new_len'];
249 $newlen = $old->mAttribs[
'rc_new_len'];
252 if ( $oldlen ===
null || $newlen ===
null ) {
264 $out = $this->rclistOpen ?
"</ul>\n" :
'';
275 # Make date header if necessary
277 if ( $date != $this->lastdate ) {
278 if ( $this->lastdate !=
'' ) {
281 $s .=
Xml::element(
'h4',
null, $date ) .
"\n<ul class=\"special\">";
282 $this->lastdate = $date;
283 $this->rclistOpen =
true;
293 $page =
new LogPage( $logtype );
294 $logname = $page->getName()->escaped();
305 if ( $rc->mAttribs[
'rc_type'] ==
RC_NEW || $rc->mAttribs[
'rc_type'] ==
RC_LOG ) {
306 $diffLink = $this->
message[
'diff'];
308 $diffLink = $this->
message[
'diff'];
311 'curid' => $rc->mAttribs[
'rc_cur_id'],
312 'diff' => $rc->mAttribs[
'rc_this_oldid'],
313 'oldid' => $rc->mAttribs[
'rc_last_oldid']
319 array(
'tabindex' => $rc->counter ),
323 $diffhist = $diffLink . $this->
message[
'pipe-separator'];
330 'curid' => $rc->mAttribs[
'rc_cur_id'],
331 'action' =>
'history'
335 $s .= $this->
msg(
'parentheses' )->rawParams( $diffhist )->escaped() .
336 ' <span class="mw-changeslist-separator">. .</span> ';
351 array(
'class' =>
'mw-changeslist-title' ),
355 $articlelink =
'<span class="history-deleted">' . $articlelink .
'</span>';
357 # To allow for boldening pages watched by this user
358 $articlelink =
"<span class=\"mw-title\">{$articlelink}</span>";
360 $articlelink .= $this->
getLanguage()->getDirMark();
363 array( &$this, &$articlelink, &
$s, &$rc, $unpatrolled, $watched ) );
365 $s .=
" $articlelink";
377 return $this->
message[
'semicolon-separator'] .
'<span class="mw-changeslist-date">' .
379 $rc->mAttribs[
'rc_timestamp'],
381 ) .
'</span> <span class="mw-changeslist-separator">. .</span> ';
402 $s .=
' <span class="history-deleted">' .
403 $this->
msg(
'rev-deleted-user' )->escaped() .
'</span>';
406 $rc->mAttribs[
'rc_user_text'] );
419 $formatter->setContext( $this->
getContext() );
420 $formatter->setShowUserToolLinks(
true );
423 return $formatter->getActionText() .
" $mark" . $formatter->getComment();
434 return ' <span class="history-deleted">' .
435 $this->
msg(
'rev-deleted-comment' )->escaped() .
'</span>';
468 ->numParams( $count )->escaped();
483 public static function isDeleted( $rc, $field ) {
484 return ( $rc->mAttribs[
'rc_deleted'] & $field ) == $field;
496 if ( $rc->mAttribs[
'rc_type'] ==
RC_LOG ) {
510 return '<strong class="mw-watched">' .
$link .
'</strong>';
512 return '<span class="mw-rc-unwatched">' .
$link .
'</span>';
522 if ( $rc->mAttribs[
'rc_type'] ==
RC_EDIT
523 && $rc->mAttribs[
'rc_this_oldid']
524 && $rc->mAttribs[
'rc_cur_id']
526 $page = $rc->getTitle();
529 if ( $this->
getUser()->isAllowed(
'rollback' )
530 && $rc->mAttribs[
'page_latest'] == $rc->mAttribs[
'rc_this_oldid']
534 'id' => $rc->mAttribs[
'rc_this_oldid'],
535 'user' => $rc->mAttribs[
'rc_user'],
536 'user_text' => $rc->mAttribs[
'rc_user_text'],
537 'deleted' => $rc->mAttribs[
'rc_deleted']
550 if ( empty( $rc->mAttribs[
'ts_tags'] ) ) {
555 $rc->mAttribs[
'ts_tags'],
558 $classes = array_merge( $classes, $newClasses );
559 $s .=
' ' . $tagSummary;
577 $isPatrolled = $rc->mAttribs[
'rc_patrolled'];
578 $rcType = $rc->mAttribs[
'rc_type'];
580 $isPatrolled = $rc->rc_patrolled;
581 $rcType = $rc->rc_type;
584 if ( !$isPatrolled ) {
585 if (
$user->useRCPatrol() ) {
endRecentChangesList()
Returns text for the end of RC.
static generateRollback( $rev, IContextSource $context=null, $options=array( 'verify'))
Generate a rollback link for a given revision.
getContext()
Get the RequestContext object.
static commentBlock( $comment, $title=null, $local=false)
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty strin...
insertComment( $rc)
Insert a formatted comment.
setWatchlistDivs( $value=true)
Sets the list to use a "<li class='watchlist-(namespace)-(page)'>" tag.
static newFromContext(IContextSource $context)
Fetch an appropriate changes list class for the specified context Some users might want to use an enh...
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
msg()
Get a Message object with context set Parameters are the same as wfMessage()
getSkin()
Get the Skin object.
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
static usePatrol()
Check whether to enable recent changes patrol features.
Utility class for creating new RC entries.
const RC_MOVE_OVER_REDIRECT
maybeWatchedLink( $link, $watched=false)
insertLog(&$s, $title, $logtype)
msg()
Get a Message object with context set.
static escapeClass( $class)
Given a value, escape it so that it can be used as a CSS class and return it.
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this revision,...
__construct( $obj)
Changeslist constructor.
formatCharacterDifference(RecentChange $old, RecentChange $new=null)
Format the character difference of one or several changes.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
getUser()
Get the User object.
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
static isDeleted( $rc, $field)
Determine if said field of a revision is hidden.
static flag( $flag)
Provide the "<abbr>" element appropriate to a given abbreviated flag, namely the flag indicating a ne...
getLanguage()
Get the Language object.
insertDateHeader(&$s, $rc_timestamp)
insertArticleLink(&$s, &$rc, $unpatrolled, $watched)
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
insertLogEntry( $rc)
Insert a formatted action.
getOutput()
Get the OutputPage object.
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
insertTags(&$s, &$rc, &$classes)
Class to simplify the use of log pages.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
getSkin()
Get the Skin object.
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
insertUserRelatedLinks(&$s, &$rc)
Insert links to user page, user talk page and eventually a blocking link.
setContext(IContextSource $context)
Set the IContextSource object.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
presenting them properly to the user as errors is done by the caller $title
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a skin(according to that user 's preference)
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
insertTimestamp(&$s, $rc)
Insert time timestamp string from $rc into $s.
numberofWatchingusers( $count)
Returns the string which indicates the number of watching users.
showAsUnpatrolled(RecentChange $rc)
static showCharacterDifference( $old, $new, IContextSource $context=null)
Show formatted char difference.
getUser()
Get the User object.
preCacheMessages()
As we use the same small set of messages in various methods and that they are called often,...
static getMain()
Static methods.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Interface for objects which can provide a context on request.
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
beginRecentChangesList()
Returns text for the start of the tabular part of RC.
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
initChangesListRows( $rows)
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
recentChangesFlags( $flags, $nothing=' ')
Returns the appropriate flags for new page, minor change and patrolling.
getTimestamp( $rc)
Get the timestamp from $rc formatted with current user's settings and a separator.
getRequest()
Get the WebRequest object.
static isUnpatrolled( $rc, User $user)
The main skin class which provides methods and properties for all other skins.
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a message
static userCan( $rc, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this revision,...
insertExtra(&$s, &$rc, &$classes)
insertRollback(&$s, &$rc)
Inserts a rollback link.
getLanguage()
Get the Language object.
insertDiffHist(&$s, &$rc, $unpatrolled)