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