MediaWiki  1.23.0
OldChangesList.php
Go to the documentation of this file.
1 <?php
23 class OldChangesList extends ChangesList {
33  public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
34  global $wgRCShowChangedSize;
35  wfProfileIn( __METHOD__ );
36 
37  # Should patrol-related stuff be shown?
38  $unpatrolled = $this->showAsUnpatrolled( $rc );
39 
40  $s = '';
41  $classes = array();
42  // use mw-line-even/mw-line-odd class only if linenumber is given (feature from bug 14468)
43  if ( $linenumber ) {
44  if ( $linenumber & 1 ) {
45  $classes[] = 'mw-line-odd';
46  } else {
47  $classes[] = 'mw-line-even';
48  }
49  }
50 
51  // Indicate watched status on the line to allow for more
52  // comprehensive styling.
53  $classes[] = $watched && $rc->mAttribs['rc_timestamp'] >= $watched
54  ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
55 
56  // Moved pages (very very old, not supported anymore)
57  if ( $rc->mAttribs['rc_type'] == RC_MOVE || $rc->mAttribs['rc_type'] == RC_MOVE_OVER_REDIRECT ) {
58  // Log entries
59  } elseif ( $rc->mAttribs['rc_log_type'] ) {
60  $logtitle = SpecialPage::getTitleFor( 'Log', $rc->mAttribs['rc_log_type'] );
61  $this->insertLog( $s, $logtitle, $rc->mAttribs['rc_log_type'] );
62  // Log entries (old format) or log targets, and special pages
63  } elseif ( $rc->mAttribs['rc_namespace'] == NS_SPECIAL ) {
64  list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $rc->mAttribs['rc_title'] );
65  if ( $name == 'Log' ) {
66  $this->insertLog( $s, $rc->getTitle(), $subpage );
67  }
68  // Regular entries
69  } else {
70  $this->insertDiffHist( $s, $rc, $unpatrolled );
71  # M, N, b and ! (minor, new, bot and unpatrolled)
72  $s .= $this->recentChangesFlags(
73  array(
74  'newpage' => $rc->mAttribs['rc_type'] == RC_NEW,
75  'minor' => $rc->mAttribs['rc_minor'],
76  'unpatrolled' => $unpatrolled,
77  'bot' => $rc->mAttribs['rc_bot']
78  ),
79  ''
80  );
81  $this->insertArticleLink( $s, $rc, $unpatrolled, $watched );
82  }
83  # Edit/log timestamp
84  $this->insertTimestamp( $s, $rc );
85  # Bytes added or removed
86  if ( $wgRCShowChangedSize ) {
87  $cd = $this->formatCharacterDifference( $rc );
88  if ( $cd !== '' ) {
89  $s .= $cd . ' <span class="mw-changeslist-separator">. .</span> ';
90  }
91  }
92 
93  if ( $rc->mAttribs['rc_type'] == RC_LOG ) {
94  $s .= $this->insertLogEntry( $rc );
95  } else {
96  # User tool links
97  $this->insertUserRelatedLinks( $s, $rc );
98  # LTR/RTL direction mark
99  $s .= $this->getLanguage()->getDirMark();
100  $s .= $this->insertComment( $rc );
101  }
102 
103  # Tags
104  $this->insertTags( $s, $rc, $classes );
105  # Rollback
106  $this->insertRollback( $s, $rc );
107  # For subclasses
108  $this->insertExtra( $s, $rc, $classes );
109 
110  # How many users watch this page
111  if ( $rc->numberofWatchingusers > 0 ) {
112  $s .= ' ' . $this->numberofWatchingusers( $rc->numberofWatchingusers );
113  }
114 
115  if ( $this->watchlist ) {
116  $classes[] = Sanitizer::escapeClass( 'watchlist-' .
117  $rc->mAttribs['rc_namespace'] . '-' . $rc->mAttribs['rc_title'] );
118  }
119 
120  if ( !wfRunHooks( 'OldChangesListRecentChangesLine', array( &$this, &$s, $rc, &$classes ) ) ) {
121  wfProfileOut( __METHOD__ );
122 
123  return false;
124  }
125 
126  wfProfileOut( __METHOD__ );
127 
128  $dateheader = ''; // $s now contains only <li>...</li>, for hooks' convenience.
129  $this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] );
130 
131  return "$dateheader<li class=\"" . implode( ' ', $classes ) . "\">" . $s . "</li>\n";
132  }
133 }
ChangesList\insertComment
insertComment( $rc)
Insert a formatted comment.
Definition: ChangesList.php:430
php
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
Definition: skin.txt:62
RC_MOVE_OVER_REDIRECT
const RC_MOVE_OVER_REDIRECT
Definition: Defines.php:182
wfProfileIn
wfProfileIn( $functionname)
Begin profiling of a function.
Definition: Profiler.php:33
RC_LOG
const RC_LOG
Definition: Defines.php:181
RC_MOVE
const RC_MOVE
Definition: Defines.php:180
ChangesList\insertLog
insertLog(&$s, $title, $logtype)
Definition: ChangesList.php:291
$s
$s
Definition: mergeMessageFileList.php:156
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
Definition: SpecialPage.php:74
Sanitizer\escapeClass
static escapeClass( $class)
Given a value, escape it so that it can be used as a CSS class and return it.
Definition: Sanitizer.php:1126
OldChangesList\recentChangesLine
recentChangesLine(&$rc, $watched=false, $linenumber=null)
Format a line using the old system (aka without any javascript).
Definition: OldChangesList.php:33
ChangesList\formatCharacterDifference
formatCharacterDifference(RecentChange $old, RecentChange $new=null)
Format the character difference of one or several changes.
Definition: ChangesList.php:242
ContextSource\getLanguage
getLanguage()
Get the Language object.
Definition: ContextSource.php:154
ChangesList\insertDateHeader
insertDateHeader(&$s, $rc_timestamp)
Definition: ChangesList.php:273
NS_SPECIAL
const NS_SPECIAL
Definition: Defines.php:68
ChangesList\insertArticleLink
insertArticleLink(&$s, &$rc, $unpatrolled, $watched)
Definition: ChangesList.php:344
ChangesList\insertLogEntry
insertLogEntry( $rc)
Insert a formatted action.
Definition: ChangesList.php:416
wfProfileOut
wfProfileOut( $functionname='missing')
Stop profiling of a function.
Definition: Profiler.php:46
ChangesList\insertTags
insertTags(&$s, &$rc, &$classes)
Definition: ChangesList.php:548
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4001
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
ChangesList\insertUserRelatedLinks
insertUserRelatedLinks(&$s, &$rc)
Insert links to user page, user talk page and eventually a blocking link.
Definition: ChangesList.php:399
list
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
Definition: deferred.txt:11
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
OldChangesList
Definition: OldChangesList.php:23
ChangesList\insertTimestamp
insertTimestamp(&$s, $rc)
Insert time timestamp string from $rc into $s.
Definition: ChangesList.php:389
ChangesList\numberofWatchingusers
numberofWatchingusers( $count)
Returns the string which indicates the number of watching users.
Definition: ChangesList.php:462
ChangesList\showAsUnpatrolled
showAsUnpatrolled(RecentChange $rc)
Definition: ChangesList.php:565
SpecialPageFactory\resolveAlias
static resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
Definition: SpecialPageFactory.php:271
RC_NEW
const RC_NEW
Definition: Defines.php:179
ChangesList\recentChangesFlags
recentChangesFlags( $flags, $nothing='&#160;')
Returns the appropriate flags for new page, minor change and patrolling.
Definition: ChangesList.php:111
ChangesList
Definition: ChangesList.php:25
ChangesList\insertExtra
insertExtra(&$s, &$rc, &$classes)
Definition: ChangesList.php:561
ChangesList\insertRollback
insertRollback(&$s, &$rc)
Inserts a rollback link.
Definition: ChangesList.php:520
ChangesList\insertDiffHist
insertDiffHist(&$s, &$rc, $unpatrolled)
Definition: ChangesList.php:302