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