aboutsummaryrefslogtreecommitdiff
path: root/mod/reportedcontent
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-15 12:32:29 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-15 12:32:29 +0000
commitbe55e9428629a17b28e1c03b60640db2b556d49d (patch)
treec291650887c93236d7275eb04c3eef2c5cfcffa2 /mod/reportedcontent
parenta25b09af5f68978f2616f71d1ab821c5abafdc8a (diff)
downloadelgg-be55e9428629a17b28e1c03b60640db2b556d49d.tar.gz
elgg-be55e9428629a17b28e1c03b60640db2b556d49d.tar.bz2
reported content updated
git-svn-id: https://code.elgg.org/elgg/trunk@1934 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/reportedcontent')
-rw-r--r--mod/reportedcontent/actions/add.php1
-rw-r--r--mod/reportedcontent/actions/archive.php34
-rw-r--r--mod/reportedcontent/actions/delete.php37
-rw-r--r--mod/reportedcontent/languages/en.php5
-rw-r--r--mod/reportedcontent/start.php2
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/css.php10
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/listing.php17
7 files changed, 98 insertions, 8 deletions
diff --git a/mod/reportedcontent/actions/add.php b/mod/reportedcontent/actions/add.php
index bfb5fcfb3..c37cae466 100644
--- a/mod/reportedcontent/actions/add.php
+++ b/mod/reportedcontent/actions/add.php
@@ -27,6 +27,7 @@
if ($entity->save()) {
system_message(elgg_echo('reportedcontent:success'));
+ $entity->state = "active";
forward($address);
} else {
register_error(elgg_echo('reportedcontent:failed'));
diff --git a/mod/reportedcontent/actions/archive.php b/mod/reportedcontent/actions/archive.php
new file mode 100644
index 000000000..312d05eea
--- /dev/null
+++ b/mod/reportedcontent/actions/archive.php
@@ -0,0 +1,34 @@
+<?php
+
+ /**
+ * Elgg reported content: archive action
+ *
+ * @package ElggReportedContent
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+ // Make sure we're logged in and are admin
+ admin_gatekeeper();
+
+ // Get input data
+ $guid = (int) get_input('item');
+
+ // Make sure we actually have permission to edit
+ $reported = get_entity($guid);
+ if ($reported->getSubtype() == "reported_content" && $reported->canEdit()) {
+
+ // change the state
+ $reported->state = "archived";
+
+ // Success message
+ system_message(elgg_echo("reportedcontent:archived"));
+
+ // Forward back to the reported content page
+ forward("pg/reportedcontent/");
+
+ }
+
+?> \ No newline at end of file
diff --git a/mod/reportedcontent/actions/delete.php b/mod/reportedcontent/actions/delete.php
new file mode 100644
index 000000000..f304a47f2
--- /dev/null
+++ b/mod/reportedcontent/actions/delete.php
@@ -0,0 +1,37 @@
+<?php
+
+ /**
+ * Elgg reported content: delete action
+ *
+ * @package ElggReportedCOntent
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+ // Make sure we're logged in and are admin
+ admin_gatekeeper();
+
+ // Get input data
+ $guid = (int) get_input('item');
+
+ // Make sure we actually have permission to edit
+ $reported = get_entity($guid);
+ if ($reported->getSubtype() == "reported_content" && $reported->canEdit()) {
+
+ // Delete it!
+ $rowsaffected = $reported->delete();
+ if ($rowsaffected > 0) {
+ // Success message
+ system_message(elgg_echo("reportedcontent:deleted"));
+ } else {
+ register_error(elgg_echo("reportedcontent:notdeleted"));
+ }
+
+ // Forward back to the reported content page
+ forward("pg/reportedcontent/");
+
+ }
+
+?> \ No newline at end of file
diff --git a/mod/reportedcontent/languages/en.php b/mod/reportedcontent/languages/en.php
index c2b336edc..d5d9e8029 100644
--- a/mod/reportedcontent/languages/en.php
+++ b/mod/reportedcontent/languages/en.php
@@ -15,14 +15,17 @@
* Menu items and titles
*/
- 'item:object:reported_content' => 'Reported items',
'reportedcontent' => 'Reported content',
'reportedcontent:this' => 'Report this',
'reportedcontent:none' => 'There is no reported content',
'reportedcontent:report' => 'Report to admin',
'reportedcontent:title' => 'Page title',
+ 'reportedcontent:deleted' => 'The reported content has been deleted',
+ 'reportedcontent:notdeleted' => 'We were not able to delete that report',
'reportedcontent:delete' => 'Delete it',
+ 'reportedcontent:areyousure' => 'Are you sure you want to delete?',
'reportedcontent:archive' => 'Archive it',
+ 'reportedcontent:archived' => 'The report has been archived',
'reportedcontent:visit' => 'Visit reported item',
'reportedcontent:by' => 'Report by',
'reportedcontent:objecttitle' => 'Object title',
diff --git a/mod/reportedcontent/start.php b/mod/reportedcontent/start.php
index e8c9614cd..aaee94ce0 100644
--- a/mod/reportedcontent/start.php
+++ b/mod/reportedcontent/start.php
@@ -62,5 +62,7 @@
//register action
register_action('reportedcontent/add',false,$CONFIG->pluginspath . "reportedcontent/actions/add.php");
+ register_action('reportedcontent/delete',false,$CONFIG->pluginspath . "reportedcontent/actions/delete.php");
+ register_action('reportedcontent/archive',false,$CONFIG->pluginspath . "reportedcontent/actions/archive.php");
?> \ No newline at end of file
diff --git a/mod/reportedcontent/views/default/reportedcontent/css.php b/mod/reportedcontent/views/default/reportedcontent/css.php
new file mode 100644
index 000000000..c3cdbe098
--- /dev/null
+++ b/mod/reportedcontent/views/default/reportedcontent/css.php
@@ -0,0 +1,10 @@
+.reported_content {
+ background:#efefef;
+ border:1px solid #ccc;
+ padding:5px;
+}
+
+span.reported_detail {
+ width:200px;
+ border-left:1px solid #ccc;
+} \ No newline at end of file
diff --git a/mod/reportedcontent/views/default/reportedcontent/listing.php b/mod/reportedcontent/views/default/reportedcontent/listing.php
index 8a0342ed2..b56a12615 100644
--- a/mod/reportedcontent/views/default/reportedcontent/listing.php
+++ b/mod/reportedcontent/views/default/reportedcontent/listing.php
@@ -7,18 +7,21 @@
//get the user making the report
$user = get_user($report->owner_guid)->name;
$user_url = get_user($report->owner_guid)->getURL();
+
//find out if the report is current or archive
- if($report->state == 'archive')
- $reportedcontent_background = "archive";
- else
- $reportedcontent_background = "active";
+ if($report->state == 'archived'){
+ $reportedcontent_background = "archive";
+ }else{
+ $reportedcontent_background = "active";
+ }
+
echo "<div class=\"reportedcontent_content {$reportedcontent_background}\">";
echo "<p class=\"reportedcontent_detail\"><b>" . elgg_echo('reportedcontent:by') . ": </b><a href=\"{$user_url}\">" . $user . "</a>, " . friendly_time($report->time_created) . "</p>";
echo "<p class=\"reportedcontent_detail\"><b>" . elgg_echo('reportedcontent:objecttitle') . ": </b>" . $report->title . "</p>";
- echo "<p class=\"reportedcontent_detail\">[<a href=\"\">" . elgg_echo('reportedcontent:archive') . "</a>] - [<a href=\"\">" . elgg_echo('reportedcontent:delete') . "</a>]</p>";
- echo "<p><a class=\"manifest_details\">" . elgg_echo("more info") . "</a></p>";
- echo "<div class=\"manifest_file\">";
+ echo "<p class=\"reportedcontent_detail\">[<a href=\"" . $vars['url'] . "action/reportedcontent/archive?item=" . $report->guid . "\">" . elgg_echo('reportedcontent:archive') . "</a>] - [<a href=\"" . $vars['url'] . "action/reportedcontent/delete?item=" . $report->guid . "\" onclick=\"return confirm('" . elgg_echo('reportedcontent:areyousure') . "')\">" . elgg_echo('reportedcontent:delete') . "</a>]</p>";
+ echo "<p><a class=\"manifest_details\">" . elgg_echo("more info") . "</a></p>";
+ echo "<div class=\"manifest_file\">";
echo "<p class=\"reportedcontent_detail\"><b>" . elgg_echo('reportedcontent:objecturl') . ": </b><a href=\"{$report->address}\">" . elgg_echo('reportedcontent:visit') . "</a></p>";
echo "<p class=\"reportedcontent_detail\"><b>" . elgg_echo('reportedcontent:reason') . ": </b>" .$report->description . "</p>";
echo "</div></div>";