aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/views/default/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'mod/blog/views/default/widgets')
-rw-r--r--mod/blog/views/default/widgets/blog/content.php30
-rw-r--r--mod/blog/views/default/widgets/blog/edit.php22
2 files changed, 52 insertions, 0 deletions
diff --git a/mod/blog/views/default/widgets/blog/content.php b/mod/blog/views/default/widgets/blog/content.php
new file mode 100644
index 000000000..330171662
--- /dev/null
+++ b/mod/blog/views/default/widgets/blog/content.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * User blog widget display view
+ */
+
+$num = $vars['entity']->num_display;
+
+$options = array(
+ 'type' => 'object',
+ 'subtype' => 'blog',
+ 'container_guid' => $vars['entity']->owner_guid,
+ 'limit' => $num,
+ 'full_view' => FALSE,
+ 'pagination' => FALSE,
+);
+$content = elgg_list_entities($options);
+
+echo $content;
+
+if ($content) {
+ $blog_url = "blog/owner/" . elgg_get_page_owner_entity()->username;
+ $more_link = elgg_view('output/url', array(
+ 'href' => $blog_url,
+ 'text' => elgg_echo('blog:moreblogs'),
+ 'is_trusted' => true,
+ ));
+ echo "<span class=\"elgg-widget-more\">$more_link</span>";
+} else {
+ echo elgg_echo('blog:noblogs');
+}
diff --git a/mod/blog/views/default/widgets/blog/edit.php b/mod/blog/views/default/widgets/blog/edit.php
new file mode 100644
index 000000000..30c3b2e73
--- /dev/null
+++ b/mod/blog/views/default/widgets/blog/edit.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * User blog widget edit view
+ */
+
+// set default value
+if (!isset($vars['entity']->num_display)) {
+ $vars['entity']->num_display = 4;
+}
+
+$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('blog:numbertodisplay'); ?>:
+ <?php echo $dropdown; ?>
+</div>