* I accedentally commited this on the last commit
[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) {
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_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 $wgTitle, $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol,
306 $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);
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 $wgTitle, $wgLang, $wgContLang, $wgUser,
372 $wgUseRCPatrol, $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 $query = $curIdEq."&diff=$rc_this_oldid&oldid=$rc_last_oldid";
431 $aprops = ' tabindex="'.$baseRC->counter.'"';
432 $curLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['cur'], $query, '' ,'' , $aprops );
433 if( $rc_type == RC_NEW || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
434 if( $rc_type != RC_NEW ) {
435 $curLink = $this->message['cur'];
436 }
437 $diffLink = $this->message['diff'];
438 } else {
439 $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], $query . $rcIdQuery, '' ,'' , $aprops );
440 }
441
442 # Make "last" link
443 if ( $rc_last_oldid == 0 || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
444 $lastLink = $this->message['last'];
445 } else {
446 $lastLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['last'],
447 $curIdEq.'&diff='.$rc_this_oldid.'&oldid='.$rc_last_oldid . $rcIdQuery );
448 }
449
450 # Make user link (or user contributions for unregistered users)
451 if ( $rc_user == 0 ) {
452 $contribsPage =& Title::makeTitle( NS_SPECIAL, 'Contributions' );
453 $userLink = $this->skin->makeKnownLinkObj( $contribsPage,
454 $rc_user_text, 'target=' . $rc_user_text );
455 } else {
456 $userPage =& Title::makeTitle( NS_USER, $rc_user_text );
457 $userLink = $this->skin->makeLinkObj( $userPage, $rc_user_text );
458 }
459
460 $rc->userlink = $userLink;
461 $rc->lastlink = $lastLink;
462 $rc->curlink = $curLink;
463 $rc->difflink = $diffLink;
464
465 # Make user talk link
466 $talkname = $wgContLang->getNsText( NS_TALK ); # use the shorter name
467 $userTalkPage =& Title::makeTitle( NS_USER_TALK, $rc_user_text );
468 $userTalkLink = $this->skin->makeLinkObj( $userTalkPage, $talkname );
469
470 global $wgDisableAnonTalk;
471 if ( ( $wgSysopUserBans || 0 == $rc_user ) && $wgUser->isAllowed('block') ) {
472 $blockPage =& Title::makeTitle( NS_SPECIAL, 'Blockip' );
473 $blockLink = $this->skin->makeKnownLinkObj( $blockPage,
474 $this->message['blocklink'], 'ip='.$rc_user_text );
475 if( $wgDisableAnonTalk )
476 $rc->usertalklink = ' ('.$blockLink.')';
477 else
478 $rc->usertalklink = ' ('.$userTalkLink.' | '.$blockLink.')';
479 } else {
480 if( $wgDisableAnonTalk && ($rc_user == 0) )
481 $rc->usertalklink = '';
482 else
483 $rc->usertalklink = ' ('.$userTalkLink.')';
484 }
485
486 # Put accumulated information into the cache, for later display
487 # Page moves go on their own line
488 $title = $rc->getTitle();
489 $secureName = $title->getPrefixedDBkey();
490 if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
491 # Use an @ character to prevent collision with page names
492 $this->rc_cache['@@' . ($this->rcMoveIndex++)] = array($rc);
493 } else {
494 if ( !isset ( $this->rc_cache[$secureName] ) ) $this->rc_cache[$secureName] = array() ;
495 array_push ( $this->rc_cache[$secureName] , $rc ) ;
496 }
497 return $ret;
498 }
499
500 /**
501 * Enhanced RC group
502 */
503 function recentChangesBlockGroup ( $block ) {
504 global $wgStylePath, $wgContLang ;
505
506 $r = '';
507
508 # Collate list of users
509 $isnew = false ;
510 $unpatrolled = false;
511 $userlinks = array () ;
512 foreach ( $block AS $rcObj ) {
513 $oldid = $rcObj->mAttribs['rc_last_oldid'];
514 $newid = $rcObj->mAttribs['rc_this_oldid'];
515 if ( $rcObj->mAttribs['rc_new'] ) {
516 $isnew = true ;
517 }
518 $u = $rcObj->userlink ;
519 if ( !isset ( $userlinks[$u] ) ) {
520 $userlinks[$u] = 0 ;
521 }
522 if ( $rcObj->unpatrolled ) {
523 $unpatrolled = true;
524 }
525 $userlinks[$u]++ ;
526 }
527
528 # Sort the list and convert to text
529 krsort ( $userlinks ) ;
530 asort ( $userlinks ) ;
531 $users = array () ;
532 foreach ( $userlinks as $userlink => $count) {
533 $text = $userlink;
534 if ( $count > 1 ) $text .= ' ('.$count.'&times;)' ;
535 array_push ( $users , $text ) ;
536 }
537
538 $users = ' <span class="changedby">['.implode('; ',$users).']</span>';
539
540 # Arrow
541 $rci = 'RCI'.$this->rcCacheIndex ;
542 $rcl = 'RCL'.$this->rcCacheIndex ;
543 $rcm = 'RCM'.$this->rcCacheIndex ;
544 $toggleLink = "javascript:toggleVisibility('$rci','$rcm','$rcl')" ;
545 $arrowdir = $wgContLang->isRTL() ? 'l' : 'r';
546 $tl = '<span id="'.$rcm.'"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/common/images/Arr_'.$arrowdir.'.png" width="12" height="12" alt="+" /></a></span>' ;
547 $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>' ;
548 $r .= $tl ;
549
550 # Main line
551 $r .= '<tt>' ;
552 $r .= $this->recentChangesFlags( $isnew, false, $unpatrolled );
553
554 # Timestamp
555 $r .= ' '.$block[0]->timestamp.' ' ;
556 $r .= '</tt>' ;
557
558 # Article link
559 $link = $block[0]->link ;
560 if ( $block[0]->watched ) $link = '<strong>'.$link.'</strong>' ;
561 $r .= $link ;
562
563 $curIdEq = 'curid=' . $block[0]->mAttribs['rc_cur_id'];
564 $currentRevision = $block[0]->mAttribs['rc_this_oldid'];
565 if ( $block[0]->mAttribs['rc_type'] != RC_LOG ) {
566 # Changes
567 $r .= ' ('.count($block).' ' ;
568 if ( $isnew ) $r .= wfMsg('changes');
569 else $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle() , wfMsg('changes') ,
570 $curIdEq."&diff=$currentRevision&oldid=$oldid" ) ;
571 $r .= '; ' ;
572
573 # History
574 $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(), wfMsg( 'history' ), $curIdEq.'&action=history' );
575 $r .= ')' ;
576 }
577
578 $r .= $users ;
579
580 if ($block[0]->numberofWatchingusers > 0) {
581 $r .= wfMsg('number_of_watching_users_RCview', $wgContLang->formatNum($block[0]->numberofWatchingusers));
582 }
583 $r .= "<br />\n" ;
584
585 # Sub-entries
586 $r .= '<div id="'.$rci.'" style="display:none">' ;
587 foreach ( $block AS $rcObj ) {
588 # Get rc_xxxx variables
589 extract( $rcObj->mAttribs );
590
591 $r .= '<img src="'.$wgStylePath.'/common/images/Arr_.png" width="12" height="12" />';
592 $r .= '<tt>&nbsp; &nbsp; &nbsp; &nbsp;' ;
593 $r .= $this->recentChangesFlags( $rc_new, $rc_minor, $rcObj->unpatrolled );
594 $r .= '&nbsp;</tt>' ;
595
596 $o = '' ;
597 if ( $rc_last_oldid != 0 ) {
598 $o = 'oldid='.$rc_last_oldid ;
599 }
600 if ( $rc_type == RC_LOG ) {
601 $link = $rcObj->timestamp;
602 } else {
603 $link = $this->skin->makeKnownLinkObj( $rcObj->getTitle(), $rcObj->timestamp , $curIdEq.'&'.$o );
604 }
605 $link = '<tt>'.$link.'</tt>' ;
606
607 $r .= $link ;
608 $r .= ' (' ;
609 $r .= $rcObj->curlink ;
610 $r .= '; ' ;
611 $r .= $rcObj->lastlink ;
612 $r .= ') . . '.$rcObj->userlink ;
613 $r .= $rcObj->usertalklink ;
614 $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() );
615 $r .= "<br />\n" ;
616 }
617 $r .= "</div>\n" ;
618
619 $this->rcCacheIndex++ ;
620 return $r ;
621 }
622 }
623 ?>