From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- includes/changes/OldChangesList.php | 130 ++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 includes/changes/OldChangesList.php (limited to 'includes/changes/OldChangesList.php') diff --git a/includes/changes/OldChangesList.php b/includes/changes/OldChangesList.php new file mode 100644 index 00000000..a7fe9342 --- /dev/null +++ b/includes/changes/OldChangesList.php @@ -0,0 +1,130 @@ +showAsUnpatrolled( $rc ); + + $dateheader = ''; // $s now contains only
  • ...
  • , for hooks' convenience. + $this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] ); + + $s = ''; + $classes = array(); + // use mw-line-even/mw-line-odd class only if linenumber is given (feature from bug 14468) + if ( $linenumber ) { + if ( $linenumber & 1 ) { + $classes[] = 'mw-line-odd'; + } else { + $classes[] = 'mw-line-even'; + } + } + + // Indicate watched status on the line to allow for more + // comprehensive styling. + $classes[] = $watched && $rc->mAttribs['rc_timestamp'] >= $watched + ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched'; + + // Moved pages (very very old, not supported anymore) + if ( $rc->mAttribs['rc_type'] == RC_MOVE || $rc->mAttribs['rc_type'] == RC_MOVE_OVER_REDIRECT ) { + // Log entries + } elseif ( $rc->mAttribs['rc_log_type'] ) { + $logtitle = SpecialPage::getTitleFor( 'Log', $rc->mAttribs['rc_log_type'] ); + $this->insertLog( $s, $logtitle, $rc->mAttribs['rc_log_type'] ); + // Log entries (old format) or log targets, and special pages + } elseif ( $rc->mAttribs['rc_namespace'] == NS_SPECIAL ) { + list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $rc->mAttribs['rc_title'] ); + if ( $name == 'Log' ) { + $this->insertLog( $s, $rc->getTitle(), $subpage ); + } + // Regular entries + } else { + $this->insertDiffHist( $s, $rc, $unpatrolled ); + # M, N, b and ! (minor, new, bot and unpatrolled) + $s .= $this->recentChangesFlags( + array( + 'newpage' => $rc->mAttribs['rc_type'] == RC_NEW, + 'minor' => $rc->mAttribs['rc_minor'], + 'unpatrolled' => $unpatrolled, + 'bot' => $rc->mAttribs['rc_bot'] + ), + '' + ); + $this->insertArticleLink( $s, $rc, $unpatrolled, $watched ); + } + # Edit/log timestamp + $this->insertTimestamp( $s, $rc ); + # Bytes added or removed + if ( $wgRCShowChangedSize ) { + $cd = $this->formatCharacterDifference( $rc ); + if ( $cd !== '' ) { + $s .= $cd . ' . . '; + } + } + + if ( $rc->mAttribs['rc_type'] == RC_LOG ) { + $s .= $this->insertLogEntry( $rc ); + } else { + # User tool links + $this->insertUserRelatedLinks( $s, $rc ); + # LTR/RTL direction mark + $s .= $this->getLanguage()->getDirMark(); + $s .= $this->insertComment( $rc ); + } + + # Tags + $this->insertTags( $s, $rc, $classes ); + # Rollback + $this->insertRollback( $s, $rc ); + # For subclasses + $this->insertExtra( $s, $rc, $classes ); + + # How many users watch this page + if ( $rc->numberofWatchingusers > 0 ) { + $s .= ' ' . $this->numberofWatchingusers( $rc->numberofWatchingusers ); + } + + if ( $this->watchlist ) { + $classes[] = Sanitizer::escapeClass( 'watchlist-' . $rc->mAttribs['rc_namespace'] . '-' . $rc->mAttribs['rc_title'] ); + } + + if ( !wfRunHooks( 'OldChangesListRecentChangesLine', array( &$this, &$s, $rc, &$classes ) ) ) { + wfProfileOut( __METHOD__ ); + return false; + } + + wfProfileOut( __METHOD__ ); + return "$dateheader
  • " . $s . "
  • \n"; + } +} -- cgit v1.2.2