r96551 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96550‎ | r96551 | r96552 >
Date:10:13, 8 September 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Improve r96548: fixed one fatal, restored user tool links and removed a little duplication
Modified paths:
  • /trunk/extensions/CleanChanges/CleanChanges_body.php (modified) (history)
  • /trunk/phase3/includes/ChangesList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ChangesList.php
@@ -239,7 +239,8 @@
240240 }
241241
242242 public function insertLog( &$s, $title, $logtype ) {
243 - $logname = LogType::factory( $logtype )->getName()->escaped();
 243+ $page = new LogPage( $logtype );
 244+ $logname = $page->getName()->escaped();
244245 $s .= '(' . Linker::linkKnown( $title, $logname ) . ')';
245246 }
246247
@@ -361,6 +362,7 @@
362363 */
363364 public function insertLogEntry( $rc ) {
364365 $formatter = LogFormatter::newFromRow( $rc->mAttribs );
 366+ $formatter->setShowUserToolLinks( true );
365367 $mark = $this->getLang()->getDirMark();
366368 return $formatter->getActionText() . " $mark" . $formatter->getComment();
367369 }
Index: trunk/extensions/CleanChanges/CleanChanges_body.php
@@ -108,11 +108,6 @@
109109 }
110110 }
111111
112 - protected function getLogAction( $rc ) {
113 - $formatter = LogFormatter::newFromRow( $rc->mAttribs );
114 - return $formatter->getActionText();
115 - }
116 -
117112 /**
118113 * Format a line for enhanced recentchange (aka with javascript and block of lines).
119114 */
@@ -345,7 +340,7 @@
346341 $items[] = $this->userSeparator;
347342
348343 if ( $this->isLog( $rcObj ) ) {
349 - $items[] = $this->getLogAction( $rcObj );
 344+ $items[] = $this->insertLogEntry( $rcObj );
350345 } else {
351346 $items[] = $rcObj->_user;
352347 $items[] = $rcObj->_userInfo;
@@ -387,7 +382,7 @@
388383 $items[] = $this->userSeparator;
389384
390385 if ( $this->isLog( $rcObj ) ) {
391 - $items[] = $this->getLogAction( $rcObj );
 386+ $items[] = $this->insertLogEntry( $rcObj );
392387 } else {
393388 $items[] = $rcObj->_user;
394389 $items[] = $rcObj->_userInfo;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96548Update ChangesList and derivatives to use LogFormatter....nikerabbit09:15, 8 September 2011

Status & tagging log