r23469 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23468‎ | r23469 | r23470 >
Date:09:13, 27 June 2007
Author:robchurch
Status:old
Tags:
Comment:
* Move batch existence check up
* Comment out old LogViewer::logLine() in favour of sleeker version [keeping old for reference, as before]
Modified paths:
  • /branches/robchurch/logs/includes/SpecialLog.php (modified) (history)

Diff [purge]

Index: branches/robchurch/logs/includes/SpecialLog.php
@@ -285,6 +285,9 @@
286286 // Fetch results and form a batch link existence query
287287 $batch = new LinkBatch;
288288 while ( $s = $result->fetchObject() ) {
 289+ // Target title
 290+ $batch->addObj( Title::makeTitleSafe( $s->log_namespace, $s->log_title ) );
 291+
289292 // User link
290293 $batch->addObj( Title::makeTitleSafe( NS_USER, $s->user_name ) );
291294 $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $s->user_name ) );
@@ -348,34 +351,19 @@
349352 }
350353
351354 /**
352 - * @param Object $s a single row from the result set
353 - * @return string Formatted HTML list item
354 - * @private
 355+ * Format a single result row
 356+ *
 357+ * @param object $row Result row
 358+ * @return string
355359 */
 360+ private function logLine( $row ) {
 361+ $line = LogItem::newFromRow( $row );
 362+ return $line->format( LogFormatter::NO_DATE );
 363+ }
 364+
 365+ /**
356366 function logLine( $s ) {
357367
358 - $line = LogItem::newFromRow( $s );
359 - return $line->format( LogFormatter::NO_DATE );
360 -
361 - global $wgLang, $wgUser;;
362 - $skin = $wgUser->getSkin();
363 - $title = Title::makeTitle( $s->log_namespace, $s->log_title );
364 - $time = $wgLang->time( wfTimestamp(TS_MW, $s->log_timestamp), true );
365 -
366 - // Enter the existence or non-existence of this page into the link cache,
367 - // for faster makeLinkObj() in LogPage::actionText()
368 - $linkCache =& LinkCache::singleton();
369 - if( $s->page_id ) {
370 - $linkCache->addGoodLinkObj( $s->page_id, $title );
371 - } else {
372 - $linkCache->addBadLinkObj( $title );
373 - }
374 -
375 - $userLink = $this->skin->userLink( $s->log_user, $s->user_name ) . $this->skin->userToolLinksRedContribs( $s->log_user, $s->user_name );
376 - $comment = $this->skin->commentBlock( $s->log_comment );
377 - $paramArray = LogPage::extractParams( $s->log_params );
378 - $revert = '';
379 - // show revertmove link
380368 if ( $s->log_type == 'move' && isset( $paramArray[0] ) ) {
381369 $destTitle = Title::newFromText( $paramArray[0] );
382370 if ( $destTitle ) {
@@ -411,7 +399,7 @@
412400 $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true, true );
413401 $out = "$time $userLink $action $comment $revert";
414402 return $out;
415 - }
 403+ }*/
416404
417405 /**
418406 * @param OutputPage &$out where to send output

Status & tagging log