Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php |
— | — | @@ -214,7 +214,11 @@ |
215 | 215 | 'af_is_deleted', 'af_oversight_count', 'af_revision_id', |
216 | 216 | 'af_net_helpfulness', 'af_revision_id', |
217 | 217 | 'page_latest', 'page_title', 'page_namespace', |
218 | | - 'rating.aa_response_boolean AS rating' |
| 218 | + 'rating.aa_response_boolean AS rating', |
| 219 | + 'af_hide_user_id', |
| 220 | + 'af_hide_timestamp', |
| 221 | + 'af_oversight_user_id', |
| 222 | + 'af_oversight_timestamp' |
219 | 223 | ), |
220 | 224 | array( 'af_id' => $ids ), |
221 | 225 | __METHOD__, |
— | — | @@ -483,10 +487,47 @@ |
484 | 488 | if ( $record[0]->af_is_deleted ) { |
485 | 489 | $topClass .= ' articleFeedbackv5-feedback-deleted'; |
486 | 490 | } |
487 | | - return Html::openElement( 'div', array( |
| 491 | + |
| 492 | + $attributes = array( |
488 | 493 | 'class' => $topClass, |
489 | 494 | 'rel' => $id |
490 | | - ) ) |
| 495 | + ); |
| 496 | + if ( $record[0]->af_is_hidden ) { |
| 497 | + // if user is 0, we use a fake user |
| 498 | + if ($record[0]->af_hide_user_id > 0) { |
| 499 | + $user = User::newFromId( $record[0]->af_hide_user_id ); |
| 500 | + if ($user) { |
| 501 | + $name = $user->getName(); |
| 502 | + } |
| 503 | + } |
| 504 | + if(!isset($name)) { |
| 505 | + $name = 'Article Feedback V5'; |
| 506 | + } |
| 507 | + |
| 508 | + $attributes['hide_user'] = $name; |
| 509 | + if ($record[0]->af_hide_timestamp > 0) { |
| 510 | + $attributes['hide_timestamp'] = wfTimestamp( TS_RFC2822, $record[0]->af_hide_timestamp ); |
| 511 | + } |
| 512 | + } |
| 513 | + if ( $record[0]->af_is_deleted ) { |
| 514 | + // if user is 0, we use a fake user |
| 515 | + if ($record[0]->af_oversight_user_id > 0) { |
| 516 | + $user = User::newFromId( $record[0]->af_oversight_user_id ); |
| 517 | + if ($user) { |
| 518 | + $name = $user->getName(); |
| 519 | + } |
| 520 | + } |
| 521 | + if(!isset($name)) { |
| 522 | + $name = 'Article Feedback V5'; |
| 523 | + } |
| 524 | + |
| 525 | + $attributes['oversight_user'] = $name; |
| 526 | + if ($record[0]->af_oversight_timestamp > 0) { |
| 527 | + $attributes['oversight_timestamp'] = wfTimestamp( TS_RFC2822, $record[0]->af_oversight_timestamp ); |
| 528 | + } |
| 529 | + } |
| 530 | + |
| 531 | + return Html::openElement( 'div', $attributes ) |
491 | 532 | . Html::openElement( 'div', array( |
492 | 533 | 'class' => "articleFeedbackv5-comment-wrap" |
493 | 534 | ) ) |