From: Aryeh Gregor Date: Thu, 16 Nov 2006 07:18:18 +0000 (+0000) Subject: (bug 3315) Allow rollback directly from history page. X-Git-Tag: 1.31.0-rc.0~55177 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=f8d59b69153f490682455e3c7e380d63b8ea0fd6;p=lhc%2Fweb%2Fwiklou.git (bug 3315) Allow rollback directly from history page. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 34d3616e9e..458d4beef4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -185,6 +185,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 6839) Wikibits.js minor changes to make JS-lint happier. * (bug 7932) Make sure that edit toolbar clears floats so it appears correctly. * (bug 6873) When viewing old revisions, add link to diff to current version. +* (bug 3315) Allow rollback directly from history page. == Languages updated == diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 380bbe2637..780b5a0013 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -168,7 +168,7 @@ class PageHistory { /** @todo document */ function historyLine( $row, $next, $counter = '', $notificationtimestamp = false, $latest = false, $firstInList = false ) { - global $wgUser; + global $wgUser, $wgRequest, $wgTitle; $rev = new Revision( $row ); $rev->setTitle( $this->mTitle ); @@ -210,6 +210,14 @@ class PageHistory { if( $row->rev_deleted & Revision::DELETED_TEXT ) { $s .= ' ' . wfMsgHtml( 'deletedrev' ); } + if( $wgUser->isAllowed( 'rollback' ) && $firstInList ) { + $extraRollback = $wgRequest->getBool( 'bot' ) ? '&bot=1' : ''; + $extraRollback .= '&token=' . urlencode( + $wgUser->editToken( array( $wgTitle->getPrefixedText(), $rev->getUserText() ) ) ); + $s .= ' ['. $this->mSkin->makeKnownLinkObj( $wgTitle, + wfMsg('rollbacklink'), + 'action=rollback&from=' . $rev->getUserText() . $extraRollback ) .']'; + } $s .= "\n"; return $s;