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