Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1154,6 +1154,7 @@ |
1155 | 1155 | 'alreadyrolled', |
1156 | 1156 | 'editcomment', |
1157 | 1157 | 'revertpage', |
| 1158 | + 'rollback-success', |
1158 | 1159 | 'sessionfailure', |
1159 | 1160 | 'protectlogpage', |
1160 | 1161 | 'protectlogtext', |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -2257,17 +2257,21 @@ |
2258 | 2258 | $newComment = wfMsgForContent( 'revertpage', $target->getUserText(), $from ); |
2259 | 2259 | $newComment = $wgRequest->getText( 'summary', $newComment ); |
2260 | 2260 | |
2261 | | - # Save it! |
2262 | | - $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) ); |
2263 | | - $wgOut->setRobotpolicy( 'noindex,nofollow' ); |
2264 | | - $wgOut->addHTML( '<h2>' . htmlspecialchars( $newComment ) . "</h2>\n<hr />\n" ); |
2265 | | - |
| 2261 | + # Save |
2266 | 2262 | $flags = EDIT_UPDATE | EDIT_MINOR; |
2267 | 2263 | if( $bot ) |
2268 | 2264 | $flags |= EDIT_FORCE_BOT; |
2269 | | - if( !$this->doEdit( $target->getText(), $newComment, $flags ) ) |
2270 | | - ; # todo: this error case has not been handled? Use db transactions? |
| 2265 | + $this->doEdit( $target->getText(), $newComment, $flags ); |
2271 | 2266 | |
| 2267 | + # User feedback |
| 2268 | + $wgOut->setPageTitle( wfMsg( 'actioncomplete' ) ); |
| 2269 | + $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
| 2270 | + $old = $wgUser->getSkin()->userLink( $current->getUser(), $current->getUserText() ) |
| 2271 | + . $wgUser->getSkin()->userToolLinks( $current->getUser(), $current->getUserText() ); |
| 2272 | + $new = $wgUser->getSkin()->userLink( $target->getUser(), $target->getUserText() ) |
| 2273 | + . $wgUser->getSkin()->userToolLinks( $target->getUser(), $target->getUserText() ); |
| 2274 | + $wgOut->addHtml( wfMsgExt( 'rollback-success', array( 'parse', 'replaceafter' ), $old, $new ) ); |
| 2275 | + |
2272 | 2276 | $wgOut->returnToMain( false ); |
2273 | 2277 | } |
2274 | 2278 | |
— | — | @@ -2991,6 +2995,4 @@ |
2992 | 2996 | $wgOut->addParserOutput( $parserOutput ); |
2993 | 2997 | } |
2994 | 2998 | |
2995 | | -} |
2996 | | - |
2997 | | - |
| 2999 | +} |
\ No newline at end of file |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -1175,15 +1175,28 @@ |
1176 | 1176 | * @param Revision $rev |
1177 | 1177 | */ |
1178 | 1178 | function generateRollback( $rev ) { |
1179 | | - global $wgUser, $wgRequest; |
| 1179 | + return '<span class="mw-rollback-link">[' |
| 1180 | + . $this->buildRollbackLink( $rev ) |
| 1181 | + . ']</span>'; |
| 1182 | + } |
| 1183 | + |
| 1184 | + /** |
| 1185 | + * Build a raw rollback link, useful for collections of "tool" links |
| 1186 | + * |
| 1187 | + * @param Revision $rev |
| 1188 | + * @return string |
| 1189 | + */ |
| 1190 | + public function buildRollbackLink( $rev ) { |
| 1191 | + global $wgRequest, $wgUser; |
1180 | 1192 | $title = $rev->getTitle(); |
1181 | | - |
1182 | | - $extraRollback = $wgRequest->getBool( 'bot' ) ? '&bot=1' : ''; |
1183 | | - $extraRollback .= '&token=' . urlencode( |
1184 | | - $wgUser->editToken( array( $title->getPrefixedText(), $rev->getUserText() ) ) ); |
1185 | | - return '<span class="mw-rollback-link">['. $this->makeKnownLinkObj( $title, |
1186 | | - wfMsg('rollbacklink'), |
1187 | | - 'action=rollback&from=' . urlencode( $rev->getUserText() ) . $extraRollback ) .']</span>'; |
| 1193 | + $extra = $wgRequest->getBool( 'bot' ) ? '&bot=1' : ''; |
| 1194 | + $extra .= '&token=' . urlencode( $wgUser->editToken( array( $title->getPrefixedText(), |
| 1195 | + $rev->getUserText() ) ) ); |
| 1196 | + return $this->makeKnownLinkObj( |
| 1197 | + $title, |
| 1198 | + wfMsgHtml( 'rollbacklink' ), |
| 1199 | + 'action=rollback&from=' . urlencode( $rev->getUserText() ) . $extra |
| 1200 | + ); |
1188 | 1201 | } |
1189 | 1202 | |
1190 | 1203 | /** |
— | — | @@ -1323,3 +1336,4 @@ |
1324 | 1337 | } |
1325 | 1338 | |
1326 | 1339 | |
| 1340 | + |
Index: trunk/phase3/includes/PageHistory.php |
— | — | @@ -244,19 +244,26 @@ |
245 | 245 | if( $row->rev_deleted & Revision::DELETED_TEXT ) { |
246 | 246 | $s .= ' ' . wfMsgHtml( 'deletedrev' ); |
247 | 247 | } |
| 248 | + |
| 249 | + $tools = array(); |
| 250 | + |
248 | 251 | if( $wgUser->isAllowed( 'rollback' ) && $latest ) { |
249 | | - $s .= ' '.$this->mSkin->generateRollback( $rev ); |
| 252 | + $tools[] = '<span class="mw-rollback-link">' |
| 253 | + . $this->mSkin->buildRollbackLink( $rev ) |
| 254 | + . '</span>'; |
250 | 255 | } |
251 | | - |
| 256 | + |
252 | 257 | if ( !is_null( $next ) ) { |
253 | 258 | $undolink = $this->mSkin->makeKnownLinkObj( |
254 | 259 | $this->mTitle, |
255 | | - '(' . wfMsgHtml( 'editundo' ) . ')', |
| 260 | + wfMsgHtml( 'editundo' ), |
256 | 261 | 'action=edit&undoafter=' . $next->rev_id . '&undo=' . $rev->getId() |
257 | 262 | ); |
258 | | - $s .= " <span class=\"mw-history-undo\">{$undolink}</span>"; |
| 263 | + $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>"; |
259 | 264 | } |
260 | 265 | |
| 266 | + $s .= ' (' . implode( ' | ', $tools ) . ')'; |
| 267 | + |
261 | 268 | wfRunHooks( 'PageHistoryLineEnding', array( &$row , &$s ) ); |
262 | 269 | |
263 | 270 | $s .= "</li>\n"; |
— | — | @@ -599,3 +606,4 @@ |
600 | 607 | } |
601 | 608 | |
602 | 609 | |
| 610 | + |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1802,6 +1802,7 @@ |
1803 | 1803 | Last edit was by [[User:$3|$3]] ([[User talk:$3|Talk]]).', |
1804 | 1804 | 'editcomment' => 'The edit comment was: "<i>$1</i>".', # only shown if there is an edit comment |
1805 | 1805 | 'revertpage' => 'Reverted edits by [[Special:Contributions/$2|$2]] ([[User talk:$2|Talk]]); changed back to last version by [[User:$1|$1]]', |
| 1806 | +'rollback-success' => 'Reverted edits by $1; changed back to last version by $2.', |
1806 | 1807 | 'sessionfailure' => 'There seems to be a problem with your login session; |
1807 | 1808 | this action has been canceled as a precaution against session hijacking. |
1808 | 1809 | Please hit "back" and reload the page you came from, then try again.', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -124,6 +124,7 @@ |
125 | 125 | removals, and convenient exporting of watchlist contents |
126 | 126 | * Show "undo" links in page histories |
127 | 127 | * Option to jump to specified time period in user contributions |
| 128 | +* Improved feedback on "rollback success" page |
128 | 129 | |
129 | 130 | == Bugfixes since 1.10 == |
130 | 131 | |