From 71a2a5cd25ad595e6b6eefac8c5c9224ceb12ab2 Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Mon, 22 Mar 2004 04:26:32 +0000 Subject: [PATCH] contributions list: - added diff links for (top) edits - added history links - documented a function --- includes/SpecialContributions.php | 44 ++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 373857f0ec..0ddeb4a22a 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -127,24 +127,48 @@ function wfSpecialContributions( $par = "" ) $wgOut->addHTML( "\n" ); } + +/* + +Generates each row in the contributions list. + +Contributions which are marked "top" are currently on top of the history. +For these contributions, a [rollback] link is shown for users with sysop +privileges. The rollback link restores the most recent version that was not +written by the target user. + +If the contributions page is called with the parameter &bot=1, all rollback +links also get that parameter. It causes the edit itself and the rollback +to be marked as "bot" edits. Bot edits are hidden by default from recent +changes, so this allows sysops to combat a busy vandal without bothering +other users. + +TODO: This would probably look a lot nicer in a table. + +*/ function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor ) { global $wgLang, $wgOut, $wgUser, $wgRequest, $target; $page = Title::makeName( $ns, $t ); $link = $sk->makeKnownLink( $page, "" ); - $topmarktext = $topmark ? wfMsg ( "uctop" ) : ""; - $sysop = $wgUser->isSysop(); + $topmarktext=""; + if($topmark) { + $topmarktext .= $sk->makeKnownLink( $page, wfMsg("uctop"), "diff=0" ); + $sysop = $wgUser->isSysop(); + if($sysop ) { + $extraRollback = $wgRequest->getBool( "bot" ) ? '&bot=1' : ''; + $topmarktext .= " [". $sk->makeKnownLink( $page, + wfMsg( "rollbacklink" ), + "action=rollback&from=" . urlencode( $target ) . $extraRollback ) ."]"; + } - $extraRollback = $wgRequest->getBool( "bot" ) ? '&bot=1' : ''; - if($sysop && $topmark ) { - $topmarktext .= " [". $sk->makeKnownLink( $page, - wfMsg( "rollbacklink" ), - "action=rollback&from=" . urlencode( $target ) . $extraRollback ) ."]"; } + $histlink="(".$sk->makeKnownLink($page,wfMsg("hist"),"action=history").")"; + if($comment) { - + $comment="(". htmlspecialchars( $comment ) .") "; - + } $d = $wgLang->timeanddate( $ts, true ); @@ -154,7 +178,7 @@ function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor ) $mflag = ""; } - $wgOut->addHTML( "
  • {$d} {$mflag}{$link} {$comment}{$topmarktext}
  • \n" ); + $wgOut->addHTML( "
  • {$d} {$histlink} {$mflag} {$link} {$comment}{$topmarktext}
  • \n" ); } function ucCountLink( $lim, $d ) -- 2.20.1