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