Go to the documentation of this file.
39 if ( $obj instanceof
Skin ) {
44 throw new MWException(
'EnhancedChangesList must be constructed with a '
45 .
'context source or skin.' );
65 $this->rc_cache =
array();
66 $this->rcMoveIndex = 0;
67 $this->rcCacheIndex = 0;
69 $this->rclistOpen =
false;
71 'mediawiki.special.changeslist',
72 'mediawiki.special.changeslist.enhanced',
75 'jquery.makeCollapsible',
79 return '<div class="mw-changeslist">';
93 # If it's a new day, add the headline and flush the cache
95 $baseRC->mAttribs[
'rc_timestamp'],
101 if ( $date != $this->lastdate ) {
102 # Process current cache
104 $this->rc_cache =
array();
106 $this->lastdate = $date;
109 $cacheEntry = $this->cacheEntryFactory->newFromRecentChange( $baseRC, $watched );
125 $secureName =
$title->getPrefixedDBkey();
127 $type = $cacheEntry->mAttribs[
'rc_type'];
130 # Use an @ character to prevent collision with page names
131 $this->rc_cache[
'@@' . ( $this->rcMoveIndex++ )] =
array( $cacheEntry );
133 # Logs are grouped by type
137 $cacheEntry->mAttribs[
'rc_log_type']
138 )->getPrefixedDBkey();
140 if ( !isset( $this->rc_cache[$secureName] ) ) {
141 $this->rc_cache[$secureName] =
array();
144 array_push( $this->rc_cache[$secureName], $cacheEntry );
154 global $wgRCShowChangedSize;
158 # Add the namespace and title of the block as part of the class
159 $classes =
array(
'mw-collapsible',
'mw-collapsed',
'mw-enhanced-rc' );
160 if ( $block[0]->mAttribs[
'rc_log_type'] ) {
163 . $block[0]->mAttribs[
'rc_log_type'] );
166 . $block[0]->mAttribs[
'rc_namespace'] .
'-' . $block[0]->mAttribs[
'rc_title'] );
168 $classes[] = $block[0]->watched && $block[0]->mAttribs[
'rc_timestamp'] >= $block[0]->watched
169 ?
'mw-changeslist-line-watched' :
'mw-changeslist-line-not-watched';
173 # Collate list of users
174 $userlinks =
array();
176 $unpatrolled =
false;
180 $curId = $currentRevision = 0;
181 # Some catalyst variables...
185 foreach ( $block
as $rcObj ) {
186 $oldid = $rcObj->mAttribs[
'rc_last_oldid'];
187 if ( $rcObj->mAttribs[
'rc_type'] ==
RC_NEW ) {
195 $u = $rcObj->userlink;
196 if ( !isset( $userlinks[$u] ) ) {
199 if ( $rcObj->unpatrolled ) {
202 if ( $rcObj->mAttribs[
'rc_type'] !=
RC_LOG ) {
205 # Get the latest entry with a page_id and oldid
206 # since logs may not have these.
207 if ( !$curId && $rcObj->mAttribs[
'rc_cur_id'] ) {
208 $curId = $rcObj->mAttribs[
'rc_cur_id'];
210 if ( !$currentRevision && $rcObj->mAttribs[
'rc_this_oldid'] ) {
211 $currentRevision = $rcObj->mAttribs[
'rc_this_oldid'];
214 if ( !$rcObj->mAttribs[
'rc_bot'] ) {
217 if ( !$rcObj->mAttribs[
'rc_minor'] ) {
224 # Sort the list and convert to text
225 krsort( $userlinks );
228 foreach ( $userlinks
as $userlink =>
$count ) {
234 $text .=
' ' . $this->
msg(
'parentheses' )->rawParams( $formattedCount )->escaped();
236 array_push( $users, $text );
239 $users =
' <span class="changedby">'
240 . $this->
msg(
'brackets' )->rawParams(
241 implode( $this->
message[
'semicolon-separator'], $users )
242 )->escaped() .
'</span>';
244 $tl =
'<span class="mw-collapsible-toggle mw-collapsible-arrow ' .
245 'mw-enhancedchanges-arrow mw-enhancedchanges-arrow-space"></span>';
246 $r .=
"<td>$tl</td>";
250 'newpage' => $isnew, # show, when one have
this flag
251 'minor' => $allMinors, # show
only, when all have
this flag
252 'unpatrolled' => $unpatrolled, # show, when one have
this flag
253 'bot' => $allBots, # show
only, when all have
this flag
257 $r .=
' ' . $block[0]->timestamp .
' </td><td>';
261 $r .=
' <span class="history-deleted">' .
262 $this->
msg(
'rev-deleted-event' )->escaped() .
'</span>';
263 } elseif ( $allLogs ) {
266 $this->
insertArticleLink( $r, $block[0], $block[0]->unpatrolled, $block[0]->watched );
271 $queryParams[
'curid'] = $curId;
274 static $nchanges =
array();
275 static $sinceLastVisitMsg =
array();
277 $n = count( $block );
278 if ( !isset( $nchanges[
$n] ) ) {
279 $nchanges[
$n] = $this->
msg(
'nchanges' )->numParams( $n )->escaped();
283 $unvisitedOldid =
null;
285 foreach ( $block
as $rcObj ) {
287 if ( $rcObj->watched && $rcObj->mAttribs[
'rc_timestamp'] >= $rcObj->watched ) {
289 $unvisitedOldid = $rcObj->mAttribs[
'rc_last_oldid'];
292 if ( !isset( $sinceLastVisitMsg[$sinceLast] ) ) {
293 $sinceLastVisitMsg[$sinceLast] =
294 $this->
msg(
'enhancedrc-since-last-visit' )->numParams( $sinceLast )->escaped();
304 $logtext .= $nchanges[
$n];
305 } elseif ( $isnew ) {
306 $logtext .= $nchanges[
$n];
312 $queryParams +
array(
313 'diff' => $currentRevision,
316 array(
'known',
'noclasses' )
318 if ( $sinceLast > 0 && $sinceLast <
$n ) {
321 $sinceLastVisitMsg[$sinceLast],
323 $queryParams +
array(
324 'diff' => $currentRevision,
325 'oldid' => $unvisitedOldid,
327 array(
'known',
'noclasses' )
336 } elseif ( $namehidden || !$block0->getTitle()->exists() ) {
337 $logtext .= $this->
message[
'pipe-separator'] . $this->
message[
'enhancedrc-history'];
342 $logtext .= $this->
message[
'pipe-separator'] .
345 $this->
message[
'enhancedrc-history'],
351 if ( $logtext !==
'' ) {
352 $r .= $this->
msg(
'parentheses' )->rawParams( $logtext )->escaped();
355 $r .=
' <span class="mw-changeslist-separator">. .</span> ';
357 # Character difference (does not apply if only log items)
358 if ( $wgRCShowChangedSize && !$allLogs ) {
360 $first = count( $block ) - 1;
361 # Some events (like logs) have an "empty" size, so we need to skip those...
362 while (
$last < $first && $block[
$last]->mAttribs[
'rc_new_len'] ===
null ) {
365 while ( $first >
$last && $block[$first]->mAttribs[
'rc_old_len'] ===
null ) {
371 if ( $chardiff ==
'' ) {
374 $r .=
' ' . $chardiff .
' <span class="mw-changeslist-separator">. .</span> ';
383 foreach ( $block
as $rcObj ) {
384 # Classes to apply -- TODO implement
386 $type = $rcObj->mAttribs[
'rc_type'];
388 $trClass = $rcObj->watched && $rcObj->mAttribs[
'rc_timestamp'] >= $rcObj->watched
389 ?
' class="mw-enhanced-watched"' :
'';
391 $r .=
'<tr' . $trClass .
'><td></td><td class="mw-enhanced-rc">';
394 'minor' => $rcObj->mAttribs[
'rc_minor'],
395 'unpatrolled' => $rcObj->unpatrolled,
396 'bot' => $rcObj->mAttribs[
'rc_bot'],
398 $r .=
' </td><td class="mw-enhanced-rc-nested"><span class="mw-enhanced-rc-time">';
402 if ( $rcObj->mAttribs[
'rc_this_oldid'] != 0 ) {
403 $params[
'oldid'] = $rcObj->mAttribs[
'rc_this_oldid'];
408 $link = $rcObj->timestamp;
411 $link =
'<span class="history-deleted">' . $rcObj->timestamp .
'</span> ';
421 $link =
'<span class="history-deleted">' .
$link .
'</span> ';
424 $r .=
$link .
'</span>';
427 $r .=
' ' . $this->
msg(
'parentheses' )->rawParams(
429 $this->message[
'pipe-separator'] .
433 $r .=
' <span class="mw-changeslist-separator">. .</span> ';
436 if ( $wgRCShowChangedSize ) {
439 $r .= $cd .
' <span class="mw-changeslist-separator">. .</span> ';
443 if ( $rcObj->mAttribs[
'rc_type'] ==
RC_LOG ) {
447 $r .= $rcObj->userlink;
448 $r .= $rcObj->usertalklink;
457 $r .=
"</td></tr>\n";
461 $this->rcCacheIndex++;
477 $encUrl = htmlspecialchars( $wgStylePath .
'/common/images/Arr_' .
$dir .
'.png' );
478 $encAlt = htmlspecialchars( $alt );
479 $encTitle = htmlspecialchars(
$title );
481 return "<img src=\"$encUrl\" width=\"12\" height=\"12\" alt=\"$encAlt\" title=\"$encTitle\" />";
492 return $this->
arrow(
$dir,
'+', $this->
msg(
'rc-enhanced-expand' )->
text() );
501 return $this->
arrow(
'd',
'-', $this->
msg(
'rc-enhanced-hide' )->
text() );
519 global $wgRCShowChangedSize;
522 $query[
'curid'] = $rcObj->mAttribs[
'rc_cur_id'];
524 $type = $rcObj->mAttribs[
'rc_type'];
525 $logType = $rcObj->mAttribs[
'rc_log_type'];
526 $classes =
array(
'mw-enhanced-rc' );
532 $rcObj->mAttribs[
'rc_namespace'] .
'-' . $rcObj->mAttribs[
'rc_title'] );
534 $classes[] = $rcObj->watched && $rcObj->mAttribs[
'rc_timestamp'] >= $rcObj->watched
535 ?
'mw-changeslist-line-watched' :
'mw-changeslist-line-not-watched';
539 $r .=
'<td class="mw-enhanced-rc"><span class="mw-enhancedchanges-arrow-space"></span>';
546 'minor' => $rcObj->mAttribs[
'rc_minor'],
547 'unpatrolled' => $rcObj->unpatrolled,
548 'bot' => $rcObj->mAttribs[
'rc_bot'],
551 $r .=
' ' . $rcObj->timestamp .
' </td><td>';
552 # Article or log link
554 $logPage =
new LogPage( $logType );
556 $logName = $logPage->getName()->escaped();
557 $r .= $this->
msg(
'parentheses' )
562 # Diff and hist links
564 $query[
'action'] =
'history';
565 $r .=
' ' . $this->
msg(
'parentheses' )
566 ->rawParams( $rcObj->difflink . $this->message[
'pipe-separator'] .
Linker::linkKnown(
573 $r .=
' <span class="mw-changeslist-separator">. .</span> ';
575 if ( $wgRCShowChangedSize ) {
578 $r .= $cd .
' <span class="mw-changeslist-separator">. .</span> ';
585 $r .=
' ' . $rcObj->userlink . $rcObj->usertalklink;
592 # Show how many people are watching this if enabled
595 $r .=
"</td></tr></table>\n";
609 if ( count( $this->rc_cache ) == 0 ) {
616 foreach ( $this->rc_cache
as $block ) {
617 if ( count( $block ) < 2 ) {
626 return '<div>' . $blockOut .
'</div>';
insertComment( $rc)
Insert a formatted comment.
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()
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
const RC_MOVE_OVER_REDIRECT
maybeWatchedLink( $link, $watched=false)
wfProfileIn( $functionname)
Begin profiling of a function.
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 & $ret
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
static escapeClass( $class)
Given a value, escape it so that it can be used as a CSS class and return it.
sideArrow()
Generate HTML for a right- or left-facing arrow, depending on language direction.
formatCharacterDifference(RecentChange $old, RecentChange $new=null)
Format the character difference of one or several changes.
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.
RCCacheEntryFactory $cacheEntryFactory
static flag( $flag)
Provide the "<abbr>" element appropriate to a given abbreviated flag, namely the flag indicating a ne...
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
getLanguage()
Get the Language object.
insertArticleLink(&$s, &$rc, $unpatrolled, $watched)
endRecentChangesList()
Returns text for the end of RC If enhanced RC is in use, returns pretty much all the text.
static openElement( $element, $attribs=array())
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
codepointToUtf8( $codepoint)
Return UTF-8 sequence for a given Unicode code point.
insertLogEntry( $rc)
Insert a formatted action.
getOutput()
Get the OutputPage object.
wfProfileOut( $functionname='missing')
Stop profiling of a function.
insertTags(&$s, &$rc, &$classes)
Class to simplify the use of log pages.
beginRecentChangesList()
Add the JavaScript file for enhanced changeslist.
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
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
recentChangesBlockGroup( $block)
Enhanced RC group.
presenting them properly to the user as errors is done by the caller $title
arrow( $dir, $alt='', $title='')
Generate HTML for an arrow or placeholder graphic.
array $rc_cache
Array of array of RCCacheEntry.
numberofWatchingusers( $count)
Returns the string which indicates the number of watching users.
recentChangesBlock()
If enhanced RC is in use, this function takes the previously cached RC lines, arranges them,...
recentChangesLine(&$baseRC, $watched=false)
Format a line for enhanced recentchange (aka with javascript and block of lines).
spacerArrow()
Generate HTML for a spacer image.
published in in Madrid In the first edition of the Vocabolario for was published In in Rotterdam was the Dictionnaire Universel ! html< p > The first monolingual dictionary written in a Romance language was< i > Sebastián Covarrubias</i >< i > Tesoro de la lengua castellana o published in in Madrid In the first edition of the< i > Vocabolario dell< a href="/index.php?title=Accademia_della_Crusca&action=edit&redlink=1" class="new" title="Accademia della Crusca (page does not exist)"> Accademia della Crusca</a ></i > for was published In in Rotterdam was the< i > Dictionnaire Universel</i ></p > ! end ! test Italics and ! wikitext foo ! html< p >< i > foo</i ></p > !end ! test Italics and ! wikitext foo ! html< p >< i > foo</i ></p > !end ! test Italics and ! wikitext foo ! html< p >< i > foo</i ></p > !end ! test Italics and ! wikitext foo ! html php< p >< i > foo</i ></p > ! html parsoid< p >< i > foo</i >< b ></b ></p > !end ! test Italics and ! wikitext foo ! html< p >< i > foo</i ></p > !end ! test Italics and ! wikitext foo ! html< p >< b > foo</b ></p > !end ! test Italics and ! wikitext foo ! html< p >< b > foo</b ></p > !end ! test Italics and ! wikitext foo ! html php< p >< b > foo</b ></p > ! html parsoid< p >< b > foo</b >< i ></i ></p > !end ! test Italics and ! wikitext foo ! html< p >< i > foo</i ></p > !end ! test Italics and ! wikitext foo ! html< p >< b > foo</b ></p > !end ! test Italics and ! wikitext foo ! html< p >< b > foo</b ></p > !end ! test Italics and ! wikitext foo ! html php< p >< b > foo</b ></p > ! html parsoid< p >< b > foo</b >< i ></i ></p > !end ! test Italics and ! options ! wikitext foo ! html< p >< b >< i > foo</i ></b ></p > !end ! test Italics and ! wikitext foo ! html< p >< i >< b > foo</b ></i ></p > !end ! test Italics and ! wikitext foo ! html< p >< i >< b > foo</b ></i ></p > !end ! test Italics and ! wikitext foo ! html< p >< i >< b > foo</b ></i ></p > !end ! test Italics and ! wikitext foo bar ! html< p >< i > foo< b > bar</b ></i ></p > !end ! test Italics and ! wikitext foo bar ! html< p >< i > foo< b > bar</b ></i ></p > !end ! test Italics and ! wikitext foo bar ! html< p >< i > foo< b > bar</b ></i ></p > !end ! test Italics and ! wikitext foo bar ! html php< p >< b > foo</b > bar</p > ! html parsoid< p >< b > foo</b > bar< i ></i ></p > !end ! test Italics and ! wikitext foo bar ! html php< p >< b > foo</b > bar</p > ! html parsoid< p >< b > foo</b > bar< b ></b ></p > !end ! test Italics and ! wikitext this is about foo s family ! html< p >< i > this is about< b > foo s family</b ></i ></p > !end ! test Italics and ! wikitext this is about foo s family ! html< p >< i > this is about< b > foo s</b > family</i ></p > !end ! test Italics and ! wikitext this is about foo s family ! html< p >< b > this is about< i > foo</i ></b >< i > s family</i ></p > !end ! test Italics and ! options ! wikitext this is about foo s family ! html< p >< i > this is about</i > foo< b > s family</b ></p > !end ! test Italics and ! wikitext this is about foo s family ! html< p >< b > this is about< i > foo s</i > family</b ></p > !end ! test Italicized possessive ! wikitext The s talk page ! html< p > The< i >< a href="/wiki/Main_Page" title="Main Page"> Main Page</a ></i > s talk page</p > ! end ! test Parsoid only
Interface for objects which can provide a context on request.
if(count( $args)==0) $dir
recentChangesBlockLine( $rcObj)
Enhanced RC ungrouped line.
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.
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
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,...
insertRollback(&$s, &$rc)
Inserts a rollback link.
downArrow()
Generate HTML for a down-facing arrow depending on language direction.
addCacheEntry(RCCacheEntry $cacheEntry)
Put accumulated information into the cache, for later display.