reported_content.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /**
  3. * Elgg reported content object view
  4. *
  5. * @package ElggReportContent
  6. */
  7. $report = $vars['entity'];
  8. /* @var ElggObject $report */
  9. $reporter = $report->getOwnerEntity();
  10. //find out if the report is current or archive
  11. if ($report->state == 'archived') {
  12. $reportedcontent_background = "reported-content-archived";
  13. } else {
  14. $reportedcontent_background = "reported-content-active";
  15. }
  16. ?>
  17. <div class="reported-content <?php echo $reportedcontent_background; ?>">
  18. <div class="clearfix">
  19. <div class="clearfix controls">
  20. <?php
  21. if ($report->state != 'archived') {
  22. $attrs = [
  23. 'class' => 'elgg-button elgg-button-action',
  24. 'data-elgg-action' => json_encode([
  25. 'name' => 'reportedcontent/archive',
  26. 'data' => [
  27. 'guid' => $report->guid,
  28. ]
  29. ]),
  30. ];
  31. echo elgg_format_element('button', $attrs, elgg_echo('reportedcontent:archive'));
  32. }
  33. $attrs = [
  34. 'class' => 'elgg-button elgg-button-action',
  35. 'data-elgg-action' => json_encode([
  36. 'name' => 'reportedcontent/delete',
  37. 'data' => [
  38. 'guid' => $report->guid,
  39. ]
  40. ]),
  41. ];
  42. echo elgg_format_element('button', $attrs, elgg_echo('reportedcontent:delete'));
  43. ?>
  44. </div>
  45. <h3 class="mbm">
  46. <?php echo elgg_view('output/url', [
  47. 'text' => $report->title,
  48. 'href' => $report->address,
  49. 'is_trusted' => true,
  50. 'class' => 'elgg-reported-content-address elgg-lightbox',
  51. 'data-colorbox-opts' => json_encode([
  52. 'width' => '85%',
  53. 'height' => '85%',
  54. 'iframe' => true,
  55. ]),
  56. ]);
  57. ?>
  58. </h3>
  59. <p><b><?php echo elgg_echo('reportedcontent:by') ?></b>
  60. <?php echo elgg_view('output/url', [
  61. 'href' => $reporter->getURL(),
  62. 'text' => $reporter->name,
  63. 'is_trusted' => true,
  64. ]);
  65. echo " " . elgg_view_friendly_time($report->time_created);
  66. ?>
  67. </p>
  68. <?php if ($report->description): ?>
  69. <p><?php echo $report->description; ?></p>
  70. <?php endif; ?>
  71. </div>
  72. </div>