aboutsummaryrefslogtreecommitdiff
path: root/mod/messageboard/views/default/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'mod/messageboard/views/default/widgets')
-rw-r--r--mod/messageboard/views/default/widgets/messageboard/content.php35
-rw-r--r--mod/messageboard/views/default/widgets/messageboard/edit.php22
2 files changed, 57 insertions, 0 deletions
diff --git a/mod/messageboard/views/default/widgets/messageboard/content.php b/mod/messageboard/views/default/widgets/messageboard/content.php
new file mode 100644
index 000000000..35954e7a3
--- /dev/null
+++ b/mod/messageboard/views/default/widgets/messageboard/content.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Elgg messageboard widget view
+ *
+ */
+
+$owner = elgg_get_page_owner_entity();
+
+$num_display = $vars['entity']->num_display;
+
+if (elgg_is_logged_in()) {
+ echo elgg_view_form('messageboard/add', array('name' => 'elgg-messageboard'));
+}
+
+$options = array(
+ 'annotations_name' => 'messageboard',
+ 'guid' => $owner->getGUID(),
+ 'limit' => $num_display,
+ 'pagination' => false,
+ 'reverse_order_by' => true,
+);
+
+echo elgg_list_annotations($options);
+
+if ($owner instanceof ElggGroup) {
+ $url = "messageboard/group/$owner->guid/all";
+} else {
+ $url = "messageboard/owner/$owner->username";
+}
+
+echo elgg_view('output/url', array(
+ 'href' => $url,
+ 'text' => elgg_echo('messageboard:viewall'),
+ 'is_trusted' => true,
+)); \ No newline at end of file
diff --git a/mod/messageboard/views/default/widgets/messageboard/edit.php b/mod/messageboard/views/default/widgets/messageboard/edit.php
new file mode 100644
index 000000000..74848f832
--- /dev/null
+++ b/mod/messageboard/views/default/widgets/messageboard/edit.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Messageboard widget edit view
+ */
+
+// set default value
+if (!isset($vars['entity']->num_display)) {
+ $vars['entity']->num_display = 5;
+}
+
+$params = array(
+ '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);
+
+?>
+<div>
+ <?php echo elgg_echo('messageboard:num_display'); ?>:
+ <?php echo $dropdown; ?>
+</div>