From af7cabcf2f24ca9a0d737559bd256a3fc742eabd Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 28 Mar 2006 16:02:39 +0000 Subject: [PATCH] (bug 5378) General logs link in Special:Contributions --- RELEASE-NOTES | 2 +- includes/SpecialContributions.php | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d7f10761b5..92ef739e9f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -377,7 +377,7 @@ Special Pages: * Move parentheses out of link in Special:Contributions * (bug 3192): properly check 'limit' parameter on Special:Contributions * (bug 3187) watchlist text refer to unexistent "Stop watching" action -* Add block link and a link to the block log to Special:Contributions +* Add block, block log and general log links to Special:Contributions * Add contributions link to block log items * Added optional "hide own edits" feature to Special:Recentchanges * (bug 5018) Anchors for each message in Special:Allmessages diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 80dab948e4..7f1dc75848 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -153,7 +153,7 @@ class contribs_finder { * @param string $par (optional) user name of the user for which to show the contributions */ function wfSpecialContributions( $par = null ) { - global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgTitle, $wgScript; + global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgTitle, $wgScript, $wgSysopUserBans; $fname = 'wfSpecialContributions'; $target = isset($par) ? $par : $wgRequest->getVal( 'target' ); @@ -221,14 +221,18 @@ function wfSpecialContributions( $par = null ) { } $talk = $nt->getTalkPage(); if( $talk ) { - $ul .= ' (' . $sk->makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) ); - if( ( $id != 0 ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) { - if( $wgUser->isAllowed( 'block' ) ) { - $ul .= ' | ' . $sk->makeLinkObj( Title::makeTitle( NS_SPECIAL, 'Blockip/' . $nt->getText() ), wfMsgHtml( 'blocklink' ) ); - } - $ul .= ' | ' . $sk->makeLinkObj( Title::makeTitle( NS_SPECIAL, 'Log' ), LogPage::logName( 'block' ), 'type=block&page=' . urlencode( $nt->getPrefixedText() ) ); + # Talk page link + $tools[] = $sk->makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) ); + if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) { + # Block link + if( $wgUser->isAllowed( 'block' ) ) + $tools[] = $sk->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Blockip/' . urlencode( $nt->getText() ) ), wfMsgHtml( 'blocklink' ) ); + # Block log link + $tools[] = $sk->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Log' ), htmlspecialchars( LogPage::logName( 'block' ) ), 'type=block&page=' . urlencode( $nt->getPrefixedText() ) ); } - $ul .= ')'; + # Other logs link + $tools[] = $sk->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Log' ), wfMsgHtml( 'log' ), 'user=' . urlencode( $nt->getText() ) ); + $ul .= ' (' . implode( ' | ', $tools ) . ')'; } if ($target == 'newbies') { -- 2.20.1