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