Index: trunk/extensions/MoodBar/SpecialFeedbackDashboard.php |
— | — | @@ -259,7 +259,11 @@ |
260 | 260 | ->link( $permalinkTitle, $linkText, array(), $query ); |
261 | 261 | $link = Xml::tags( 'span', array( 'class' => 'fbd-item-restore' ), "($link)" ); |
262 | 262 | |
263 | | - $footer = wfMessage('moodbar-hidden-footer')->rawParams($link)->escaped(); |
| 263 | + $feedback_hidden_detail = self::getFeedbackHiddenDetail($id); |
| 264 | + $footer = wfMessage('moodbar-hidden-footer')->rawParams( array( htmlspecialchars( $feedback_hidden_detail->log_user_text ), |
| 265 | + wfTimestamp( TS_DB, $feedback_hidden_detail->log_timestamp ), |
| 266 | + htmlspecialchars( $feedback_hidden_detail->log_comment ), |
| 267 | + $link ) )->escaped(); |
264 | 268 | return Xml::tags( 'div', array( 'class' => 'error' ), $footer ); |
265 | 269 | } elseif ( $mode === 'hidden' ) { |
266 | 270 | $linkText = wfMessage('moodbar-feedback-show')->escaped(); |
— | — | @@ -489,4 +493,25 @@ |
490 | 494 | } |
491 | 495 | return $query; |
492 | 496 | } |
| 497 | + |
| 498 | + /** |
| 499 | + * Get admin's username/timestamp/reason for hiding a feedback |
| 500 | + * @param $mbf_id primary key for moodbar_feedback |
| 501 | + * @return stdObject |
| 502 | + */ |
| 503 | + protected static function getFeedbackHiddenDetail( $mbf_id ) { |
| 504 | + $dbr = wfGetDB( DB_SLAVE ); |
| 505 | + |
| 506 | + $res = $dbr->select( array( 'logging' ), array( |
| 507 | + 'log_user_text', 'log_timestamp', 'log_comment' ), |
| 508 | + array( "log_namespace = " . NS_SPECIAL . " AND log_title = 'FeedbackDashboard/" . intval( $mbf_id ) . "' AND log_action = 'hide' AND log_type = 'moodbar'" ), |
| 509 | + __METHOD__, |
| 510 | + array( 'LIMIT' => 1, 'ORDER BY' => "log_timestamp DESC" ) |
| 511 | + ); |
| 512 | + |
| 513 | + $rows = iterator_to_array( $res, /*$use_keys=*/false ); |
| 514 | + |
| 515 | + return current($rows); |
| 516 | + } |
| 517 | + |
493 | 518 | } |
Index: trunk/extensions/MoodBar/MoodBar.i18n.php |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | 'moodbar-comment-hidden' => '(Feedback hidden by administrative action)', |
96 | 96 | 'moodbar-feedback-show' => 'show hidden feedback', |
97 | 97 | 'moodbar-feedback-hide' => 'hide feedback', |
98 | | - 'moodbar-hidden-footer' => 'Hidden Feedback $1', |
| 98 | + 'moodbar-hidden-footer' => 'Hidden Feedback by $1 on $2, reason: $3 $4', |
99 | 99 | 'moodbar-feedback-restore' => 'restore hidden feedback', |
100 | 100 | 'moodbar-action-item' => 'Feedback item:', |
101 | 101 | 'moodbar-action-reason' => 'Reason:', |
— | — | @@ -273,7 +273,7 @@ |
274 | 274 | {{Identical|More}}', |
275 | 275 | 'moodbar-feedback-newer' => 'Text of the link that the user can click to go back to more recent results. Only visible if JavaScript is not enabled.', |
276 | 276 | 'moodbar-feedback-older' => 'Text of the link that the user can click to see less recent results. Only visible if JavaScript is not enabled.', |
277 | | - 'moodbar-hidden-footer' => '* $1 is a link to restore the item displaying {{msg-mw|moodbar-feedback-restore}}', |
| 277 | + 'moodbar-hidden-footer' => '* $1 is the username, $2 is the time stamp, $3 is the reason for hiding the feedback,$4 is a link to restore the item displaying {{msg-mw|moodbar-feedback-restore}}', |
278 | 278 | 'moodbar-type-happy' => '$1 is the username that can be used for GENDER', |
279 | 279 | 'moodbar-type-sad' => '$1 is the username that can be used for GENDER', |
280 | 280 | 'moodbar-type-confused' => '$1 is the username that can be used for GENDER', |