aboutsummaryrefslogtreecommitdiff
path: root/mod/reportedcontent/views
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-29 00:56:55 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-29 00:56:55 +0000
commit855b008013aad0426ab0332b040bddb033bb6af9 (patch)
tree70c137e5c9a9c916bb9f8172daf3bd0483895bf6 /mod/reportedcontent/views
parent71dc8cbf9eecb4de149bc96bb5758b866116b1c8 (diff)
downloadelgg-855b008013aad0426ab0332b040bddb033bb6af9.tar.gz
elgg-855b008013aad0426ab0332b040bddb033bb6af9.tar.bz2
cleaned up the reported content plugin
git-svn-id: http://code.elgg.org/elgg/trunk@7466 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/reportedcontent/views')
-rw-r--r--mod/reportedcontent/views/default/admin/overview/reportedcontent.php9
-rw-r--r--mod/reportedcontent/views/default/object/reported_content.php79
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/admin_css.php38
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/css.php37
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/footer_link.php4
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/listing.php42
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/user_report.php2
7 files changed, 129 insertions, 82 deletions
diff --git a/mod/reportedcontent/views/default/admin/overview/reportedcontent.php b/mod/reportedcontent/views/default/admin/overview/reportedcontent.php
index a12a9a696..0cf8643a3 100644
--- a/mod/reportedcontent/views/default/admin/overview/reportedcontent.php
+++ b/mod/reportedcontent/views/default/admin/overview/reportedcontent.php
@@ -1,16 +1,17 @@
<?php
/**
- * Elgg Reported content
+ * Elgg Reported content admin page
*
* @package ElggReportedContent
*/
$title = elgg_view_title(elgg_echo('reportedcontent'));
-$reported = elgg_get_entities(array('types' => 'object', 'subtypes' => 'reported_content', 'limit' => 9999));
-$list = elgg_view("reportedcontent/listing", array('entity' => $reported));
+$list = elgg_list_entities(array('types' => 'object', 'subtypes' => 'reported_content'));
+if (!$list) {
+ $list = '<p class="margin_top">' . elgg_echo('reportedcontent:none') . '</p>';
+}
-// Display main admin menu
$body = <<<__HTML
$title
$list
diff --git a/mod/reportedcontent/views/default/object/reported_content.php b/mod/reportedcontent/views/default/object/reported_content.php
new file mode 100644
index 000000000..fa809bae6
--- /dev/null
+++ b/mod/reportedcontent/views/default/object/reported_content.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Elgg reported content object view
+ *
+ * @package ElggReportContent
+ */
+
+$report = $vars['entity'];
+$reporter = $report->getOwnerEntity();
+
+$archive_url = elgg_get_site_url() . "action/reportedcontent/archive?guid=$report->guid";
+$delete_url = elgg_get_site_url() . "action/reportedcontent/delete?guid=$report->guid";
+
+//find out if the report is current or archive
+if ($report->state == 'archived') {
+ $reportedcontent_background = "archived_report";
+} else {
+ $reportedcontent_background = "active_report";
+}
+
+?>
+
+<div class="admin_settings reported_content <?php echo $reportedcontent_background; ?>">
+ <div class="clearfix controls">
+<?php
+ if ($report->state != 'archived') {
+ $params = array(
+ 'href' => $archive_url,
+ 'text' => elgg_echo('reportedcontent:archive'),
+ 'is_action' => true,
+ 'class' => 'action_button',
+ );
+ echo elgg_view('output/url', $params);
+ }
+ $params = array(
+ 'href' => $delete_url,
+ 'text' => elgg_echo('reportedcontent:delete'),
+ 'is_action' => true,
+ 'class' => 'action_button disabled',
+ );
+ echo elgg_view('output/url', $params);
+?>
+ </div>
+ <p>
+ <b><?php echo elgg_echo('reportedcontent:by'); ?>:</b>
+ <?php echo elgg_view('output/url', array(
+ 'href' => $reporter->getURL(),
+ 'text' => $reporter->name
+ ));
+ ?>,
+ <?php echo elgg_view_friendly_time($report->time_created); ?>
+ </p>
+ <p>
+ <b><?php echo elgg_echo('reportedcontent:objecttitle'); ?>:</b>
+ <?php echo $report->title; ?>
+ <br />
+ <?php echo elgg_view('output/url', array(
+ 'href' => '#',
+ 'text' => elgg_echo('reportedcontent:moreinfo'),
+ 'class' => 'details_link',
+ 'onclick' => "elgg_slide_toggle(this, '.reported_content', '.reported_content_more{$report->getGUID()}'); return false;"
+ ));
+ ?>
+ </p>
+ <div class="details hidden reported_content_more<?php echo $report->getGUID();?>">
+ <p>
+ <b><?php echo elgg_echo('reportedcontent:objecturl'); ?>:</b>
+ <?php echo elgg_view('output/url', array(
+ 'href' => $report->address,
+ 'text' => elgg_echo('reportedcontent:visit')
+ ));
+ ?>
+ </p>
+ <p>
+ <b><?php echo elgg_echo('reportedcontent:reason'); ?>:</b>
+ <?php echo $report->description; ?>
+ </p>
+ </div>
+</div>
diff --git a/mod/reportedcontent/views/default/reportedcontent/admin_css.php b/mod/reportedcontent/views/default/reportedcontent/admin_css.php
new file mode 100644
index 000000000..82566ff3a
--- /dev/null
+++ b/mod/reportedcontent/views/default/reportedcontent/admin_css.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Elgg reported content admin CSS
+ *
+ * @package ElggReportContent
+ */
+?>
+
+/* REPORTED CONTENT */
+.admin_settings.reported_content {
+ margin:5px 0 0 0;
+ padding:5px 7px 3px 9px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+}
+.admin_settings.reported_content p {
+ margin:0;
+}
+.active_report {
+ border:1px solid #D3322A;
+ background:#F7DAD8;
+}
+.archived_report {
+ border:1px solid #666666;
+ background:#dedede;
+}
+.admin_settings.reported_content .controls {
+ float:right;
+ margin:14px 5px 0 0;
+}
+.admin_settings.reported_content a.action_button {
+ display:inline;
+ float:right;
+ margin-left:15px;
+}
+.admin_settings.reported_content .details_link {
+ cursor: pointer;
+}
diff --git a/mod/reportedcontent/views/default/reportedcontent/css.php b/mod/reportedcontent/views/default/reportedcontent/css.php
index 3dcdbc36b..c66cd2004 100644
--- a/mod/reportedcontent/views/default/reportedcontent/css.php
+++ b/mod/reportedcontent/views/default/reportedcontent/css.php
@@ -1,12 +1,14 @@
<?php
/**
* Elgg reported content CSS
+ *
+ * Footer link CSS
*
- * @package reportedcontent
+ * @package ElggReportContent
*/
?>
-/* link in footer */
+/* Reported Content */
#report_this {
text-align: left;
float:left;
@@ -16,34 +18,3 @@
padding:0 0 4px 20px;
background: url(<?php echo elgg_get_site_url(); ?>mod/reportedcontent/graphics/icon_reportthis.gif) no-repeat left top;
}
-/* admin area */
-.admin_settings.reported_content {
- margin:5px 0 0 0;
- padding:5px 7px 3px 9px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
-}
-.admin_settings.reported_content p {
- margin:0;
-}
-.active_report {
- border:1px solid #D3322A;
- background:#F7DAD8;
-}
-.archived_report {
- border:1px solid #666666;
- background:#dedede;
-}
-.admin_settings.reported_content .controls {
- float:right;
- margin:14px 5px 0 0;
-}
-.admin_settings.reported_content a.action_button {
- display:inline;
- float:right;
- margin-left:15px;
-}
-.admin_settings.reported_content .details_link {
- cursor: pointer;
-}
-
diff --git a/mod/reportedcontent/views/default/reportedcontent/footer_link.php b/mod/reportedcontent/views/default/reportedcontent/footer_link.php
index 0e953e0b9..69e6f0967 100644
--- a/mod/reportedcontent/views/default/reportedcontent/footer_link.php
+++ b/mod/reportedcontent/views/default/reportedcontent/footer_link.php
@@ -5,10 +5,10 @@
* @package ElggReportContent
*/
-$title = elgg_echo('reportedcontent:this:title');
+$title = elgg_echo('reportedcontent:this:tooltip');
$text = elgg_echo('reportedcontent:this');
?>
<div id="report_this">
- <a href="javascript:location.href='<?php echo elgg_get_site_url(); ?>mod/reportedcontent/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)" title="<?php echo $title; ?>"><?php echo $text; ?></a>
+ <a href="javascript:location.href='<?php echo elgg_get_site_url(); ?>pg/reportedcontent/add/?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)" title="<?php echo $title; ?>"><?php echo $text; ?></a>
</div>
diff --git a/mod/reportedcontent/views/default/reportedcontent/listing.php b/mod/reportedcontent/views/default/reportedcontent/listing.php
deleted file mode 100644
index 4236894c2..000000000
--- a/mod/reportedcontent/views/default/reportedcontent/listing.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * Elgg report content listing
- *
- * @package ElggReportContent
- */
-
-if($vars['entity']){
- $id = 0;
- foreach($vars['entity'] as $report){
-
- // increment our id counter
- $id++;
-
- //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 == 'archived'){
- $reportedcontent_background = "archived_report";
- }else{
- $reportedcontent_background = "active_report";
- }
-
- echo "<div class='admin_settings reported_content {$reportedcontent_background}'>";
- echo "<div class='clearfix controls'>";
- if($report->state != 'archived')
- echo "<a class='action_button' href=\"" . elgg_add_action_tokens_to_url(elgg_get_site_url() . "action/reportedcontent/archive?item={$report->guid}") . "\">" . elgg_echo('reportedcontent:archive') . "</a>";
- echo "<a class='action_button disabled' href=\"" . elgg_add_action_tokens_to_url(elgg_get_site_url() . "action/reportedcontent/delete?item={$report->guid}") . "\" onclick=\"return confirm('" . elgg_echo('reportedcontent:areyousure') . "')\">" . elgg_echo('reportedcontent:delete') . "</a></div>";
- echo "<p><b>" . elgg_echo('reportedcontent:by') . ": </b><a href=\"{$user_url}\">" . $user . "</a>, " . elgg_view_friendly_time($report->time_created) . "</p>";
- echo "<p><b>" . elgg_echo('reportedcontent:objecttitle') . ": </b>" . $report->title;
- echo "<br /><a onclick=\"elgg_slide_toggle(this,'.reported_content','.container{$id}');\" class='details_link'>" . elgg_echo('reportedcontent:moreinfo') . "</a></p>";
- echo "<div class='details container{$id} hidden'>";
- echo "<p><b>" . elgg_echo('reportedcontent:objecturl') . ": </b><a href=\"{$report->address}\">" . elgg_echo('reportedcontent:visit') . "</a></p>";
- echo "<p><b>" . elgg_echo('reportedcontent:reason') . ": </b>" .$report->description . "</p>";
- echo "</div></div>";
- }
-
-} else {
- echo "<p class='margin_top'>".elgg_echo('reportedcontent:none')."</p>";
-} \ No newline at end of file
diff --git a/mod/reportedcontent/views/default/reportedcontent/user_report.php b/mod/reportedcontent/views/default/reportedcontent/user_report.php
index 78fcf92fd..517e87c86 100644
--- a/mod/reportedcontent/views/default/reportedcontent/user_report.php
+++ b/mod/reportedcontent/views/default/reportedcontent/user_report.php
@@ -1,5 +1,5 @@
<li class="user_menu_profile">
<?php
- echo "<a class='report_this' href=\"javascript:location.href='". elgg_get_site_url() . "mod/reportedcontent/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">" . elgg_echo('reportedcontent:report') . "</a>";
+ echo "<a class='report_this' href=\"javascript:location.href='". elgg_get_site_url() . "pg/reportedcontent/add/?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">" . elgg_echo('reportedcontent:report') . "</a>";
?>
</li> \ No newline at end of file