From 855b008013aad0426ab0332b040bddb033bb6af9 Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 29 Nov 2010 00:56:55 +0000 Subject: cleaned up the reported content plugin git-svn-id: http://code.elgg.org/elgg/trunk@7466 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../default/admin/overview/reportedcontent.php | 9 +-- .../views/default/object/reported_content.php | 79 ++++++++++++++++++++++ .../views/default/reportedcontent/admin_css.php | 38 +++++++++++ .../views/default/reportedcontent/css.php | 37 ++-------- .../views/default/reportedcontent/footer_link.php | 4 +- .../views/default/reportedcontent/listing.php | 42 ------------ .../views/default/reportedcontent/user_report.php | 2 +- 7 files changed, 129 insertions(+), 82 deletions(-) create mode 100644 mod/reportedcontent/views/default/object/reported_content.php create mode 100644 mod/reportedcontent/views/default/reportedcontent/admin_css.php delete mode 100644 mod/reportedcontent/views/default/reportedcontent/listing.php (limited to 'mod/reportedcontent/views') 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 @@ '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 = '

' . elgg_echo('reportedcontent:none') . '

'; +} -// 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 @@ +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"; +} + +?> + +
+
+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); +?> +
+

+ : + $reporter->getURL(), + 'text' => $reporter->name + )); + ?>, + time_created); ?> +

+

+ : + title; ?> +
+ '#', + 'text' => elgg_echo('reportedcontent:moreinfo'), + 'class' => 'details_link', + 'onclick' => "elgg_slide_toggle(this, '.reported_content', '.reported_content_more{$report->getGUID()}'); return false;" + )); + ?> +

+ +
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 @@ + + +/* 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 @@ -/* link in footer */ +/* Reported Content */ #report_this { text-align: left; float:left; @@ -16,34 +18,3 @@ padding:0 0 4px 20px; background: 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'); ?>
- +
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 @@ -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 "
"; - echo ""; - echo "

" . elgg_echo('reportedcontent:by') . ": " . $user . ", " . elgg_view_friendly_time($report->time_created) . "

"; - echo "

" . elgg_echo('reportedcontent:objecttitle') . ": " . $report->title; - echo "
" . elgg_echo('reportedcontent:moreinfo') . "

"; - echo "
"; - } - -} else { - echo "

".elgg_echo('reportedcontent:none')."

"; -} \ 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 @@
  • " . elgg_echo('reportedcontent:report') . ""; + echo ""; ?>
  • \ No newline at end of file -- cgit v1.2.3