From 12683a093ecf2580eb700757cf6f6a09fe67544b Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sun, 29 Jan 2006 23:24:01 +0000 Subject: [PATCH] Clean up code in, and add contributions link to block log items --- RELEASE-NOTES | 1 + includes/LogPage.php | 30 +++++++++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 20a3fbb115..0136bb9b78 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/LogPage.php b/includes/LogPage.php index 19cc2900b5..f025742c6d 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -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(); } -- 2.20.1