r23770 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23769‎ | r23770 | r23771 >
Date:06:52, 6 July 2007
Author:werdna
Status:old
Tags:
Comment:
Add (undo) buttons onto page history, for people with rollback privilege only (that's changeable very simply.. just put in place to ward off whingers). Also, minorly, switch the undoafter and undo parameters if they're given the wrong way around, which seems like a more sensible thing to do than silently fail. I would have renamed them undo1 and undo2, but that'd cause all kinds of chaos.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/PageHistory.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -98,6 +98,13 @@
9999
100100 $text = $this->mArticle->getContent();
101101
 102+ if ($undo > 0 && $undoafter > 0 && $undo < $undoafter) {
 103+ # If they got undoafter and undo round the wrong way, switch them
 104+ $temp = $undoafter;
 105+ $undoafter = $undo;
 106+ $undo = $temp;
 107+ }
 108+
102109 if ( $undo > 0 && $undo > $undoafter ) {
103110 # Undoing a specific edit overrides section editing; section-editing
104111 # doesn't work with undoing.
Index: trunk/phase3/includes/PageHistory.php
@@ -247,6 +247,14 @@
248248 if( $wgUser->isAllowed( 'rollback' ) && $latest ) {
249249 $s .= ' '.$this->mSkin->generateRollback( $rev );
250250 }
 251+
 252+ if ( $wgUser->isAllowed( 'rollback' ) && !is_null($next)) {
 253+ $undolink = $this->mSkin->makeKnownLinkObj(
 254+ $this->mTitle, '('.htmlspecialchars( wfMsg( 'editundo' ) ).')',
 255+ 'action=edit&undoafter=' . $next->rev_id . '&undo=' . $rev->getId(),
 256+ '', '', '', null );
 257+ $s .= ' <span class="mw-history-undo"> '."$undolink </span>";
 258+ }
251259
252260 wfRunHooks( 'PageHistoryLineEnding', array( &$row , &$s ) );
253261
Index: trunk/phase3/RELEASE-NOTES
@@ -122,6 +122,8 @@
123123 * (bug 10438) HTML TeX formulas should not wrap
124124 * Introduce "raw editing" mode for the watchlist, to allow bulk additions,
125125 removals, and convenient exporting of watchlist contents
 126+* Put an (undo) button on the page history page, for people with rollback
 127+ permission only.
126128
127129 == Bugfixes since 1.10 ==
128130

Follow-up revisions

RevisionCommit summaryAuthorDate
r23912Merged revisions 23662-23909 via svnmerge from...david18:11, 9 July 2007

Status & tagging log