diff options
Diffstat (limited to 'mod/reportedcontent')
16 files changed, 153 insertions, 147 deletions
diff --git a/mod/reportedcontent/actions/add.php b/mod/reportedcontent/actions/reportedcontent/add.php index f0a1b05c8..f0a1b05c8 100644 --- a/mod/reportedcontent/actions/add.php +++ b/mod/reportedcontent/actions/reportedcontent/add.php diff --git a/mod/reportedcontent/actions/archive.php b/mod/reportedcontent/actions/reportedcontent/archive.php index dd5c6aef1..dd5c6aef1 100644 --- a/mod/reportedcontent/actions/archive.php +++ b/mod/reportedcontent/actions/reportedcontent/archive.php diff --git a/mod/reportedcontent/actions/delete.php b/mod/reportedcontent/actions/reportedcontent/delete.php index f7d4e2107..f7d4e2107 100644 --- a/mod/reportedcontent/actions/delete.php +++ b/mod/reportedcontent/actions/reportedcontent/delete.php diff --git a/mod/reportedcontent/graphics/icon_reportthis.gif b/mod/reportedcontent/graphics/icon_reportthis.gif Binary files differindex 0590f96e6..0590f96e6 100755..100644 --- a/mod/reportedcontent/graphics/icon_reportthis.gif +++ b/mod/reportedcontent/graphics/icon_reportthis.gif 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 46186ba7e..e96620b01 100644 --- a/mod/reportedcontent/manifest.xml +++ b/mod/reportedcontent/manifest.xml @@ -1,12 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> -<plugin_manifest> - <field key="author" value="Curverider" /> - <field key="version" value="1.7" /> - <field key="description" value="Adds the option for users to report content and for admins to check it out." /> - <field key="website" value="http://www.elgg.org/" /> - <field key="copyright" value="(C) Curverider 2008-2010" /> - <field key="licence" value="GNU Public License version 2" /> - <field key="elgg_version" value="2010030101" /> - <field key="activate_on_install" value="true" /> - <field key="admin_interface" value="advanced" /> +<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8"> + <name>Reported Content</name> + <author>Core developers</author> + <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 General Public License version 2</license> + <requires> + <type>elgg_release</type> + <version>1.8</version> + </requires> + <activate_on_install>true</activate_on_install> </plugin_manifest> diff --git a/mod/reportedcontent/start.php b/mod/reportedcontent/start.php index e231216cd..8b18a4d64 100644 --- a/mod/reportedcontent/start.php +++ b/mod/reportedcontent/start.php @@ -13,21 +13,33 @@ elgg_register_event_handler('init', 'system', 'reportedcontent_init'); function reportedcontent_init() { // Register a page handler, so we can have nice URLs - register_page_handler('reportedcontent', 'reportedcontent_page_handler'); + 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', @@ -36,7 +48,7 @@ function reportedcontent_init() { 'admin'); // Register actions - $action_path = elgg_get_plugins_path() . "reportedcontent/actions"; + $action_path = elgg_get_plugins_path() . "reportedcontent/actions/reportedcontent"; elgg_register_action('reportedcontent/add', "$action_path/add.php"); elgg_register_action('reportedcontent/delete', "$action_path/delete.php", 'admin'); elgg_register_action('reportedcontent/archive', "$action_path/archive.php", 'admin'); @@ -48,13 +60,14 @@ 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 gatekeeper(); $content .= elgg_view_title(elgg_echo('reportedcontent:this')); - $content .= elgg_view('reportedcontent/form'); + $content .= elgg_view_form('reportedcontent/add'); $sidebar = elgg_echo('reportedcontent:instructions'); $params = array( @@ -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 new file mode 100644 index 000000000..f9986849d --- /dev/null +++ b/mod/reportedcontent/views/default/forms/reportedcontent/add.php @@ -0,0 +1,57 @@ +<?php +/** + * Elgg report content plugin form + * + * @package ElggReportContent + */ + +$guid = 0; +$title = get_input('title', ""); +$address = get_input('address', ""); + +$description = ""; +$owner = elgg_get_logged_in_user_entity(); + +?> + +<div> + <label> + <?php + echo elgg_echo('reportedcontent:title'); + echo elgg_view('input/text', array( + 'name' => 'title', + 'value' => $title, + )); + ?> + </label> +</div> +<div> + <label> + <?php + echo elgg_echo('reportedcontent:address'); + echo elgg_view('input/url', array( + 'name' => 'address', + 'value' => $address, + )); + + ?> + </label> +</div> +<div> + <label> + <?php echo elgg_echo('reportedcontent:description'); ?> + </label> + <?php + echo elgg_view('input/longtext',array( + 'name' => 'description', + 'value' => $description, + )); + ?> +</div> +<div class="elgg-foot"> + <?php + echo elgg_view('input/submit', array( + 'value' => elgg_echo('reportedcontent:report'), + )); + ?> +</div> diff --git a/mod/reportedcontent/views/default/object/reported_content.php b/mod/reportedcontent/views/default/object/reported_content.php index 83e49142c..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", - 'internalid' => "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/reportedcontent/form.php b/mod/reportedcontent/views/default/reportedcontent/form.php deleted file mode 100644 index 83076c282..000000000 --- a/mod/reportedcontent/views/default/reportedcontent/form.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * Elgg report content plugin form - * - * @package ElggReportContent - */ - -$guid = 0; -$title = get_input('title', ""); -$description = ""; -$address = get_input('address', ""); -if ($address == "previous") { - $address = $_SERVER['HTTP_REFERER']; -} -$tags = array(); -$access_id = ACCESS_PRIVATE; -$shares = array(); -$owner = elgg_get_logged_in_user_entity(); - -?> -<form action="<?php echo elgg_get_site_url(); ?>action/reportedcontent/add" method="post" class="mtm"> -<?php echo elgg_view('input/securitytoken'); ?> - - <p> - <label> - <?php echo elgg_echo('reportedcontent:title'); ?> - <?php - - echo elgg_view('input/text',array( - 'internalname' => 'title', - 'value' => $title, - )); - - ?> - </label> - </p> - <p> - <label> - <?php echo elgg_echo('reportedcontent:address'); ?> - <?php - - echo elgg_view('input/url',array( - 'internalname' => 'address', - 'value' => $address, - )); - - ?> - </label> - </p> - <p> - <label> - <?php echo elgg_echo('reportedcontent:description'); ?> - </label> - <?php - - echo elgg_view('input/longtext',array( - 'internalname' => 'description', - 'value' => $description, - )); - - ?> - </p> - <p> - <input type="submit" value="<?php echo elgg_echo('reportedcontent:report'); ?>" /> - </p> - -</form> 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>'; diff --git a/mod/reportedcontent/views/default/widgets/reportedcontent/edit.php b/mod/reportedcontent/views/default/widgets/reportedcontent/edit.php index e247a9299..ecd732d23 100644 --- a/mod/reportedcontent/views/default/widgets/reportedcontent/edit.php +++ b/mod/reportedcontent/views/default/widgets/reportedcontent/edit.php @@ -9,15 +9,14 @@ if (!isset($vars['entity']->num_display)) { } $params = array( - 'internalname' => 'params[num_display]', + 'name' => 'params[num_display]', 'value' => $vars['entity']->num_display, 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), ); $dropdown = elgg_view('input/dropdown', $params); ?> -<p> +<div> <?php echo elgg_echo('reportedcontent:numbertodisplay'); ?>: <?php echo $dropdown; ?> -</p> - +</div> |
