diff options
Diffstat (limited to 'mod/bookmarks/views/default/widgets')
-rw-r--r-- | mod/bookmarks/views/default/widgets/bookmarks/content.php | 32 | ||||
-rw-r--r-- | mod/bookmarks/views/default/widgets/bookmarks/edit.php | 24 |
2 files changed, 56 insertions, 0 deletions
diff --git a/mod/bookmarks/views/default/widgets/bookmarks/content.php b/mod/bookmarks/views/default/widgets/bookmarks/content.php new file mode 100644 index 000000000..0b85017fc --- /dev/null +++ b/mod/bookmarks/views/default/widgets/bookmarks/content.php @@ -0,0 +1,32 @@ +<?php +/** + * Elgg bookmarks widget + * + * @package Bookmarks + */ + +$max = (int) $vars['entity']->num_display; + +$options = array( + 'type' => 'object', + 'subtype' => 'bookmarks', + 'container_guid' => $vars['entity']->owner_guid, + 'limit' => $max, + 'full_view' => FALSE, + 'pagination' => FALSE, +); +$content = elgg_list_entities($options); + +echo $content; + +if ($content) { + $url = "bookmarks/owner/" . elgg_get_page_owner_entity()->username; + $more_link = elgg_view('output/url', array( + 'href' => $url, + 'text' => elgg_echo('bookmarks:more'), + 'is_trusted' => true, + )); + echo "<span class=\"elgg-widget-more\">$more_link</span>"; +} else { + echo elgg_echo('bookmarks:none'); +} diff --git a/mod/bookmarks/views/default/widgets/bookmarks/edit.php b/mod/bookmarks/views/default/widgets/bookmarks/edit.php new file mode 100644 index 000000000..ed9c7fd88 --- /dev/null +++ b/mod/bookmarks/views/default/widgets/bookmarks/edit.php @@ -0,0 +1,24 @@ +<?php +/** + * Elgg bookmark widget edit view + * + * @package Bookmarks + */ + +// 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('bookmarks:numbertodisplay'); ?>: + <?php echo $dropdown; ?> +</div> |