Clean up unused globals!
[lhc/web/wiklou.git] / includes / ChangesList.php
1 <?php
2 /**
3 * @package MediaWiki
4 * Contain class to show various lists of change:
5 * - what's link here
6 * - related changes
7 * - recent changes
8 */
9
10 /**
11 * @package MediaWiki
12 */
13 class ChangesList {
14 # Called by history lists and recent changes
15 #
16
17 /** @todo document */
18 function ChangesList( &$skin ) {
19 $this->skin =& $skin;
20 $this->preCacheMessages();
21 }
22
23 function newFromUser( &$user ) {
24 $sk =& $user->getSkin();
25 if ( $user->getOption('usenewrc') ) {
26 return new EnhancedChangesList( $sk );
27 } else {
28 return new OldChangesList( $sk );
29 }
30 }
31
32 /**
33 * As we use the same small set of messages in various methods and that
34 * they are called often, we call them once and save them in $this->message
35 */
36 function preCacheMessages() {
37 // Precache various messages
38 if( !isset( $this->message ) ) {
39 foreach( explode(' ', 'cur diff hist minoreditletter newpageletter last blocklink' ) as $msg ) {
40 $this->message[$msg] = wfMsg( $msg );
41 }
42 }
43 }
44
45
46 /**
47 * Returns the appropiate flags for new page, minor change and patrolling
48 */
49 function recentChangesFlags( $new, $minor, $patrolled, $nothing = '&nbsp;' ) {
50 $f = $new ? '<span class="newpage">' . wfMsgHtml( 'newpageletter' ) . '</span>'
51 : $nothing;
52 $f .= $minor ? '<span class="minor">' . wfMsgHtml( 'minoreditletter' ) . '</span>'
53 : $nothing;
54 $f .= $patrolled ? '<span class="unpatrolled">!</span>' : $nothing;
55 return $f;
56 }
57
58 /**
59 * Returns text for the start of the tabular part of RC
60 */
61 function beginRecentChangesList() {
62 $this->rc_cache = array() ;
63 $this->rcMoveIndex = 0;
64 $this->rcCacheIndex = 0 ;
65 $this->lastdate = '';
66 $this->rclistOpen = false;
67 return '';
68 }
69
70 /**
71 * Returns text for the end of RC
72 * If enhanced RC is in use, returns pretty much all the text
73 */
74 function endRecentChangesList() {
75 $s = $this->recentChangesBlock() ;
76 if( $this->rclistOpen ) {
77 $s .= "</ul>\n";
78 }
79 return $s;
80 }
81
82 /**
83 * Enhanced RC ungrouped line.
84 * @return string a HTML formated line (generated using $r)
85 */
86 function recentChangesBlockLine ( $rcObj ) {
87 global $wgStylePath, $wgContLang ;
88
89 # Get rc_xxxx variables
90 extract( $rcObj->mAttribs ) ;
91 $curIdEq = 'curid='.$rc_cur_id;
92
93 $r = '' ;
94
95 # Spacer image
96 $r .= '<img src="'.$wgStylePath.'/common/images/Arr_.png" width="12" height="12" border="0" />' ;
97
98 # Flag and Timestamp
99 $r .= '<tt>' ;
100
101 if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
102 $r .= '&nbsp;&nbsp;&nbsp;';
103 } else {
104 $r .= $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $rcObj->unpatrolled );
105 }
106 $r .= ' '.$rcObj->timestamp.' </tt>' ;
107
108 # Article link
109 $link = $rcObj->link ;
110 // FIXME: should be handled with a css class
111 if ( $rcObj->watched ) $link = '<strong>'.$link.'</strong>' ;
112 $r .= $link ;
113
114 # Diff
115 $r .= ' ('. $rcObj->difflink .'; ' ;
116
117 # Hist
118 $r .= $this->skin->makeKnownLinkObj( $rcObj->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' );
119
120 # User/talk
121 $r .= ') . . '.$rcObj->userlink . $rcObj->usertalklink ;
122
123 # Comment
124 if ( $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
125 $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() );
126 }
127
128 if ($rcObj->numberofWatchingusers > 0) {
129 $r .= wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($rcObj->numberofWatchingusers));
130 }
131
132 $r .= "<br />\n" ;
133 return $r ;
134 }
135
136 /**
137 * If enhanced RC is in use, this function takes the previously cached
138 * RC lines, arranges them, and outputs the HTML
139 */
140 function recentChangesBlock () {
141 global $wgStylePath ;
142 if ( count ( $this->rc_cache ) == 0 ) return '' ;
143 $blockOut = '';
144 foreach ( $this->rc_cache AS $secureName => $block ) {
145 if ( count ( $block ) < 2 ) {
146 $blockOut .= $this->recentChangesBlockLine ( array_shift ( $block ) ) ;
147 } else {
148 $blockOut .= $this->recentChangesBlockGroup ( $block ) ;
149 }
150 }
151
152 return '<div>'.$blockOut.'</div>' ;
153 }
154
155
156 function insertMove( &$s, $rc ) {
157 # Diff
158 $s .= '(' . $this->message['diff'] . ') (';
159 # Hist
160 $s .= $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), $this->message['hist'], 'action=history' ) .
161 ') . . ';
162
163 # "[[x]] moved to [[y]]"
164 $msg = ( $rc->mAttribs['rc_type'] == RC_MOVE ) ? '1movedto2' : '1movedto2_redir';
165 $s .= wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
166 $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
167 }
168
169 function insertDateHeader(&$s, $rc_timestamp) {
170 global $wgLang;
171
172 # Make date header if necessary
173 $date = $wgLang->date( $rc_timestamp, true, true );
174 $s = '';
175 if ( $date != $this->lastdate ) {
176 if ( '' != $this->lastdate ) { $s .= "</ul>\n"; }
177 $s .= '<h4>'.$date."</h4>\n<ul class=\"special\">";
178 $this->lastdate = $date;
179 $this->rclistOpen = true;
180 }
181 }
182
183 function insertLog(&$s, $title, $logtype) {
184 $logname = LogPage::logName( $logtype );
185 $s .= '(' . $this->skin->makeKnownLinkObj($title, $logname ) . ')';
186 }
187
188
189 function insertDiffHist(&$s, &$rc, $unpatrolled) {
190 # Diff link
191 if ( $rc->mAttribs['rc_type'] == RC_NEW || $rc->mAttribs['rc_type'] == RC_LOG ) {
192 $diffLink = $this->message['diff'];
193 } else {
194 $rcidparam = $unpatrolled
195 ? array( 'rcid' => $rc->mAttribs['rc_id'] )
196 : array();
197 $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'],
198 wfArrayToCGI( array(
199 'curid' => $rc->mAttribs['rc_cur_id'],
200 'diff' => $rc->mAttribs['rc_this_oldid'],
201 'oldid' => $rc->mAttribs['rc_last_oldid'] ),
202 $rcidparam ),
203 '', '', ' tabindex="'.$rc->counter.'"');
204 }
205 $s .= '('.$diffLink.') (';
206
207 # History link
208 $s .= $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['hist'],
209 wfArrayToCGI( array(
210 'curid' => $rc->mAttribs['rc_cur_id'],
211 'action' => 'history' ) ) );
212 $s .= ') . . ';
213 }
214
215 function insertArticleLink(&$s, &$rc, $unpatrolled, $watched) {
216 # Article link
217 # If it's a new article, there is no diff link, but if it hasn't been
218 # patrolled yet, we need to give users a way to do so
219 $params = ( $unpatrolled && $rc->mAttribs['rc_type'] == RC_NEW )
220 ? 'rcid='.$rc->mAttribs['rc_id']
221 : '';
222 $articlelink = ' '. $this->skin->makeKnownLinkObj( $rc->getTitle(), '', $params );
223 if($watched) $articlelink = '<strong>'.$articlelink.'</strong>';
224
225 $s .= ' '.$articlelink;
226 }
227
228 function insertTimestamp(&$s, &$rc) {
229 global $wgLang;
230 # Timestamp
231 $s .= '; ' . $wgLang->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . ';
232 }
233
234 /** Insert links to user page, user talk page and eventually a blocking link */
235 function insertUserRelatedLinks(&$s, &$rc) {
236 $this->insertUserLink($s,$rc);
237 $openParenthesis = false;
238
239 global $wgDisableAnonTalk;
240 if(!( 0 == $rc->mAttribs['rc_user'] && $wgDisableAnonTalk)) {
241 $openParenthesis = true;
242 $s .= ' (';
243 $this->insertUserTalkLink($s,$rc);
244 }
245
246 global $wgSysopUserBans, $wgUser;
247 if ( ( $wgSysopUserBans || 0 == $rc->mAttribs['rc_user'] ) && $wgUser->isAllowed('block') ) {
248 $s .= $openParenthesis ? ' | ' : '(';
249 $this->insertUserBlockLink($s,$rc);
250 }
251 $s .= $openParenthesis ? ') ' : '';
252 }
253
254 /** insert a formatted link to the user page */
255 function insertUserLink(&$s, &$rc) {
256 # User link (or contributions for unregistered users)
257 if ( 0 == $rc->mAttribs['rc_user'] ) {
258 $contribsPage =& Title::makeTitle( NS_SPECIAL, 'Contributions' );
259 $userLink = $this->skin->makeKnownLinkObj( $contribsPage,
260 $rc->mAttribs['rc_user_text'], 'target=' . $rc->mAttribs['rc_user_text'] );
261 } else {
262 $userPage =& Title::makeTitle( NS_USER, $rc->mAttribs['rc_user_text'] );
263 $userLink = $this->skin->makeLinkObj( $userPage, htmlspecialchars( $rc->mAttribs['rc_user_text'] ) );
264 }
265 $s .= $userLink;
266 }
267
268 /** insert a formatted link to the user talk page */
269 function insertUserTalkLink(&$s, &$rc) {
270 # User talk link
271 global $wgContLang;
272 $talkname = $wgContLang->getNsText(NS_TALK); # use the shorter name
273 $userTalkPage =& Title::makeTitle( NS_USER_TALK, $rc->mAttribs['rc_user_text'] );
274 $userTalkLink= $this->skin->makeLinkObj( $userTalkPage, htmlspecialchars( $talkname ) );
275 $s .= $userTalkLink;
276 }
277
278 /** insert a formatted link to block an user */
279 function insertUserBlockLink(&$s, &$rc) {
280 # Block link
281 $blockLinkPage = Title::makeTitle( NS_SPECIAL, 'Blockip' );
282 $blockLink = $this->skin->makeKnownLinkObj( $blockLinkPage,
283 htmlspecialchars( $this->message['blocklink'] ), 'ip=' . urlencode( $rc->mAttribs['rc_user_text'] ) );
284 $s .= $blockLink;
285 }
286
287 /** insert a formatted comment */
288 function insertComment(&$s, &$rc) {
289 # Add comment
290 if ( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) {
291 $s .= $this->skin->commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() );
292 }
293 }
294 }
295
296
297 /**
298 * Generate a list of changes using the good old system (no javascript)
299 */
300 class OldChangesList extends ChangesList {
301 /**
302 * Format a line using the old system (aka without any javascript).
303 */
304 function recentChangesLine( &$rc, $watched = false ) {
305 global $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol;
306 global $wgOnlySysopsCanPatrol, $wgSysopUserBans;
307
308 $fname = 'ChangesList::recentChangesLineOld';
309 wfProfileIn( $fname );
310
311
312 # Extract DB fields into local scope
313 extract( $rc->mAttribs );
314 $curIdEq = 'curid=' . $rc_cur_id;
315
316 # Should patrol-related stuff be shown?
317 $unpatrolled = $wgUseRCPatrol && $wgUser->isLoggedIn() &&
318 ( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed('patrol') ) && $rc_patrolled == 0;
319
320 $this->insertDateHeader($s,$rc_timestamp);
321
322 $s .= '<li>';
323
324 // moved pages
325 if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
326 $this->insertMove( $s, $rc );
327 // log entries
328 } elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) {
329 $this->insertLog($s, $rc->getTitle(), $matches[1]);
330 // all other stuff
331 } else {
332 wfProfileIn($fname.'-page');
333
334 $this->insertDiffHist($s, $rc, $unpatrolled);
335
336 # M, N and ! (minor, new and unpatrolled)
337 $s .= ' ' . $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $unpatrolled, '' );
338 $this->insertArticleLink($s, $rc, $unpatrolled, $watched);
339
340 wfProfileOut($fname.'-page');
341 }
342
343 wfProfileIn( $fname.'-rest' );
344
345 $this->insertTimestamp($s,$rc);
346 $this->insertUserRelatedLinks($s,$rc);
347 $this->insertComment($s, $rc);
348
349 if ($rc->numberofWatchingusers > 0) {
350 $s .= ' ' . wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($rc->numberofWatchingusers));
351 }
352
353 $s .= "</li>\n";
354
355 wfProfileOut( $fname.'-rest' );
356
357 wfProfileOut( $fname );
358 return $s;
359 }
360 }
361
362
363 /**
364 * Generate a list of changes using an Enhanced system (use javascript).
365 */
366 class EnhancedChangesList extends ChangesList {
367 /**
368 * Format a line for enhanced recentchange (aka with javascript and block of lines).
369 */
370 function recentChangesLine( &$baseRC, $watched = false ) {
371 global $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol;
372 global $wgOnlySysopsCanPatrol, $wgSysopUserBans;
373
374 # Create a specialised object
375 $rc = RCCacheEntry::newFromParent( $baseRC ) ;
376
377 # Extract fields from DB into the function scope (rc_xxxx variables)
378 extract( $rc->mAttribs );
379 $curIdEq = 'curid=' . $rc_cur_id;
380
381 # If it's a new day, add the headline and flush the cache
382 $date = $wgLang->date( $rc_timestamp, true);
383 $ret = '';
384 if ( $date != $this->lastdate ) {
385 # Process current cache
386 $ret = $this->recentChangesBlock () ;
387 $this->rc_cache = array() ;
388 $ret .= "<h4>{$date}</h4>\n";
389 $this->lastdate = $date;
390 }
391
392 # Should patrol-related stuff be shown?
393 if ( $wgUseRCPatrol && $wgUser->isLoggedIn() &&
394 ( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed('patrol') )) {
395 $rc->unpatrolled = !$rc_patrolled;
396 } else {
397 $rc->unpatrolled = false;
398 }
399
400 # Make article link
401 if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
402 $msg = ( $rc_type == RC_MOVE ) ? "1movedto2" : "1movedto2_redir";
403 $clink = wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
404 $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
405 } elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) {
406 # Log updates, etc
407 $logtype = $matches[1];
408 $logname = LogPage::logName( $logtype );
409 $clink = '(' . $this->skin->makeKnownLinkObj( $rc->getTitle(), $logname ) . ')';
410 } elseif ( $rc->unpatrolled && $rc_type == RC_NEW ) {
411 # Unpatrolled new page, give rc_id in query
412 $clink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" );
413 } else {
414 $clink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '' ) ;
415 }
416
417 $time = $wgContLang->time( $rc_timestamp, true, true );
418 $rc->watched = $watched ;
419 $rc->link = $clink ;
420 $rc->timestamp = $time;
421 $rc->numberofWatchingusers = $baseRC->numberofWatchingusers;
422
423 # Make "cur" and "diff" links
424 $titleObj = $rc->getTitle();
425 if ( $rc->unpatrolled ) {
426 $rcIdQuery = "&rcid={$rc_id}";
427 } else {
428 $rcIdQuery = '';
429 }
430 $querycur = $curIdEq."&diff=0&oldid=$rc_this_oldid";
431 $querydiff = $curIdEq."&diff=$rc_this_oldid&oldid=$rc_last_oldid";
432 $aprops = ' tabindex="'.$baseRC->counter.'"';
433 $curLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['cur'], $querycur, '' ,'' , $aprops );
434 if( $rc_type == RC_NEW || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
435 if( $rc_type != RC_NEW ) {
436 $curLink = $this->message['cur'];
437 }
438 $diffLink = $this->message['diff'];
439 } else {
440 $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], $querydiff, '' ,'' , $aprops );
441 }
442
443 # Make "last" link
444 if ( $rc_last_oldid == 0 || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
445 $lastLink = $this->message['last'];
446 } else {
447 $lastLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['last'],
448 $curIdEq.'&diff='.$rc_this_oldid.'&oldid='.$rc_last_oldid . $rcIdQuery );
449 }
450
451 # Make user link (or user contributions for unregistered users)
452 if ( $rc_user == 0 ) {
453 $contribsPage =& Title::makeTitle( NS_SPECIAL, 'Contributions' );
454 $userLink = $this->skin->makeKnownLinkObj( $contribsPage,
455 $rc_user_text, 'target=' . $rc_user_text );
456 } else {
457 $userPage =& Title::makeTitle( NS_USER, $rc_user_text );
458 $userLink = $this->skin->makeLinkObj( $userPage, $rc_user_text );
459 }
460
461 $rc->userlink = $userLink;
462 $rc->lastlink = $lastLink;
463 $rc->curlink = $curLink;
464 $rc->difflink = $diffLink;
465
466 # Make user talk link
467 $talkname = $wgContLang->getNsText( NS_TALK ); # use the shorter name
468 $userTalkPage =& Title::makeTitle( NS_USER_TALK, $rc_user_text );
469 $userTalkLink = $this->skin->makeLinkObj( $userTalkPage, $talkname );
470
471 global $wgDisableAnonTalk;
472 if ( ( $wgSysopUserBans || 0 == $rc_user ) && $wgUser->isAllowed('block') ) {
473 $blockPage =& Title::makeTitle( NS_SPECIAL, 'Blockip' );
474 $blockLink = $this->skin->makeKnownLinkObj( $blockPage,
475 $this->message['blocklink'], 'ip='.$rc_user_text );
476 if( $wgDisableAnonTalk )
477 $rc->usertalklink = ' ('.$blockLink.')';
478 else
479 $rc->usertalklink = ' ('.$userTalkLink.' | '.$blockLink.')';
480 } else {
481 if( $wgDisableAnonTalk && ($rc_user == 0) )
482 $rc->usertalklink = '';
483 else
484 $rc->usertalklink = ' ('.$userTalkLink.')';
485 }
486
487 # Put accumulated information into the cache, for later display
488 # Page moves go on their own line
489 $title = $rc->getTitle();
490 $secureName = $title->getPrefixedDBkey();
491 if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
492 # Use an @ character to prevent collision with page names
493 $this->rc_cache['@@' . ($this->rcMoveIndex++)] = array($rc);
494 } else {
495 if ( !isset ( $this->rc_cache[$secureName] ) ) $this->rc_cache[$secureName] = array() ;
496 array_push ( $this->rc_cache[$secureName] , $rc ) ;
497 }
498 return $ret;
499 }
500
501 /**
502 * Enhanced RC group
503 */
504 function recentChangesBlockGroup ( $block ) {
505 global $wgStylePath, $wgContLang ;
506
507 $r = '';
508
509 # Collate list of users
510 $isnew = false ;
511 $unpatrolled = false;
512 $userlinks = array () ;
513 foreach ( $block AS $rcObj ) {
514 $oldid = $rcObj->mAttribs['rc_last_oldid'];
515 $newid = $rcObj->mAttribs['rc_this_oldid'];
516 if ( $rcObj->mAttribs['rc_new'] ) {
517 $isnew = true ;
518 }
519 $u = $rcObj->userlink ;
520 if ( !isset ( $userlinks[$u] ) ) {
521 $userlinks[$u] = 0 ;
522 }
523 if ( $rcObj->unpatrolled ) {
524 $unpatrolled = true;
525 }
526 $userlinks[$u]++ ;
527 }
528
529 # Sort the list and convert to text
530 krsort ( $userlinks ) ;
531 asort ( $userlinks ) ;
532 $users = array () ;
533 foreach ( $userlinks as $userlink => $count) {
534 $text = $userlink;
535 if ( $count > 1 ) $text .= ' ('.$count.'&times;)' ;
536 array_push ( $users , $text ) ;
537 }
538
539 $users = ' <span class="changedby">['.implode('; ',$users).']</span>';
540
541 # Arrow
542 $rci = 'RCI'.$this->rcCacheIndex ;
543 $rcl = 'RCL'.$this->rcCacheIndex ;
544 $rcm = 'RCM'.$this->rcCacheIndex ;
545 $toggleLink = "javascript:toggleVisibility('$rci','$rcm','$rcl')" ;
546 $arrowdir = $wgContLang->isRTL() ? 'l' : 'r';
547 $tl = '<span id="'.$rcm.'"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/common/images/Arr_'.$arrowdir.'.png" width="12" height="12" alt="+" /></a></span>' ;
548 $tl .= '<span id="'.$rcl.'" style="display:none"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/common/images/Arr_d.png" width="12" height="12" alt="-" /></a></span>' ;
549 $r .= $tl ;
550
551 # Main line
552 $r .= '<tt>' ;
553 $r .= $this->recentChangesFlags( $isnew, false, $unpatrolled );
554
555 # Timestamp
556 $r .= ' '.$block[0]->timestamp.' ' ;
557 $r .= '</tt>' ;
558
559 # Article link
560 $link = $block[0]->link ;
561 if ( $block[0]->watched ) $link = '<strong>'.$link.'</strong>' ;
562 $r .= $link ;
563
564 $curIdEq = 'curid=' . $block[0]->mAttribs['rc_cur_id'];
565 $currentRevision = $block[0]->mAttribs['rc_this_oldid'];
566 if ( $block[0]->mAttribs['rc_type'] != RC_LOG ) {
567 # Changes
568 $r .= ' ('.count($block).' ' ;
569 if ( $isnew ) $r .= wfMsg('changes');
570 else $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle() , wfMsg('changes') ,
571 $curIdEq."&diff=$currentRevision&oldid=$oldid" ) ;
572 $r .= '; ' ;
573
574 # History
575 $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(), wfMsg( 'history' ), $curIdEq.'&action=history' );
576 $r .= ')' ;
577 }
578
579 $r .= $users ;
580
581 if ($block[0]->numberofWatchingusers > 0) {
582 $r .= wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($block[0]->numberofWatchingusers));
583 }
584 $r .= "<br />\n" ;
585
586 # Sub-entries
587 $r .= '<div id="'.$rci.'" style="display:none">' ;
588 foreach ( $block AS $rcObj ) {
589 # Get rc_xxxx variables
590 extract( $rcObj->mAttribs );
591
592 $r .= '<img src="'.$wgStylePath.'/common/images/Arr_.png" width="12" height="12" />';
593 $r .= '<tt>&nbsp; &nbsp; &nbsp; &nbsp;' ;
594 $r .= $this->recentChangesFlags( $rc_new, $rc_minor, $rcObj->unpatrolled );
595 $r .= '&nbsp;</tt>' ;
596
597 $o = '' ;
598 if ( $rc_this_oldid != 0 ) {
599 $o = 'oldid='.$rc_this_oldid ;
600 }
601 if ( $rc_type == RC_LOG ) {
602 $link = $rcObj->timestamp;
603 } else {
604 $link = $this->skin->makeKnownLinkObj( $rcObj->getTitle(), $rcObj->timestamp , $curIdEq.'&'.$o );
605 }
606 $link = '<tt>'.$link.'</tt>' ;
607
608 $r .= $link ;
609 $r .= ' (' ;
610 $r .= $rcObj->curlink ;
611 $r .= '; ' ;
612 $r .= $rcObj->lastlink ;
613 $r .= ') . . '.$rcObj->userlink ;
614 $r .= $rcObj->usertalklink ;
615 $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() );
616 $r .= "<br />\n" ;
617 }
618 $r .= "</div>\n" ;
619
620 $this->rcCacheIndex++ ;
621 return $r ;
622 }
623 }
624 ?>