* Fix odd user interface behaviour in rollback success pages - introduce a separate message for the UI feedback and pass standard tool links
removals, and convenient exporting of watchlist contents
* Show "undo" links in page histories
* Option to jump to specified time period in user contributions
+* Improved feedback on "rollback success" page
== Bugfixes since 1.10 ==
$newComment = wfMsgForContent( 'revertpage', $target->getUserText(), $from );
$newComment = $wgRequest->getText( 'summary', $newComment );
- # Save it!
- $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
- $wgOut->setRobotpolicy( 'noindex,nofollow' );
- $wgOut->addHTML( '<h2>' . htmlspecialchars( $newComment ) . "</h2>\n<hr />\n" );
-
+ # Save
$flags = EDIT_UPDATE | EDIT_MINOR;
if( $bot )
$flags |= EDIT_FORCE_BOT;
- if( !$this->doEdit( $target->getText(), $newComment, $flags ) )
- ; # todo: this error case has not been handled? Use db transactions?
+ $this->doEdit( $target->getText(), $newComment, $flags );
+
+ # User feedback
+ $wgOut->setPageTitle( wfMsg( 'actioncomplete' ) );
+ $wgOut->setRobotPolicy( 'noindex,nofollow' );
+ $old = $wgUser->getSkin()->userLink( $current->getUser(), $current->getUserText() )
+ . $wgUser->getSkin()->userToolLinks( $current->getUser(), $current->getUserText() );
+ $new = $wgUser->getSkin()->userLink( $target->getUser(), $target->getUserText() )
+ . $wgUser->getSkin()->userToolLinks( $target->getUser(), $target->getUserText() );
+ $wgOut->addHtml( wfMsgExt( 'rollback-success', array( 'parse', 'replaceafter' ), $old, $new ) );
$wgOut->returnToMain( false );
}
$wgOut->addParserOutput( $parserOutput );
}
-}
-
-
+}
\ No newline at end of file
* @param Revision $rev
*/
function generateRollback( $rev ) {
- global $wgUser, $wgRequest;
+ return '<span class="mw-rollback-link">['
+ . $this->buildRollbackLink( $rev )
+ . ']</span>';
+ }
+
+ /**
+ * Build a raw rollback link, useful for collections of "tool" links
+ *
+ * @param Revision $rev
+ * @return string
+ */
+ public function buildRollbackLink( $rev ) {
+ global $wgRequest, $wgUser;
$title = $rev->getTitle();
-
- $extraRollback = $wgRequest->getBool( 'bot' ) ? '&bot=1' : '';
- $extraRollback .= '&token=' . urlencode(
- $wgUser->editToken( array( $title->getPrefixedText(), $rev->getUserText() ) ) );
- return '<span class="mw-rollback-link">['. $this->makeKnownLinkObj( $title,
- wfMsg('rollbacklink'),
- 'action=rollback&from=' . urlencode( $rev->getUserText() ) . $extraRollback ) .']</span>';
+ $extra = $wgRequest->getBool( 'bot' ) ? '&bot=1' : '';
+ $extra .= '&token=' . urlencode( $wgUser->editToken( array( $title->getPrefixedText(),
+ $rev->getUserText() ) ) );
+ return $this->makeKnownLinkObj(
+ $title,
+ wfMsgHtml( 'rollbacklink' ),
+ 'action=rollback&from=' . urlencode( $rev->getUserText() ) . $extra
+ );
}
/**
}
+
if( $row->rev_deleted & Revision::DELETED_TEXT ) {
$s .= ' ' . wfMsgHtml( 'deletedrev' );
}
+
+ $tools = array();
+
if( $wgUser->isAllowed( 'rollback' ) && $latest ) {
- $s .= ' '.$this->mSkin->generateRollback( $rev );
+ $tools[] = '<span class="mw-rollback-link">'
+ . $this->mSkin->buildRollbackLink( $rev )
+ . '</span>';
}
-
+
if ( !is_null( $next ) ) {
$undolink = $this->mSkin->makeKnownLinkObj(
$this->mTitle,
- '(' . wfMsgHtml( 'editundo' ) . ')',
+ wfMsgHtml( 'editundo' ),
'action=edit&undoafter=' . $next->rev_id . '&undo=' . $rev->getId()
);
- $s .= " <span class=\"mw-history-undo\">{$undolink}</span>";
+ $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
}
+ $s .= ' (' . implode( ' | ', $tools ) . ')';
+
wfRunHooks( 'PageHistoryLineEnding', array( &$row , &$s ) );
$s .= "</li>\n";
}
+
Last edit was by [[User:$3|$3]] ([[User talk:$3|Talk]]).',
'editcomment' => 'The edit comment was: "<i>$1</i>".', # only shown if there is an edit comment
'revertpage' => 'Reverted edits by [[Special:Contributions/$2|$2]] ([[User talk:$2|Talk]]); changed back to last version by [[User:$1|$1]]',
+'rollback-success' => 'Reverted edits by $1; changed back to last version by $2.',
'sessionfailure' => 'There seems to be a problem with your login session;
this action has been canceled as a precaution against session hijacking.
Please hit "back" and reload the page you came from, then try again.',
'alreadyrolled',
'editcomment',
'revertpage',
+ 'rollback-success',
'sessionfailure',
'protectlogpage',
'protectlogtext',