(bug 5378) General logs link in Special:Contributions
authorRob Church <robchurch@users.mediawiki.org>
Tue, 28 Mar 2006 16:02:39 +0000 (16:02 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Tue, 28 Mar 2006 16:02:39 +0000 (16:02 +0000)
RELEASE-NOTES
includes/SpecialContributions.php

index d7f1076..92ef739 100644 (file)
@@ -377,7 +377,7 @@ Special Pages:
 * Move parentheses out of <a> 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
index 80dab94..7f1dc75 100644 (file)
@@ -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') {