r23467 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23466‎ | r23467 | r23468 >
Date:09:02, 27 June 2007
Author:robchurch
Status:old
Tags:
Comment:
Move log formatting
Modified paths:
  • /branches/robchurch/logs/includes/CoreLogFormatter.php (modified) (history)
  • /branches/robchurch/logs/includes/DefaultSettings.php (modified) (history)
  • /branches/robchurch/logs/languages/messages/MessagesEn.php (modified) (history)
  • /branches/robchurch/logs/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: branches/robchurch/logs/maintenance/language/messages.inc
@@ -1384,6 +1384,8 @@
13851385 '1movedto2_redir',
13861386 'movelogpage',
13871387 'movelogpagetext',
 1388+ 'movelog-moved',
 1389+ 'movelog-movedredir',
13881390 'movereason',
13891391 'revertmove',
13901392 'delete_and_move',
Index: branches/robchurch/logs/includes/DefaultSettings.php
@@ -2254,8 +2254,8 @@
22552255 'delete/revision' => 'logging-delete-revision',
22562256 'upload/upload' => 'uploadedimage',
22572257 'upload/revert' => 'uploadedimage',
2258 - 'move/move' => '1movedto2',
2259 - 'move/move_redir' => '1movedto2_redir',
 2258+ 'move/move' => 'movelog-moved',
 2259+ 'move/move_redir' => 'movelog-movedredir',
22602260 'import/upload' => 'import-logentry-upload',
22612261 'import/interwiki' => 'import-logentry-interwiki',
22622262 );
@@ -2267,6 +2267,7 @@
22682268 */
22692269 $wgLogActionCallbacks = array(
22702270 'block' => array( 'BlockLogFormatter', 'makeActionText' ),
 2271+ 'move' => array( 'CoreLogFormatter', 'formatMove' ),
22712272 'patrol' => array( 'PatrolLog', 'makeActionText' ),
22722273 'rights' => array( 'CoreLogFormatter', 'formatRights' ),
22732274 );
Index: branches/robchurch/logs/includes/CoreLogFormatter.php
@@ -10,6 +10,23 @@
1111 class CoreLogFormatter {
1212
1313 /**
 14+ * Build the action text for a move log item
 15+ *
 16+ * @param LogItem $item Item to format
 17+ * @return string
 18+ */
 19+ public static function formatMove( $item ) {
 20+ global $wgUser;
 21+ $skin = $wgUser->getSkin();
 22+ $data = $item->getParameters();
 23+
 24+ $params[] = $skin->makeLinkObj( $item->getTarget(), '', 'redirect=no' );
 25+ $params[] = $skin->makeLinkObj( Title::newFromText( $data[0] ) );
 26+
 27+ return LogFormatter::getActionText( $item, $params );
 28+ }
 29+
 30+ /**
1431 * Build the action text for a user rights log item
1532 *
1633 * @param LogItem $item Item to format
Index: branches/robchurch/logs/languages/messages/MessagesEn.php
@@ -2111,6 +2111,8 @@
21122112 '1movedto2_redir' => '[[$1]] moved to [[$2]] over redirect',
21132113 'movelogpage' => 'Move log',
21142114 'movelogpagetext' => 'Below is a list of page moved.',
 2115+'movelog-moved' => '$1 moved to $2',
 2116+'movelog-movedredir' => '$1 moved to $2 over redirect',
21152117 'movereason' => 'Reason:',
21162118 'revertmove' => 'revert',
21172119 'delete_and_move' => 'Delete and move',

Status & tagging log