]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
added reported content widget
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 26 Jan 2011 02:08:49 +0000 (02:08 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 26 Jan 2011 02:08:49 +0000 (02:08 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7932 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/reportedcontent/start.php
mod/reportedcontent/views/default/reportedcontent/form.php
mod/reportedcontent/views/default/reportedcontent/user_report.php [deleted file]
mod/reportedcontent/views/default/widgets/reportedcontent/content.php [new file with mode: 0644]
mod/reportedcontent/views/default/widgets/reportedcontent/edit.php [new file with mode: 0644]

index 9708c3b14395825ae6a9b9fd1c171cdeec2d2306..4cb5bea12f51b75be09d1718f136914ac2d24ecc 100644 (file)
@@ -5,7 +5,7 @@
  * @package ElggReportedContent
  */
 
-elgg_register_event_handler('init','system','reportedcontent_init');
+elgg_register_event_handler('init', 'system', 'reportedcontent_init');
 
 /**
  * Initialize the plugin
@@ -55,11 +55,11 @@ function reportedcontent_page_handler($page) {
 
        $content .= elgg_view_title(elgg_echo('reportedcontent:this'));
        $content .= elgg_view('reportedcontent/form');
-       $sidebar .= elgg_echo('reportedcontent:instructions');
+       $sidebar = elgg_echo('reportedcontent:instructions');
 
        $params = array(
                'content' => $content,
-               'sidebar' => $sidebar
+               'sidebar' => $sidebar,
        );
        $body = elgg_view_layout('one_sidebar', $params);
 
index e70afacf8cc80b6f7b138fe738cf2e4332ea1af7..c7e37ed36a8e7b9e4bc0493f9e02f0d0c84a5a3d 100644 (file)
@@ -6,9 +6,9 @@
  */
 
 $guid = 0;
-$title = get_input('title',"");
+$title = get_input('title', "");
 $description = "";
-$address = get_input('address',"");
+$address = get_input('address', "");
 if ($address == "previous") {
        $address = $_SERVER['HTTP_REFERER'];
 }
@@ -18,7 +18,7 @@ $shares = array();
 $owner = get_loggedin_user();
 
 ?>
-<form action="<?php echo elgg_get_site_url(); ?>action/reportedcontent/add" method="post" class="margin-top">
+<form action="<?php echo elgg_get_site_url(); ?>action/reportedcontent/add" method="post" class="mtm">
 <?php echo elgg_view('input/securitytoken'); ?>
 
        <p>
@@ -47,7 +47,7 @@ $owner = get_loggedin_user();
                        ?>
                </label>
        </p>
-       <p class="longtext_inputarea">
+       <p>
                <label>
                        <?php   echo elgg_echo('reportedcontent:description'); ?>
                </label>
diff --git a/mod/reportedcontent/views/default/reportedcontent/user_report.php b/mod/reportedcontent/views/default/reportedcontent/user_report.php
deleted file mode 100644 (file)
index 517e87c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<li class="user_menu_profile">
-<?php
-       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
diff --git a/mod/reportedcontent/views/default/widgets/reportedcontent/content.php b/mod/reportedcontent/views/default/widgets/reportedcontent/content.php
new file mode 100644 (file)
index 0000000..4f8906e
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+/**
+ * List the latest reports
+ */
+
+$list = elgg_list_entities(array(
+       'types' => 'object',
+       'subtypes' => 'reported_content',
+       'limit' => $vars['entity']->num_display,
+));
+if (!$list) {
+       $list = '<p class="mtm">' . elgg_echo('reportedcontent:none') . '</p>';
+}
+
+echo $list;
\ No newline at end of file
diff --git a/mod/reportedcontent/views/default/widgets/reportedcontent/edit.php b/mod/reportedcontent/views/default/widgets/reportedcontent/edit.php
new file mode 100644 (file)
index 0000000..e47cf97
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Widget edit view
+ */
+
+// set default value
+if (!isset($vars['entity']->num_display)) {
+       $vars['entity']->num_display = 4;
+}
+
+$params = array(
+       'internalname' => 'params[num_display]',
+       'value' => $vars['entity']->num_display,
+       'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
+);
+$dropdown = elgg_view('input/pulldown', $params);
+
+?>
+<p>
+       <?php echo elgg_echo('reportedcontent:numbertodisplay'); ?>:
+       <?php echo $dropdown; ?>
+</p>
+