48 if ( $linenumber & 1 ) {
49 $classes[] =
'mw-line-odd';
51 $classes[] =
'mw-line-even';
55 $html = $this->formatChangeLine( $rc, $classes, $watched );
57 if ( $this->watchlist ) {
58 $classes[] = Sanitizer::escapeClass(
'watchlist-' .
59 $rc->mAttribs[
'rc_namespace'] .
'-' . $rc->mAttribs[
'rc_title'] );
64 if ( !$this->getHookRunner()->onOldChangesListRecentChangesLine(
65 $this, $html, $rc, $classes, $attribs )
69 $attribs = array_filter( $attribs,
70 [ Sanitizer::class,
'isReservedDataAttribute' ],
78 $attribs[
'class'] = $classes;
80 return $dateheader . Html::rawElement(
'li', $attribs, $html ) .
"\n";
90 private function formatChangeLine(
RecentChange $rc, array &$classes, $watched ) {
92 $unpatrolled = $this->showAsUnpatrolled( $rc );
94 if ( $rc->mAttribs[
'rc_log_type'] ) {
95 $logtitle = SpecialPage::getTitleFor(
'Log', $rc->mAttribs[
'rc_log_type'] );
96 $this->insertLog( $html, $logtitle, $rc->mAttribs[
'rc_log_type'],
false );
97 $flags = $this->recentChangesFlags( [
'unpatrolled' => $unpatrolled,
98 'bot' => $rc->mAttribs[
'rc_bot'] ],
'' );
99 if ( $flags !==
'' ) {
100 $html .=
' ' . $flags;
103 } elseif ( $rc->mAttribs[
'rc_namespace'] ==
NS_SPECIAL ) {
104 [ $name, $htmlubpage ] = MediaWikiServices::getInstance()->getSpecialPageFactory()->
105 resolveAlias( $rc->mAttribs[
'rc_title'] );
106 if ( $name ==
'Log' ) {
112 # M, N, b and ! (minor, new, bot and unpatrolled)
115 'newpage' => $rc->mAttribs[
'rc_type'] ==
RC_NEW,
116 'minor' => $rc->mAttribs[
'rc_minor'],
117 'unpatrolled' => $unpatrolled,
118 'bot' => $rc->mAttribs[
'rc_bot']
126 # Bytes added or removed
127 if ( $this->
getConfig()->
get( MainConfigNames::RCShowChangedSize ) ) {
130 $html .= $cd .
' <span class="mw-changeslist-separator"></span> ';
134 if ( $rc->mAttribs[
'rc_type'] ==
RC_LOG ) {
151 # How many users watch this page
152 if ( $rc->numberofWatchingusers > 0 ) {
156 $html = Html::rawElement(
'span', [
157 'class' =>
'mw-changeslist-line-inner',
158 'data-target-page' => $rc->
getTitle(),
160 if ( is_callable( $this->changeLinePrefixer ) ) {
161 $prefix = call_user_func( $this->changeLinePrefixer, $rc, $this,
false );
162 $html = Html::rawElement(
'span', [
'class' =>
'mw-changeslist-line-prefix' ], $prefix ) . $html;
Base class for lists of recent changes shown on special pages.
insertDateHeader(&$s, $rc_timestamp)
insertRollback(&$s, &$rc)
Insert a rollback link.
getHighlightsContainerDiv()
Get the container for highlights that are used in the new StructuredFilters system.
recentChangesFlags( $flags, $nothing="\u{00A0}")
Returns the appropriate flags for new page, minor change and patrolling.
getDataAttributes(RecentChange $rc)
Get recommended data attributes for a change line.
numberofWatchingusers( $count)
Returns the string which indicates the number of watching users.
getHTMLClasses( $rc, $watched)
Get an array of default HTML class attributes for the change.
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 te...
insertUserRelatedLinks(&$s, &$rc)
Insert links to user page, user talk page and eventually a blocking link.
insertLogEntry( $rc)
Insert a formatted action.
insertLog(&$s, $title, $logtype, $useParentheses=true)
insertTags(&$s, &$rc, &$classes)
insertComment( $rc)
Insert a formatted comment.
insertExtra(&$s, &$rc, &$classes)
isCategorizationWithoutRevision( $rcObj)
Determines whether a revision is linked to this change; this may not be the case when the categorizat...
insertDiffHist(&$s, &$rc, $unpatrolled=null)
insertTimestamp(&$s, $rc)
Insert time timestamp string from $rc into $s.
A class containing constants representing the names of configuration variables.
Parent class for all special pages.
Generate a list of changes using the good old system (no javascript).
recentChangesLine(&$rc, $watched=false, $linenumber=null)
Format a line using the old system (aka without any javascript).
Utility class for creating and reading rows in the recentchanges table.