/plugins/Flagging/views/flagging.php

https://github.com/cdavid/wattsapp2 · PHP · 98 lines · 94 code · 2 blank · 2 comment · 9 complexity · 83d38079d3f3a3ee19690ce7f7eba76e MD5 · raw file

  1. <?php if (!defined('APPLICATION')) exit(); ?>
  2. <h1><?php echo T($this->Data['Title']); ?></h1>
  3. <div class="Info">
  4. <?php echo T('The following content has been flagged by users for moderator review.'); ?>
  5. </div>
  6. <div class="FilterMenu">
  7. <?php
  8. $ToggleName = C('Plugins.Flagging.Enabled') ? T('Disable Content Flagging') : T('Enable Content Flagging');
  9. echo "<div>".Wrap(Anchor($ToggleName, 'plugin/flagging/toggle/'.Gdn::Session()->TransientKey(), 'SmallButton'))."</div>";
  10. ?>
  11. </div>
  12. <?php
  13. if (C('Plugins.Flagging.Enabled')) {
  14. // Settings
  15. echo $this->Form->Open();
  16. echo $this->Form->Errors();
  17. ?>
  18. <h3><?php echo T('Flagging Settings'); ?></h3>
  19. <ul>
  20. <li><?php echo $this->Form->CheckBox('Plugins.Flagging.UseDiscussions', T('Create Discussions')); ?></li>
  21. <li>
  22. <?php
  23. echo $this->Form->Label('Category to Use', 'Plugins.Flagging.CategoryID');
  24. echo $this->Form->DropDown('Plugins.Flagging.CategoryID', $this->CategoryData, array('TextField' => 'Name', 'ValueField' => 'CategoryID'));
  25. ?>
  26. </li>
  27. </ul>
  28. <?php
  29. echo $this->Form->Close('Save');
  30. // Flagged Items list
  31. echo "<h3>".T('Flagged Items')."</h3>\n";
  32. echo '<div class="FlaggedContent">';
  33. $NumFlaggedItems = count($this->FlaggedItems);
  34. if (!$NumFlaggedItems) {
  35. echo T("There are no items awaiting moderation at this time.");
  36. } else {
  37. echo $NumFlaggedItems." ".Plural($NumFlaggedItems,"item","items")." in queue\n";
  38. foreach ($this->FlaggedItems as $URL => $FlaggedList) {
  39. ?>
  40. <div class="FlaggedItem">
  41. <?php
  42. $TitleCell = TRUE;
  43. ksort($FlaggedList,SORT_STRING);
  44. $NumComplaintsInThread = sizeof($FlaggedList);
  45. foreach ($FlaggedList as $FlagIndex => $Flag) {
  46. if ($TitleCell) {
  47. $TitleCell = FALSE;
  48. ?>
  49. <div class="FlaggedTitleCell">
  50. <div class="FlaggedItemURL"><?php echo Anchor(Url($Flag['ForeignURL'],TRUE),$Flag['ForeignURL']); ?></div>
  51. <div class="FlaggedItemInfo">
  52. <?php
  53. if ($NumComplaintsInThread > 1)
  54. $OtherString = T(' and').' '.($NumComplaintsInThread-1).' '.T(Plural($NumComplaintsInThread-1, 'other', 'others')).' '.T('person');
  55. else
  56. $OtherString = '';
  57. ?>
  58. <span><?php echo T("Reported by: "); ?></span>
  59. <span><?php echo "<strong>".Anchor($Flag['InsertName'],"profile/{$Flag['InsertUserID']}/{$Flag['InsertName']}")."</strong>{$OtherString} ".T('on').' '.$Flag['DateInserted']; ?></span>
  60. </div>
  61. <div class="FlaggedItemComment">"<?php echo $Flag['Comment']; ?>"</div>
  62. <div class="FlaggedActions">
  63. <?php
  64. echo $this->Form->Button('Dismiss',array(
  65. 'onclick' => "window.location.href='".Url('plugin/flagging/dismiss/'.$Flag['EncodedURL'],TRUE)."'",
  66. 'class' => 'SmallButton'
  67. ));
  68. echo $this->Form->Button('Take Action',array(
  69. 'onclick' => "window.location.href='".Url($Flag['ForeignURL'],TRUE)."'",
  70. 'class' => 'SmallButton'
  71. ));
  72. ?>
  73. </div>
  74. </div>
  75. <?php
  76. if ($NumComplaintsInThread > 1)
  77. echo '<div class="OtherComplaints">'."\n";
  78. } else {
  79. ?>
  80. <div class="FlaggedOtherCell">
  81. <div class="FlaggedItemInfo"><?php echo T('On').' '.$Flag['DateInserted'].', <strong>'.Anchor($Flag['InsertName'],"profile/{$Flag['InsertUserID']}/{$Flag['InsertName']}").'</strong> '.T('said:'); ?></div>
  82. <div class="FlaggedItemComment">"<?php echo $Flag['Comment']; ?>"</div>
  83. </div>
  84. <?php
  85. }
  86. }
  87. if ($NumComplaintsInThread > 1)
  88. echo "</div>\n";
  89. ?>
  90. </div>
  91. <?php
  92. }
  93. }
  94. ?>
  95. </div>
  96. <?php } ?>