aboutsummaryrefslogtreecommitdiff
path: root/mod/reportedcontent/views/default/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'mod/reportedcontent/views/default/widgets')
-rw-r--r--mod/reportedcontent/views/default/widgets/reportedcontent/content.php15
-rw-r--r--mod/reportedcontent/views/default/widgets/reportedcontent/edit.php23
2 files changed, 38 insertions, 0 deletions
diff --git a/mod/reportedcontent/views/default/widgets/reportedcontent/content.php b/mod/reportedcontent/views/default/widgets/reportedcontent/content.php
new file mode 100644
index 000000000..4f8906ef2
--- /dev/null
+++ b/mod/reportedcontent/views/default/widgets/reportedcontent/content.php
@@ -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
index 000000000..e47cf9740
--- /dev/null
+++ b/mod/reportedcontent/views/default/widgets/reportedcontent/edit.php
@@ -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>
+