Index: trunk/extensions/CleanChanges/CleanChanges_body.php |
— | — | @@ -114,10 +114,15 @@ |
115 | 115 | } |
116 | 116 | |
117 | 117 | protected function getLogAction( $rc ) { |
118 | | - if ( $this->isDeleted($rc, LogPage::DELETED_ACTION) ) { |
| 118 | + global $wgUser; |
| 119 | + |
| 120 | + $priviledged = $wgUser->isAllowed('deleterevision'); |
| 121 | + $deleted = $this->isDeleted($rc, LogPage::DELETED_ACTION); |
| 122 | + |
| 123 | + if ( $deleted && !$priviledged ) { |
119 | 124 | return $this->XMLwrapper( 'history-deleted', wfMsg('rev-deleted-event') ); |
120 | 125 | } else { |
121 | | - return LogPage::actionText( |
| 126 | + $action = LogPage::actionText( |
122 | 127 | $rc->getAttribute('rc_log_type'), |
123 | 128 | $rc->getAttribute('rc_log_action'), |
124 | 129 | $rc->getTitle(), |
— | — | @@ -126,6 +131,11 @@ |
127 | 132 | true, |
128 | 133 | true |
129 | 134 | ); |
| 135 | + if ( $deleted ) { |
| 136 | + $class = array( 'class' => 'history-deleted' ); |
| 137 | + $action = Xml::tags( 'span', $class, $action ); |
| 138 | + } |
| 139 | + return $action; |
130 | 140 | } |
131 | 141 | } |
132 | 142 | |
— | — | @@ -176,13 +186,8 @@ |
177 | 187 | $rc->getAttribute( 'rc_user_text' ) ); |
178 | 188 | $rc->_userInfo = $stuff[0]; |
179 | 189 | |
180 | | - $rc->_comment = $this->skin->commentBlock( |
181 | | - $rc->getAttribute( 'rc_comment' ), $titleObj ); |
| 190 | + $rc->_comment = $this->getComment( $rc ); |
182 | 191 | |
183 | | - if ( $logEntry ) { |
184 | | - $rc->_comment = $this->getLogAction( $rc ) . ' ' . $rc->_comment; |
185 | | - } |
186 | | - |
187 | 192 | $rc->_watching = $this->numberofWatchingusers( $baseRC->numberofWatchingusers ); |
188 | 193 | |
189 | 194 | |
— | — | @@ -408,6 +413,26 @@ |
409 | 414 | |
410 | 415 | } |
411 | 416 | |
| 417 | + public function getComment( $rc ) { |
| 418 | + global $wgUser; |
| 419 | + $comment = $rc->getAttribute( 'rc_comment' ); |
| 420 | + $action = ''; |
| 421 | + if ( $this->isLog($rc) ) $action = $this->getLogAction( $rc ); |
| 422 | + |
| 423 | + if ( $comment === '' ) { |
| 424 | + return $action; |
| 425 | + } elseif ( $this->isDeleted( $rc, LogPage::DELETED_COMMENT ) ) { |
| 426 | + $priviledged = $wgUser->isAllowed('deleterevision'); |
| 427 | + if ( $priviledged ) { |
| 428 | + return $action . ' <span class="history-deleted">' . $comment . '</span>'; |
| 429 | + } else { |
| 430 | + return $action . ' <span class="history-deleted">' . wfMsgHtml( 'rev-deleted-comment' ) . '</span>'; |
| 431 | + } |
| 432 | + } else { |
| 433 | + return $action . $this->skin->commentBlock( $comment, $rc->getTitle() ); |
| 434 | + } |
| 435 | + } |
| 436 | + |
412 | 437 | /** |
413 | 438 | * Enhanced user tool links, with javascript functionality. |
414 | 439 | */ |