r23470 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23469‎ | r23470 | r23471 >
Date:09:17, 27 June 2007
Author:robchurch
Status:old
Tags:
Comment:
Pass the skin to action text builders
Modified paths:
  • /branches/robchurch/logs/includes/BlockLogFormatter.php (modified) (history)
  • /branches/robchurch/logs/includes/CoreLogFormatter.php (modified) (history)
  • /branches/robchurch/logs/includes/LogFormatter.php (modified) (history)

Diff [purge]

Index: branches/robchurch/logs/includes/CoreLogFormatter.php
@@ -12,29 +12,26 @@
1313 /**
1414 * Build the action text for a move log item
1515 *
16 - * @param LogItem $item Item to format
 16+ * @param LogItem $item Log item to format
 17+ * @param Skin $skin Skin to use for link building, etc.
1718 * @return string
1819 */
19 - public static function formatMove( $item ) {
20 - global $wgUser;
21 - $skin = $wgUser->getSkin();
 20+ public static function formatMove( $item, $skin ) {
2221 $data = $item->getParameters();
23 -
2422 $params[] = $skin->makeLinkObj( $item->getTarget(), '', 'redirect=no' );
2523 $params[] = $skin->makeLinkObj( Title::newFromText( $data[0] ) );
26 -
2724 return LogFormatter::getActionText( $item, $params );
2825 }
2926
3027 /**
3128 * Build the action text for a user rights log item
3229 *
33 - * @param LogItem $item Item to format
 30+ * @param LogItem $item Log item to format
 31+ * @param Skin $skin Skin to use for link building, etc.
3432 * @return string
3533 */
36 - public static function formatRights( $item ) {
37 - global $wgUser, $wgContLang;
38 - $skin = $wgUser->getSkin();
 34+ public static function formatRights( $item, $skin ) {
 35+ global $wgContLang;
3936 $target = $wgContLang->ucfirst( $item->getTarget()->getText() );
4037 $data = $item->getParameters();
4138
Index: branches/robchurch/logs/includes/BlockLogFormatter.php
@@ -17,12 +17,12 @@
1818 /**
1919 * Build the action text for a block log item
2020 *
21 - * @param LogItem $item
 21+ * @param LogItem $item Log item to format
 22+ * @param Skin $skin Skin to use for link building, etc.
2223 * @return string
2324 */
24 - public static function makeActionText( $item ) {
 25+ public static function makeActionText( $item, $skin ) {
2526 global $wgUser, $wgLang, $wgLogActions;
26 - $skin = $wgUser->getSkin();
2727 $data = $item->getParameters();
2828
2929 # Target link
Index: branches/robchurch/logs/includes/LogFormatter.php
@@ -56,7 +56,7 @@
5757 # Action
5858 if( ( $callback = self::getActionCallback( $item ) ) !== false ) {
5959 # Custom action text callback
60 - $parts[] = call_user_func( $callback, $item );
 60+ $parts[] = call_user_func( $callback, $item, $skin );
6161 } else {
6262 # Use the message
6363 $params = $item->getParameters();

Status & tagging log