MediaWiki
REL1_22
|
00001 <?php 00023 class EnhancedChangesList extends ChangesList { 00024 00025 protected $rc_cache; 00026 00031 public function beginRecentChangesList() { 00032 $this->rc_cache = array(); 00033 $this->rcMoveIndex = 0; 00034 $this->rcCacheIndex = 0; 00035 $this->lastdate = ''; 00036 $this->rclistOpen = false; 00037 $this->getOutput()->addModuleStyles( array( 00038 'mediawiki.special.changeslist', 00039 'mediawiki.special.changeslist.enhanced', 00040 ) ); 00041 $this->getOutput()->addModules( array( 00042 'jquery.makeCollapsible', 00043 'mediawiki.icon', 00044 ) ); 00045 return ''; 00046 } 00055 public function recentChangesLine( &$baseRC, $watched = false ) { 00056 wfProfileIn( __METHOD__ ); 00057 00058 # Create a specialised object 00059 $rc = RCCacheEntry::newFromParent( $baseRC ); 00060 00061 $curIdEq = array( 'curid' => $rc->mAttribs['rc_cur_id'] ); 00062 00063 # If it's a new day, add the headline and flush the cache 00064 $date = $this->getLanguage()->userDate( $rc->mAttribs['rc_timestamp'], $this->getUser() ); 00065 $ret = ''; 00066 if ( $date != $this->lastdate ) { 00067 # Process current cache 00068 $ret = $this->recentChangesBlock(); 00069 $this->rc_cache = array(); 00070 $ret .= Xml::element( 'h4', null, $date ) . "\n"; 00071 $this->lastdate = $date; 00072 } 00073 00074 # Should patrol-related stuff be shown? 00075 $rc->unpatrolled = $this->showAsUnpatrolled( $rc ); 00076 00077 $showdifflinks = true; 00078 # Make article link 00079 $type = $rc->mAttribs['rc_type']; 00080 $logType = $rc->mAttribs['rc_log_type']; 00081 // Page moves, very old style, not supported anymore 00082 if ( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) { 00083 // New unpatrolled pages 00084 } elseif ( $rc->unpatrolled && $type == RC_NEW ) { 00085 $clink = Linker::linkKnown( $rc->getTitle() ); 00086 // Log entries 00087 } elseif ( $type == RC_LOG ) { 00088 if ( $logType ) { 00089 $logtitle = SpecialPage::getTitleFor( 'Log', $logType ); 00090 $logpage = new LogPage( $logType ); 00091 $logname = $logpage->getName()->escaped(); 00092 $clink = $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logtitle, $logname ) )->escaped(); 00093 } else { 00094 $clink = Linker::link( $rc->getTitle() ); 00095 } 00096 $watched = false; 00097 // Log entries (old format) and special pages 00098 } elseif ( $rc->mAttribs['rc_namespace'] == NS_SPECIAL ) { 00099 wfDebug( "Unexpected special page in recentchanges\n" ); 00100 $clink = ''; 00101 // Edits 00102 } else { 00103 $clink = Linker::linkKnown( $rc->getTitle() ); 00104 } 00105 00106 # Don't show unusable diff links 00107 if ( !ChangesList::userCan( $rc, Revision::DELETED_TEXT, $this->getUser() ) ) { 00108 $showdifflinks = false; 00109 } 00110 00111 $time = $this->getLanguage()->userTime( $rc->mAttribs['rc_timestamp'], $this->getUser() ); 00112 $rc->watched = $watched; 00113 $rc->link = $clink; 00114 $rc->timestamp = $time; 00115 $rc->numberofWatchingusers = $baseRC->numberofWatchingusers; 00116 00117 # Make "cur" and "diff" links. Do not use link(), it is too slow if 00118 # called too many times (50% of CPU time on RecentChanges!). 00119 $thisOldid = $rc->mAttribs['rc_this_oldid']; 00120 $lastOldid = $rc->mAttribs['rc_last_oldid']; 00121 00122 $querycur = $curIdEq + array( 'diff' => '0', 'oldid' => $thisOldid ); 00123 $querydiff = $curIdEq + array( 'diff' => $thisOldid, 'oldid' => $lastOldid ); 00124 00125 if ( !$showdifflinks ) { 00126 $curLink = $this->message['cur']; 00127 $diffLink = $this->message['diff']; 00128 } elseif ( in_array( $type, array( RC_NEW, RC_LOG, RC_MOVE, RC_MOVE_OVER_REDIRECT ) ) ) { 00129 if ( $type != RC_NEW ) { 00130 $curLink = $this->message['cur']; 00131 } else { 00132 $curUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querycur ) ); 00133 $curLink = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>"; 00134 } 00135 $diffLink = $this->message['diff']; 00136 } else { 00137 $diffUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querydiff ) ); 00138 $curUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querycur ) ); 00139 $diffLink = "<a href=\"$diffUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['diff']}</a>"; 00140 $curLink = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>"; 00141 } 00142 00143 # Make "last" link 00144 if ( !$showdifflinks || !$lastOldid ) { 00145 $lastLink = $this->message['last']; 00146 } elseif ( in_array( $type, array( RC_LOG, RC_MOVE, RC_MOVE_OVER_REDIRECT ) ) ) { 00147 $lastLink = $this->message['last']; 00148 } else { 00149 $lastLink = Linker::linkKnown( $rc->getTitle(), $this->message['last'], 00150 array(), $curIdEq + array( 'diff' => $thisOldid, 'oldid' => $lastOldid ) ); 00151 } 00152 00153 # Make user links 00154 if ( $this->isDeleted( $rc, Revision::DELETED_USER ) ) { 00155 $rc->userlink = ' <span class="history-deleted">' . $this->msg( 'rev-deleted-user' )->escaped() . '</span>'; 00156 } else { 00157 $rc->userlink = Linker::userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); 00158 $rc->usertalklink = Linker::userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); 00159 } 00160 00161 $rc->lastlink = $lastLink; 00162 $rc->curlink = $curLink; 00163 $rc->difflink = $diffLink; 00164 00165 # Put accumulated information into the cache, for later display 00166 # Page moves go on their own line 00167 $title = $rc->getTitle(); 00168 $secureName = $title->getPrefixedDBkey(); 00169 if ( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) { 00170 # Use an @ character to prevent collision with page names 00171 $this->rc_cache['@@' . ( $this->rcMoveIndex++ )] = array( $rc ); 00172 } else { 00173 # Logs are grouped by type 00174 if ( $type == RC_LOG ) { 00175 $secureName = SpecialPage::getTitleFor( 'Log', $logType )->getPrefixedDBkey(); 00176 } 00177 if ( !isset( $this->rc_cache[$secureName] ) ) { 00178 $this->rc_cache[$secureName] = array(); 00179 } 00180 00181 array_push( $this->rc_cache[$secureName], $rc ); 00182 } 00183 00184 wfProfileOut( __METHOD__ ); 00185 00186 return $ret; 00187 } 00188 00193 protected function recentChangesBlockGroup( $block ) { 00194 global $wgRCShowChangedSize; 00195 00196 wfProfileIn( __METHOD__ ); 00197 00198 # Add the namespace and title of the block as part of the class 00199 $classes = array( 'mw-collapsible', 'mw-collapsed', 'mw-enhanced-rc' ); 00200 if ( $block[0]->mAttribs['rc_log_type'] ) { 00201 # Log entry 00202 $classes[] = Sanitizer::escapeClass( 'mw-changeslist-log-' 00203 . $block[0]->mAttribs['rc_log_type'] ); 00204 } else { 00205 $classes[] = Sanitizer::escapeClass( 'mw-changeslist-ns' 00206 . $block[0]->mAttribs['rc_namespace'] . '-' . $block[0]->mAttribs['rc_title'] ); 00207 } 00208 $classes[] = $block[0]->watched && $block[0]->mAttribs['rc_timestamp'] >= $block[0]->watched 00209 ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched'; 00210 $r = Html::openElement( 'table', array( 'class' => $classes ) ) . 00211 Html::openElement( 'tr' ); 00212 00213 # Collate list of users 00214 $userlinks = array(); 00215 # Other properties 00216 $unpatrolled = false; 00217 $isnew = false; 00218 $allBots = true; 00219 $allMinors = true; 00220 $curId = $currentRevision = 0; 00221 # Some catalyst variables... 00222 $namehidden = true; 00223 $allLogs = true; 00224 foreach ( $block as $rcObj ) { 00225 $oldid = $rcObj->mAttribs['rc_last_oldid']; 00226 if ( $rcObj->mAttribs['rc_type'] == RC_NEW ) { 00227 $isnew = true; 00228 } 00229 // If all log actions to this page were hidden, then don't 00230 // give the name of the affected page for this block! 00231 if ( !$this->isDeleted( $rcObj, LogPage::DELETED_ACTION ) ) { 00232 $namehidden = false; 00233 } 00234 $u = $rcObj->userlink; 00235 if ( !isset( $userlinks[$u] ) ) { 00236 $userlinks[$u] = 0; 00237 } 00238 if ( $rcObj->unpatrolled ) { 00239 $unpatrolled = true; 00240 } 00241 if ( $rcObj->mAttribs['rc_type'] != RC_LOG ) { 00242 $allLogs = false; 00243 } 00244 # Get the latest entry with a page_id and oldid 00245 # since logs may not have these. 00246 if ( !$curId && $rcObj->mAttribs['rc_cur_id'] ) { 00247 $curId = $rcObj->mAttribs['rc_cur_id']; 00248 } 00249 if ( !$currentRevision && $rcObj->mAttribs['rc_this_oldid'] ) { 00250 $currentRevision = $rcObj->mAttribs['rc_this_oldid']; 00251 } 00252 00253 if ( !$rcObj->mAttribs['rc_bot'] ) { 00254 $allBots = false; 00255 } 00256 if ( !$rcObj->mAttribs['rc_minor'] ) { 00257 $allMinors = false; 00258 } 00259 00260 $userlinks[$u]++; 00261 } 00262 00263 # Sort the list and convert to text 00264 krsort( $userlinks ); 00265 asort( $userlinks ); 00266 $users = array(); 00267 foreach ( $userlinks as $userlink => $count ) { 00268 $text = $userlink; 00269 $text .= $this->getLanguage()->getDirMark(); 00270 if ( $count > 1 ) { 00271 $text .= ' ' . $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->formatNum( $count ) . '×' )->escaped(); 00272 } 00273 array_push( $users, $text ); 00274 } 00275 00276 $users = ' <span class="changedby">' 00277 . $this->msg( 'brackets' )->rawParams( 00278 implode( $this->message['semicolon-separator'], $users ) 00279 )->escaped() . '</span>'; 00280 00281 $tl = '<span class="mw-collapsible-toggle mw-collapsible-arrow mw-enhancedchanges-arrow mw-enhancedchanges-arrow-space"></span>'; 00282 $r .= "<td>$tl</td>"; 00283 00284 # Main line 00285 $r .= '<td class="mw-enhanced-rc">' . $this->recentChangesFlags( array( 00286 'newpage' => $isnew, # show, when one have this flag 00287 'minor' => $allMinors, # show only, when all have this flag 00288 'unpatrolled' => $unpatrolled, # show, when one have this flag 00289 'bot' => $allBots, # show only, when all have this flag 00290 ) ); 00291 00292 # Timestamp 00293 $r .= ' ' . $block[0]->timestamp . ' </td><td>'; 00294 00295 # Article link 00296 if ( $namehidden ) { 00297 $r .= ' <span class="history-deleted">' . $this->msg( 'rev-deleted-event' )->escaped() . '</span>'; 00298 } elseif ( $allLogs ) { 00299 $r .= $this->maybeWatchedLink( $block[0]->link, $block[0]->watched ); 00300 } else { 00301 $this->insertArticleLink( $r, $block[0], $block[0]->unpatrolled, $block[0]->watched ); 00302 } 00303 00304 $r .= $this->getLanguage()->getDirMark(); 00305 00306 $queryParams['curid'] = $curId; 00307 00308 # Changes message 00309 static $nchanges = array(); 00310 static $sinceLastVisitMsg = array(); 00311 00312 $n = count( $block ); 00313 if ( !isset( $nchanges[$n] ) ) { 00314 $nchanges[$n] = $this->msg( 'nchanges' )->numParams( $n )->escaped(); 00315 } 00316 00317 $sinceLast = 0; 00318 $unvisitedOldid = null; 00319 foreach ( $block as $rcObj ) { 00320 // Same logic as below inside main foreach 00321 if ( $rcObj->watched && $rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched ) { 00322 $sinceLast++; 00323 $unvisitedOldid = $rcObj->mAttribs['rc_last_oldid']; 00324 } 00325 } 00326 if ( !isset( $sinceLastVisitMsg[$sinceLast] ) ) { 00327 $sinceLastVisitMsg[$sinceLast] = 00328 $this->msg( 'enhancedrc-since-last-visit' )->numParams( $sinceLast )->escaped(); 00329 } 00330 00331 # Total change link 00332 $r .= ' '; 00333 $logtext = ''; 00334 if ( !$allLogs ) { 00335 if ( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) { 00336 $logtext .= $nchanges[$n]; 00337 } elseif ( $isnew ) { 00338 $logtext .= $nchanges[$n]; 00339 } else { 00340 $logtext .= Linker::link( 00341 $block[0]->getTitle(), 00342 $nchanges[$n], 00343 array(), 00344 $queryParams + array( 00345 'diff' => $currentRevision, 00346 'oldid' => $oldid, 00347 ), 00348 array( 'known', 'noclasses' ) 00349 ); 00350 if ( $sinceLast > 0 && $sinceLast < $n ) { 00351 $logtext .= $this->message['pipe-separator'] . Linker::link( 00352 $block[0]->getTitle(), 00353 $sinceLastVisitMsg[$sinceLast], 00354 array(), 00355 $queryParams + array( 00356 'diff' => $currentRevision, 00357 'oldid' => $unvisitedOldid, 00358 ), 00359 array( 'known', 'noclasses' ) 00360 ); 00361 } 00362 } 00363 } 00364 00365 # History 00366 if ( $allLogs ) { 00367 // don't show history link for logs 00368 } elseif ( $namehidden || !$block[0]->getTitle()->exists() ) { 00369 $logtext .= $this->message['pipe-separator'] . $this->message['enhancedrc-history']; 00370 } else { 00371 $params = $queryParams; 00372 $params['action'] = 'history'; 00373 00374 $logtext .= $this->message['pipe-separator'] . 00375 Linker::linkKnown( 00376 $block[0]->getTitle(), 00377 $this->message['enhancedrc-history'], 00378 array(), 00379 $params 00380 ); 00381 } 00382 00383 if ( $logtext !== '' ) { 00384 $r .= $this->msg( 'parentheses' )->rawParams( $logtext )->escaped(); 00385 } 00386 00387 $r .= ' <span class="mw-changeslist-separator">. .</span> '; 00388 00389 # Character difference (does not apply if only log items) 00390 if ( $wgRCShowChangedSize && !$allLogs ) { 00391 $last = 0; 00392 $first = count( $block ) - 1; 00393 # Some events (like logs) have an "empty" size, so we need to skip those... 00394 while ( $last < $first && $block[$last]->mAttribs['rc_new_len'] === null ) { 00395 $last++; 00396 } 00397 while ( $first > $last && $block[$first]->mAttribs['rc_old_len'] === null ) { 00398 $first--; 00399 } 00400 # Get net change 00401 $chardiff = $this->formatCharacterDifference( $block[$first], $block[$last] ); 00402 00403 if ( $chardiff == '' ) { 00404 $r .= ' '; 00405 } else { 00406 $r .= ' ' . $chardiff . ' <span class="mw-changeslist-separator">. .</span> '; 00407 } 00408 } 00409 00410 $r .= $users; 00411 $r .= $this->numberofWatchingusers( $block[0]->numberofWatchingusers ); 00412 00413 # Sub-entries 00414 foreach ( $block as $rcObj ) { 00415 # Classes to apply -- TODO implement 00416 $classes = array(); 00417 $type = $rcObj->mAttribs['rc_type']; 00418 00419 $trClass = $rcObj->watched && $rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched 00420 ? ' class="mw-enhanced-watched"' : ''; 00421 00422 $r .= '<tr' . $trClass . '><td></td><td class="mw-enhanced-rc">'; 00423 $r .= $this->recentChangesFlags( array( 00424 'newpage' => $type == RC_NEW, 00425 'minor' => $rcObj->mAttribs['rc_minor'], 00426 'unpatrolled' => $rcObj->unpatrolled, 00427 'bot' => $rcObj->mAttribs['rc_bot'], 00428 ) ); 00429 $r .= ' </td><td class="mw-enhanced-rc-nested"><span class="mw-enhanced-rc-time">'; 00430 00431 $params = $queryParams; 00432 00433 if ( $rcObj->mAttribs['rc_this_oldid'] != 0 ) { 00434 $params['oldid'] = $rcObj->mAttribs['rc_this_oldid']; 00435 } 00436 00437 # Log timestamp 00438 if ( $type == RC_LOG ) { 00439 $link = $rcObj->timestamp; 00440 # Revision link 00441 } elseif ( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) { 00442 $link = '<span class="history-deleted">' . $rcObj->timestamp . '</span> '; 00443 } else { 00444 00445 $link = Linker::linkKnown( 00446 $rcObj->getTitle(), 00447 $rcObj->timestamp, 00448 array(), 00449 $params 00450 ); 00451 if ( $this->isDeleted( $rcObj, Revision::DELETED_TEXT ) ) { 00452 $link = '<span class="history-deleted">' . $link . '</span> '; 00453 } 00454 } 00455 $r .= $link . '</span>'; 00456 00457 if ( !$type == RC_LOG || $type == RC_NEW ) { 00458 $r .= ' ' . $this->msg( 'parentheses' )->rawParams( $rcObj->curlink . $this->message['pipe-separator'] . $rcObj->lastlink )->escaped(); 00459 } 00460 $r .= ' <span class="mw-changeslist-separator">. .</span> '; 00461 00462 # Character diff 00463 if ( $wgRCShowChangedSize ) { 00464 $cd = $this->formatCharacterDifference( $rcObj ); 00465 if ( $cd !== '' ) { 00466 $r .= $cd . ' <span class="mw-changeslist-separator">. .</span> '; 00467 } 00468 } 00469 00470 if ( $rcObj->mAttribs['rc_type'] == RC_LOG ) { 00471 $r .= $this->insertLogEntry( $rcObj ); 00472 } else { 00473 # User links 00474 $r .= $rcObj->userlink; 00475 $r .= $rcObj->usertalklink; 00476 $r .= $this->insertComment( $rcObj ); 00477 } 00478 00479 # Rollback 00480 $this->insertRollback( $r, $rcObj ); 00481 # Tags 00482 $this->insertTags( $r, $rcObj, $classes ); 00483 00484 $r .= "</td></tr>\n"; 00485 } 00486 $r .= "</table>\n"; 00487 00488 $this->rcCacheIndex++; 00489 00490 wfProfileOut( __METHOD__ ); 00491 00492 return $r; 00493 } 00494 00502 protected function arrow( $dir, $alt = '', $title = '' ) { 00503 global $wgStylePath; 00504 $encUrl = htmlspecialchars( $wgStylePath . '/common/images/Arr_' . $dir . '.png' ); 00505 $encAlt = htmlspecialchars( $alt ); 00506 $encTitle = htmlspecialchars( $title ); 00507 return "<img src=\"$encUrl\" width=\"12\" height=\"12\" alt=\"$encAlt\" title=\"$encTitle\" />"; 00508 } 00509 00515 protected function sideArrow() { 00516 $dir = $this->getLanguage()->isRTL() ? 'l' : 'r'; 00517 return $this->arrow( $dir, '+', $this->msg( 'rc-enhanced-expand' )->text() ); 00518 } 00519 00525 protected function downArrow() { 00526 return $this->arrow( 'd', '-', $this->msg( 'rc-enhanced-hide' )->text() ); 00527 } 00528 00533 protected function spacerArrow() { 00534 return $this->arrow( '', codepointToUtf8( 0xa0 ) ); // non-breaking space 00535 } 00536 00543 protected function recentChangesBlockLine( $rcObj ) { 00544 global $wgRCShowChangedSize; 00545 00546 wfProfileIn( __METHOD__ ); 00547 $query['curid'] = $rcObj->mAttribs['rc_cur_id']; 00548 00549 $type = $rcObj->mAttribs['rc_type']; 00550 $logType = $rcObj->mAttribs['rc_log_type']; 00551 $classes = array( 'mw-enhanced-rc' ); 00552 if ( $logType ) { 00553 # Log entry 00554 + $classes[] = Sanitizer::escapeClass( 'mw-changeslist-log-' . $logType ); 00555 } else { 00556 $classes[] = Sanitizer::escapeClass( 'mw-changeslist-ns' . 00557 $rcObj->mAttribs['rc_namespace'] . '-' . $rcObj->mAttribs['rc_title'] ); 00558 } 00559 $classes[] = $rcObj->watched && $rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched 00560 ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched'; 00561 $r = Html::openElement( 'table', array( 'class' => $classes ) ) . 00562 Html::openElement( 'tr' ); 00563 00564 $r .= '<td class="mw-enhanced-rc"><span class="mw-enhancedchanges-arrow-space"></span>'; 00565 # Flag and Timestamp 00566 if ( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) { 00567 $r .= $this->recentChangesFlags( array() ); // no flags, but need the placeholders 00568 } else { 00569 $r .= $this->recentChangesFlags( array( 00570 'newpage' => $type == RC_NEW, 00571 'minor' => $rcObj->mAttribs['rc_minor'], 00572 'unpatrolled' => $rcObj->unpatrolled, 00573 'bot' => $rcObj->mAttribs['rc_bot'], 00574 ) ); 00575 } 00576 $r .= ' ' . $rcObj->timestamp . ' </td><td>'; 00577 # Article or log link 00578 if ( $logType ) { 00579 $logPage = new LogPage( $logType ); 00580 $logTitle = SpecialPage::getTitleFor( 'Log', $logType ); 00581 $logName = $logPage->getName()->escaped(); 00582 $r .= $this->msg( 'parentheses' )->rawParams( Linker::linkKnown( $logTitle, $logName ) )->escaped(); 00583 } else { 00584 $this->insertArticleLink( $r, $rcObj, $rcObj->unpatrolled, $rcObj->watched ); 00585 } 00586 # Diff and hist links 00587 if ( $type != RC_LOG ) { 00588 $query['action'] = 'history'; 00589 $r .= ' ' . $this->msg( 'parentheses' )->rawParams( $rcObj->difflink . $this->message['pipe-separator'] . Linker::linkKnown( 00590 $rcObj->getTitle(), 00591 $this->message['hist'], 00592 array(), 00593 $query 00594 ) )->escaped(); 00595 } 00596 $r .= ' <span class="mw-changeslist-separator">. .</span> '; 00597 # Character diff 00598 if ( $wgRCShowChangedSize ) { 00599 $cd = $this->formatCharacterDifference( $rcObj ); 00600 if ( $cd !== '' ) { 00601 $r .= $cd . ' <span class="mw-changeslist-separator">. .</span> '; 00602 } 00603 } 00604 00605 if ( $type == RC_LOG ) { 00606 $r .= $this->insertLogEntry( $rcObj ); 00607 } else { 00608 $r .= ' ' . $rcObj->userlink . $rcObj->usertalklink; 00609 $r .= $this->insertComment( $rcObj ); 00610 $this->insertRollback( $r, $rcObj ); 00611 } 00612 00613 # Tags 00614 $this->insertTags( $r, $rcObj, $classes ); 00615 # Show how many people are watching this if enabled 00616 $r .= $this->numberofWatchingusers( $rcObj->numberofWatchingusers ); 00617 00618 $r .= "</td></tr></table>\n"; 00619 00620 wfProfileOut( __METHOD__ ); 00621 00622 return $r; 00623 } 00624 00631 protected function recentChangesBlock() { 00632 if ( count ( $this->rc_cache ) == 0 ) { 00633 return ''; 00634 } 00635 00636 wfProfileIn( __METHOD__ ); 00637 00638 $blockOut = ''; 00639 foreach ( $this->rc_cache as $block ) { 00640 if ( count( $block ) < 2 ) { 00641 $blockOut .= $this->recentChangesBlockLine( array_shift( $block ) ); 00642 } else { 00643 $blockOut .= $this->recentChangesBlockGroup( $block ); 00644 } 00645 } 00646 00647 wfProfileOut( __METHOD__ ); 00648 00649 return '<div>' . $blockOut . '</div>'; 00650 } 00651 00657 public function endRecentChangesList() { 00658 return $this->recentChangesBlock() . parent::endRecentChangesList(); 00659 } 00660 00661 }