Clean up code in, and add contributions link to block log items
authorRob Church <robchurch@users.mediawiki.org>
Sun, 29 Jan 2006 23:24:01 +0000 (23:24 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sun, 29 Jan 2006 23:24:01 +0000 (23:24 +0000)
RELEASE-NOTES
includes/LogPage.php

index 20a3fbb..0136bb9 100644 (file)
@@ -342,6 +342,7 @@ Special Pages:
 * (bug 3187) watchlist text refer to unexistent "Stop watching" action
 * Add block link and a link to the block log to Special:Contributions
 * Added $wgInvisibleGroups, to hide groups from Special:Listusers
+* Add contributions link to block log items
 
 Misc.:
 * PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect
index 19cc290..f025742 100644 (file)
@@ -173,21 +173,25 @@ class LogPage {
                                $rv=wfMsg( $actions[$key] );
                        } else {
                                if( $skin ) {
-                                       if ( $type == 'move' ) {
-                                               $titleLink = $skin->makeLinkObj( $title, $title->getPrefixedText(), 'redirect=no' );
-                                               // Change $param[0] into a link to the title specified in $param[0]
-                                               $movedTo = Title::newFromText( $params[0] );
-                                               $params[0] = $skin->makeLinkObj( $movedTo, $params[0] );
-                                       } else {
-                                               # Bug 4359: red [[user:#id]] links generated in [[special:Log]]
-                                               # If it's an autoblock, don't do a link
-                                               if( $type == 'block' ) {
-                                                       $titletext = $title->getText();
-                                                       $titleLink = ( ( substr( $titletext, 0, 1 ) == '#' ) ? $titletext : $skin->makeLinkObj( $title ) );
-                                               } else {
+
+                                       switch( $type ) {
+                                               case 'move':
+                                                       $titleLink = $skin->makeLinkObj( $title, $title->getPrefixedText(), 'redirect=no' );
+                                                       $params[0] = $skin->makeLinkObj( Title::newFromText( $params[0] ), $params[0] );
+                                                       break;
+                                               case 'block':
+                                                       $titleText = $title->getText();
+                                                       if( substr( $titleText, 0, 1 ) == '#' ) {
+                                                               $titleLink = $titleText;
+                                                       } else {
+                                                               $titleLink = $skin->makeLinkObj( $title, $titleText );
+                                                               $titleLink .= ' (' . $skin->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Contributions/' . urlencode( $titleText ) ), wfMsg( 'contribslink' ) ) . ')';
+                                                       }
+                                                       break;
+                                               default:
                                                        $titleLink = $skin->makeLinkObj( $title );
-                                               }
                                        }
+
                                } else {
                                        $titleLink = $title->getPrefixedText();
                                }