+ if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
+ $s .= ' <tt>' . wfMsgHtml( 'deletedrev' ) . '</tt>';
+ }
+
+ $tools = array();
+
+ if ( !is_null( $next ) && is_object( $next ) ) {
+ if( !$this->mTitle->getUserPermissionsErrors( 'rollback', $wgUser )
+ && !$this->mTitle->getUserPermissionsErrors( 'edit', $wgUser )
+ && $latest ) {
+ $tools[] = '<span class="mw-rollback-link">'
+ . $this->mSkin->buildRollbackLink( $rev )
+ . '</span>';
+ }
+
+ if( $this->mTitle->quickUserCan( 'edit' ) &&
+ !$rev->isDeleted( Revision::DELETED_TEXT ) &&
+ !$next->rev_deleted & Revision::DELETED_TEXT ) {
+
+ # Create undo tooltip for the first (=latest) line only
+ $undoTooltip = $latest
+ ? array( 'title' => wfMsg( 'tooltip-undo' ) )
+ : array();
+ $undolink = $this->mSkin->link(
+ $this->mTitle,
+ wfMsgHtml( 'editundo' ),
+ $undoTooltip,
+ array( 'action' => 'edit', 'undoafter' => $next->rev_id, 'undo' => $rev->getId() ),
+ array( 'known', 'noclasses' )
+ );
+ $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
+ }