aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/views
diff options
context:
space:
mode:
Diffstat (limited to 'mod/bookmarks/views')
-rw-r--r--mod/bookmarks/views/default/bookmarks/group_module.php44
-rw-r--r--mod/bookmarks/views/default/bookmarks/groupprofile_bookmarks.php34
-rw-r--r--mod/bookmarks/views/default/forms/bookmarks/save.php2
3 files changed, 45 insertions, 35 deletions
diff --git a/mod/bookmarks/views/default/bookmarks/group_module.php b/mod/bookmarks/views/default/bookmarks/group_module.php
new file mode 100644
index 000000000..94204d7e8
--- /dev/null
+++ b/mod/bookmarks/views/default/bookmarks/group_module.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * List most recent bookmarks on group profile page
+ *
+ * @package Bookmarks
+ */
+
+$group = elgg_get_page_owner_entity();
+
+if ($group->bookmarks_enable == "no") {
+ return true;
+}
+
+$all_link = elgg_view('output/url', array(
+ 'href' => "pg/bookmarks/group/$group->guid/owner",
+ 'text' => elgg_echo('link:view:all'),
+));
+
+$header = "<span class=\"group-widget-viewall\">$all_link</span>";
+$header .= '<h3>' . elgg_echo('bookmarks:group') . '</h3>';
+
+elgg_push_context('widgets');
+$options = array(
+ 'type' => 'object',
+ 'subtype' => 'bookmarks',
+ 'container_guid' => elgg_get_page_owner_guid(),
+ 'limit' => 6,
+ 'full_view' => false,
+ 'pagination' => false,
+);
+$content = elgg_list_entities($options);
+elgg_pop_context();
+
+if (!$content) {
+ $content = '<p>' . elgg_echo('bookmarks:none') . '</p>';
+}
+
+$new_link = elgg_view('output/url', array(
+ 'href' => "pg/bookmarks/add/$group->guid",
+ 'text' => elgg_echo('bookmarks:add'),
+));
+$content .= "<span class='elgg-widget-more'>$new_link</span>";
+
+echo elgg_view_module('info', '', $content, array('header' => $header));
diff --git a/mod/bookmarks/views/default/bookmarks/groupprofile_bookmarks.php b/mod/bookmarks/views/default/bookmarks/groupprofile_bookmarks.php
deleted file mode 100644
index ad8095d11..000000000
--- a/mod/bookmarks/views/default/bookmarks/groupprofile_bookmarks.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * List most recent bookmarks on group profile page
- */
-
-if ($vars['entity']->bookmarks_enable != 'no') {
-?>
-
-<div class="group_widget">
-<h2><?php echo elgg_echo('bookmarks:group'); ?></h2>
-<?php
- $context = get_context();
- set_context('search');
- $content = elgg_list_entities(array('types' => 'object',
- 'subtypes' => 'bookmarks',
- 'container_guid' => $vars['entity']->guid,
- 'limit' => 5,
- 'full_view' => FALSE,
- 'pagination' => FALSE));
- set_context($context);
-
- if ($content) {
- echo $content;
-
- $more_url = "{$vars['url']}pg/bookmarks/owner/group:{$vars['entity']->guid}/";
- echo "<div class=\"forum_latest\"><a href=\"$more_url\">" . elgg_echo('bookmarks:more') . "</a></div>";
- } else {
- echo "<div class=\"forum_latest\">" . elgg_echo("bookmarks:nogroup") . "</div>";
- }
-?>
-</div>
-<?php
-} \ No newline at end of file
diff --git a/mod/bookmarks/views/default/forms/bookmarks/save.php b/mod/bookmarks/views/default/forms/bookmarks/save.php
index 9b15b542f..4930aacdb 100644
--- a/mod/bookmarks/views/default/forms/bookmarks/save.php
+++ b/mod/bookmarks/views/default/forms/bookmarks/save.php
@@ -50,7 +50,7 @@ if ($categories) {
echo elgg_view('input/hidden', array('name' => 'container_guid', 'value' => $container_guid));
if ($guid) {
- echo elgg_view('input/hidden', array('name' => 'bookmark_guid', 'value' => $guid));
+ echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $guid));
}
echo elgg_view('input/submit', array('value' => elgg_echo("save")));