aboutsummaryrefslogtreecommitdiff
path: root/mod/reportedcontent
diff options
context:
space:
mode:
Diffstat (limited to 'mod/reportedcontent')
-rw-r--r--[-rwxr-xr-x]mod/reportedcontent/graphics/icon_reportthis.gifbin570 -> 570 bytes
-rw-r--r--mod/reportedcontent/languages/en.php6
-rw-r--r--mod/reportedcontent/manifest.xml10
-rw-r--r--mod/reportedcontent/start.php22
-rw-r--r--mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php (renamed from mod/reportedcontent/views/default/admin/utilities/reportedcontent.php)2
-rw-r--r--mod/reportedcontent/views/default/forms/reportedcontent/add.php2
-rw-r--r--mod/reportedcontent/views/default/object/reported_content.php59
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/admin_css.php20
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/css.php5
-rw-r--r--mod/reportedcontent/views/default/reportedcontent/footer_link.php20
-rw-r--r--mod/reportedcontent/views/default/widgets/reportedcontent/content.php5
11 files changed, 82 insertions, 69 deletions
diff --git a/mod/reportedcontent/graphics/icon_reportthis.gif b/mod/reportedcontent/graphics/icon_reportthis.gif
index 0590f96e6..0590f96e6 100755..100644
--- a/mod/reportedcontent/graphics/icon_reportthis.gif
+++ b/mod/reportedcontent/graphics/icon_reportthis.gif
Binary files differ
diff --git a/mod/reportedcontent/languages/en.php b/mod/reportedcontent/languages/en.php
index 407717082..c2e197879 100644
--- a/mod/reportedcontent/languages/en.php
+++ b/mod/reportedcontent/languages/en.php
@@ -8,7 +8,7 @@
$english = array(
'item:object:reported_content' => 'Reported items',
- 'admin:utilities:reportedcontent' => 'Reported content',
+ 'admin:administer_utilities:reportedcontent' => 'Reported content',
'reportedcontent' => 'Reported content',
'reportedcontent:this' => 'Report this',
'reportedcontent:this:tooltip' => 'Report this page to an administrator',
@@ -23,8 +23,8 @@ $english = array(
'reportedcontent:archived' => 'The report has been archived',
'reportedcontent:visit' => 'Visit reported item',
'reportedcontent:by' => 'Report by',
- 'reportedcontent:objecttitle' => 'Object title',
- 'reportedcontent:objecturl' => 'Object url',
+ 'reportedcontent:objecttitle' => 'Page title',
+ 'reportedcontent:objecturl' => 'Page url',
'reportedcontent:reason' => 'Reason for report',
'reportedcontent:description' => 'Why are you reporting this?',
'reportedcontent:address' => 'Location of the item',
diff --git a/mod/reportedcontent/manifest.xml b/mod/reportedcontent/manifest.xml
index a219fce7f..e96620b01 100644
--- a/mod/reportedcontent/manifest.xml
+++ b/mod/reportedcontent/manifest.xml
@@ -2,15 +2,15 @@
<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8">
<name>Reported Content</name>
<author>Core developers</author>
- <version>1.7</version>
+ <version>1.8</version>
+ <category>bundled</category>
<description>Adds the option for users to report content and for admins to check it out.</description>
<website>http://www.elgg.org/</website>
<copyright>See COPYRIGHT.txt</copyright>
- <license>GNU Public License version 2</license>
+ <license>GNU General Public License version 2</license>
<requires>
- <type>elgg_version</type>
- <version>2010030101</version>
+ <type>elgg_release</type>
+ <version>1.8</version>
</requires>
<activate_on_install>true</activate_on_install>
- <admin_interface>advanced</admin_interface>
</plugin_manifest>
diff --git a/mod/reportedcontent/start.php b/mod/reportedcontent/start.php
index eba1b13a1..8b18a4d64 100644
--- a/mod/reportedcontent/start.php
+++ b/mod/reportedcontent/start.php
@@ -16,18 +16,30 @@ function reportedcontent_init() {
elgg_register_page_handler('reportedcontent', 'reportedcontent_page_handler');
// Extend CSS
- elgg_extend_view('css/screen', 'reportedcontent/css');
+ elgg_extend_view('css/elgg', 'reportedcontent/css');
elgg_extend_view('css/admin', 'reportedcontent/admin_css');
// Extend footer with report content link
if (elgg_is_logged_in()) {
- elgg_extend_view('footer/links', 'reportedcontent/footer_link');
+ $href = "javascript:elgg.forward('reportedcontent/add'";
+ $href .= "+'?address='+encodeURIComponent(location.href)";
+ $href .= "+'&title='+encodeURIComponent(document.title));";
+
+ elgg_register_menu_item('footer', array(
+ 'name' => 'report_this',
+ 'href' => $href,
+ 'title' => elgg_echo('reportedcontent:this:tooltip'),
+ 'text' => elgg_view_icon('report-this') . elgg_echo('reportedcontent:this'),
+ 'priority' => 500,
+ 'section' => 'alt',
+ ));
}
elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'reportedcontent_user_hover_menu');
// Add admin menu item
- elgg_add_admin_menu_item('reportedcontent', elgg_echo('reportedcontent'), 'utilities');
+ // @todo Might want to move this to a 'feedback' section. something other than utils
+ elgg_register_admin_menu_item('administer', 'reportedcontent', 'administer_utilities');
elgg_register_widget_type(
'reportedcontent',
@@ -48,6 +60,7 @@ function reportedcontent_init() {
* Serves the add report page
*
* @param array $page Array of page routing elements
+ * @return bool
*/
function reportedcontent_page_handler($page) {
// only logged in users can report things
@@ -64,6 +77,7 @@ function reportedcontent_page_handler($page) {
$body = elgg_view_layout('one_sidebar', $params);
echo elgg_view_page(elgg_echo('reportedcontent:this'), $body);
+ return true;
}
/**
@@ -74,7 +88,7 @@ function reportedcontent_user_hover_menu($hook, $type, $return, $params) {
$profile_url = urlencode($user->getURL());
$name = urlencode($user->name);
- $url = "pg/reportedcontent/add/?address=$profile_url&title=$name";
+ $url = "reportedcontent/add?address=$profile_url&title=$name";
if (elgg_is_logged_in() && elgg_get_logged_in_user_guid() != $user->guid) {
$item = new ElggMenuItem(
diff --git a/mod/reportedcontent/views/default/admin/utilities/reportedcontent.php b/mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php
index 32f108312..ed52a536d 100644
--- a/mod/reportedcontent/views/default/admin/utilities/reportedcontent.php
+++ b/mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php
@@ -5,7 +5,7 @@
* @package ElggReportedContent
*/
-$list = elgg_list_entities(array('types' => 'object', 'subtypes' => 'reported_content'));
+$list = elgg_list_entities(array('type' => 'object', 'subtype' => 'reported_content'));
if (!$list) {
$list = '<p class="mtm">' . elgg_echo('reportedcontent:none') . '</p>';
}
diff --git a/mod/reportedcontent/views/default/forms/reportedcontent/add.php b/mod/reportedcontent/views/default/forms/reportedcontent/add.php
index 0b1716a35..f9986849d 100644
--- a/mod/reportedcontent/views/default/forms/reportedcontent/add.php
+++ b/mod/reportedcontent/views/default/forms/reportedcontent/add.php
@@ -48,7 +48,7 @@ $owner = elgg_get_logged_in_user_entity();
));
?>
</div>
-<div>
+<div class="elgg-foot">
<?php
echo elgg_view('input/submit', array(
'value' => elgg_echo('reportedcontent:report'),
diff --git a/mod/reportedcontent/views/default/object/reported_content.php b/mod/reportedcontent/views/default/object/reported_content.php
index e755fae5b..cc33f54fb 100644
--- a/mod/reportedcontent/views/default/object/reported_content.php
+++ b/mod/reportedcontent/views/default/object/reported_content.php
@@ -21,14 +21,16 @@ if ($report->state == 'archived') {
?>
<div class="reported-content <?php echo $reportedcontent_background; ?>">
- <div class="clearfix controls">
+ <div class="clearfix">
+ <div class="clearfix controls">
<?php
if ($report->state != 'archived') {
$params = array(
'href' => $archive_url,
'text' => elgg_echo('reportedcontent:archive'),
'is_action' => true,
- 'class' => 'elgg-button-action',
+ 'is_trusted' => true,
+ 'class' => 'elgg-button elgg-button-action',
);
echo elgg_view('output/url', $params);
}
@@ -36,42 +38,45 @@ if ($report->state == 'archived') {
'href' => $delete_url,
'text' => elgg_echo('reportedcontent:delete'),
'is_action' => true,
- 'class' => 'elgg-button-action',
+ 'is_trusted' => true,
+ 'class' => 'elgg-button elgg-button-action',
);
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' => "elgg-toggle",
- 'id' => "elgg-toggler-report-$report->guid",
- ));
- ?>
- </p>
- <div class="hidden" id="elgg-togglee-report-<?php echo $report->getGUID();?>">
+ </div>
+ <p>
+ <b><?php echo elgg_echo('reportedcontent:by'); ?>:</b>
+ <?php echo elgg_view('output/url', array(
+ 'href' => $reporter->getURL(),
+ 'text' => $reporter->name,
+ 'is_trusted' => true,
+ ));
+ ?>,
+ <?php echo elgg_view_friendly_time($report->time_created); ?>
+ </p>
+ <p>
+ <b><?php echo elgg_echo('reportedcontent:objecttitle'); ?>:</b>
+ <?php echo $report->title; ?>
<p>
<b><?php echo elgg_echo('reportedcontent:objecturl'); ?>:</b>
<?php echo elgg_view('output/url', array(
'href' => $report->address,
- 'text' => elgg_echo('reportedcontent:visit')
+ 'text' => elgg_echo('reportedcontent:visit'),
+ 'is_trusted' => true,
));
?>
</p>
<p>
+ <?php echo elgg_view('output/url', array(
+ 'href' => "#report-$report->guid",
+ 'text' => elgg_echo('reportedcontent:moreinfo'),
+ 'rel' => "toggle",
+ ));
+ ?>
+ </p>
+ </div>
+ <div class="report-details hidden" id="report-<?php echo $report->getGUID();?>">
+ <p>
<b><?php echo elgg_echo('reportedcontent:reason'); ?>:</b>
<?php echo $report->description; ?>
</p>
diff --git a/mod/reportedcontent/views/default/reportedcontent/admin_css.php b/mod/reportedcontent/views/default/reportedcontent/admin_css.php
index 02c235a99..1ed240f3b 100644
--- a/mod/reportedcontent/views/default/reportedcontent/admin_css.php
+++ b/mod/reportedcontent/views/default/reportedcontent/admin_css.php
@@ -8,10 +8,12 @@
/* REPORTED CONTENT */
.reported-content {
- margin: 5px 0 0 0;
+ margin: 5px 0 0;
padding: 5px 7px 3px 9px;
+
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
+ border-radius: 5px;
}
.reported-content p {
margin: 0;
@@ -26,5 +28,19 @@
}
.reported-content .controls {
float: right;
- margin: 14px 5px 0 0;
+ margin: 5px 0 0 10px;
+}
+.report-details {
+ background-color: white;
+ padding: 5px;
+ margin-bottom: 5px;
+ max-width: 500px;
+
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+.elgg-widget-content .reported-content .elgg-button {
+ display: block;
+ margin: 5px;
}
diff --git a/mod/reportedcontent/views/default/reportedcontent/css.php b/mod/reportedcontent/views/default/reportedcontent/css.php
index ed498f03a..da88ecf70 100644
--- a/mod/reportedcontent/views/default/reportedcontent/css.php
+++ b/mod/reportedcontent/views/default/reportedcontent/css.php
@@ -9,9 +9,6 @@
?>
/* Reported Content */
-.report-this {
- font-size: 90%;
-}
-.report-this-icon {
+.elgg-icon-report-this {
background: url(<?php echo elgg_get_site_url(); ?>mod/reportedcontent/graphics/icon_reportthis.gif) no-repeat left top;
}
diff --git a/mod/reportedcontent/views/default/reportedcontent/footer_link.php b/mod/reportedcontent/views/default/reportedcontent/footer_link.php
deleted file mode 100644
index 58a19b343..000000000
--- a/mod/reportedcontent/views/default/reportedcontent/footer_link.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/**
- * Elgg report this link
- *
- * @package ElggReportContent
- */
-
-$title = elgg_echo('reportedcontent:this:tooltip');
-$text = elgg_echo('reportedcontent:this');
-
-$url = elgg_get_site_url() . 'pg/reportedcontent/add/?address=';
-$href = "javascript:location.href='$url'";
-$href .= "+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
-$href = elgg_format_url($href);
-?>
-
-<a class="report-this" href="<?php echo $href; ?>" title="<?php echo $title; ?>">
- <span class="elgg-icon report-this-icon"></span>
- <?php echo $text; ?>
-</a>
diff --git a/mod/reportedcontent/views/default/widgets/reportedcontent/content.php b/mod/reportedcontent/views/default/widgets/reportedcontent/content.php
index 4f8906ef2..0095decca 100644
--- a/mod/reportedcontent/views/default/widgets/reportedcontent/content.php
+++ b/mod/reportedcontent/views/default/widgets/reportedcontent/content.php
@@ -4,9 +4,10 @@
*/
$list = elgg_list_entities(array(
- 'types' => 'object',
- 'subtypes' => 'reported_content',
+ 'type' => 'object',
+ 'subtype' => 'reported_content',
'limit' => $vars['entity']->num_display,
+ 'pagination' => false,
));
if (!$list) {
$list = '<p class="mtm">' . elgg_echo('reportedcontent:none') . '</p>';