aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks
diff options
context:
space:
mode:
Diffstat (limited to 'mod/bookmarks')
-rw-r--r--mod/bookmarks/bookmarklet.php36
-rw-r--r--mod/bookmarks/languages/en.php5
-rw-r--r--mod/bookmarks/lib/bookmarks.php4
-rw-r--r--mod/bookmarks/pages/add.php3
-rw-r--r--mod/bookmarks/pages/all.php6
-rw-r--r--mod/bookmarks/pages/bookmarklet.php36
-rw-r--r--mod/bookmarks/pages/friends.php5
-rw-r--r--mod/bookmarks/pages/owner.php10
-rw-r--r--mod/bookmarks/start.php156
-rw-r--r--mod/bookmarks/views/default/bookmarks/bookmarklet.php35
-rw-r--r--mod/bookmarks/views/default/bookmarks/form.php133
-rw-r--r--mod/bookmarks/views/default/bookmarks/owner_block.php10
-rw-r--r--mod/bookmarks/views/default/bookmarks/sharing.php80
-rw-r--r--mod/bookmarks/views/default/river/object/bookmarks/annotate.php10
-rw-r--r--mod/bookmarks/views/default/river/object/bookmarks/create.php40
-rw-r--r--mod/bookmarks/views/default/widgets/bookmarks/edit.php2
16 files changed, 172 insertions, 399 deletions
diff --git a/mod/bookmarks/bookmarklet.php b/mod/bookmarks/bookmarklet.php
deleted file mode 100644
index 9f9dd5150..000000000
--- a/mod/bookmarks/bookmarklet.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-/**
-* Elgg bookmarks plugin bookmarklet page
-*
-* @package ElggBookmarks
-*/
-
-// Start engine
-require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
-gatekeeper();
-
-// Get the current page's owner
-$page_owner = elgg_get_page_owner_entity();
-if ($page_owner === false || is_null($page_owner) && (elgg_get_logged_in_user_entity())) {
- $page_owner = elgg_get_logged_in_user_entity();
- set_page_owner($page_owner->getGUID());
-}
-
-// get the content area header
-$area1 = elgg_view('page/elements/content_header', array('context' => "mine", 'type' => 'bookmarks'));
-
-// List bookmarks
-$area2 = elgg_view_title(elgg_echo('bookmarks:bookmarklet'));
-$area2 .= elgg_view('bookmarks/bookmarklet', array('pg_owner' => $page_owner));
-
-// if logged in, get the bookmarklet
-$area3 = elgg_view("bookmarks/bookmarklet");
-
-// Format
-$content = $area1 . $area2 . $area3;
-$body = elgg_view_layout('one_sidebar', array('content' => $content));
-
-// Draw it
-echo elgg_view_page(elgg_echo('bookmarks:bookmarklet'),$body); \ No newline at end of file
diff --git a/mod/bookmarks/languages/en.php b/mod/bookmarks/languages/en.php
index 5efcad087..3026629da 100644
--- a/mod/bookmarks/languages/en.php
+++ b/mod/bookmarks/languages/en.php
@@ -13,7 +13,7 @@ $english = array(
'bookmarks:owner' => "%s's bookmarks",
'bookmarks:friends' => "Friends' bookmarks",
'bookmarks:everyone' => "All site bookmarks",
- 'bookmarks:this' => "Bookmark this",
+ 'bookmarks:this' => "Bookmark this page",
'bookmarks:this:group' => "Bookmark in %s",
'bookmarks:bookmarklet' => "Get bookmarklet",
'bookmarks:bookmarklet:group' => "Get group bookmarklet",
@@ -35,9 +35,10 @@ $english = array(
'bookmarks:visit' => "Visit resource",
'bookmarks:recent' => "Recent bookmarks",
- 'bookmarks:river:created' => '%s bookmarked',
+ 'bookmarks:river:created' => 'bookmarked %s',
'bookmarks:river:annotate' => 'a comment on this bookmarked item',
'bookmarks:river:item' => 'an item',
+ 'river:commented:object:bookmarks' => 'a bookmark',
'item:object:bookmarks' => 'Bookmarked items',
diff --git a/mod/bookmarks/lib/bookmarks.php b/mod/bookmarks/lib/bookmarks.php
index 0ac333152..3ffda737d 100644
--- a/mod/bookmarks/lib/bookmarks.php
+++ b/mod/bookmarks/lib/bookmarks.php
@@ -14,8 +14,8 @@
function bookmarks_prepare_form_vars($bookmark = null) {
// input names => defaults
$values = array(
- 'title' => '',
- 'address' => '',
+ 'title' => get_input('title', ''),
+ 'address' => get_input('address', ''),
'description' => '',
'access_id' => ACCESS_DEFAULT,
'tags' => '',
diff --git a/mod/bookmarks/pages/add.php b/mod/bookmarks/pages/add.php
index 5a61c2e96..77b9a0bd0 100644
--- a/mod/bookmarks/pages/add.php
+++ b/mod/bookmarks/pages/add.php
@@ -2,10 +2,11 @@
/**
* Add bookmark page
*
- * @package ElggBookmarks
+ * @package Bookmarks
*/
gatekeeper();
+
$bookmark_guid = get_input('guid');
$bookmark = get_entity($bookmark_guid);
$container_guid = (int) get_input('container_guid');
diff --git a/mod/bookmarks/pages/all.php b/mod/bookmarks/pages/all.php
index 3442f32c7..5a01b6f34 100644
--- a/mod/bookmarks/pages/all.php
+++ b/mod/bookmarks/pages/all.php
@@ -5,9 +5,6 @@
* @package ElggBookmarks
*/
-elgg_push_context('bookmarks');
-elgg_push_breadcrumb(elgg_echo('bookmarks'));
-
$page_owner = elgg_get_page_owner_entity();
if (!$page_owner) {
$page_owner = elgg_get_logged_in_user_guid();
@@ -32,5 +29,4 @@ $body = elgg_view_layout('content', array(
'title' => $title
));
-echo elgg_view_page($title, $body);
-elgg_pop_context(); \ No newline at end of file
+echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/bookmarks/pages/bookmarklet.php b/mod/bookmarks/pages/bookmarklet.php
new file mode 100644
index 000000000..99866e385
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarklet.php
@@ -0,0 +1,36 @@
+<?php
+/**
+* Elgg bookmarks plugin bookmarklet page
+*
+* @package Bookmarks
+*/
+
+gatekeeper();
+
+$container_guid = get_input('container_guid');
+$container = get_entity($container_guid);
+$page_owner = $container;
+
+if (elgg_instanceof($container, 'object')) {
+ $page_owner = $container->getContainerEntity();
+}
+
+elgg_set_page_owner_guid($page_owner->getGUID());
+
+$title = elgg_echo('bookmarks:bookmarklet');
+
+if ($page_owner instanceof ElggGroup) {
+ elgg_push_breadcrumb($page_owner->name, $page_owner->getURL());
+}
+
+elgg_push_breadcrumb($title);
+
+$content = elgg_view("bookmarks/bookmarklet");
+
+$body = elgg_view_layout('content', array(
+ 'content' => $content,
+ 'title' => $title,
+ 'filter' => false
+));
+
+echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/bookmarks/pages/friends.php b/mod/bookmarks/pages/friends.php
index 5c930434b..3c55317eb 100644
--- a/mod/bookmarks/pages/friends.php
+++ b/mod/bookmarks/pages/friends.php
@@ -9,8 +9,6 @@ $guid = get_input('guid');
elgg_set_page_owner_guid($guid);
$owner = elgg_get_page_owner_entity();
-elgg_push_context('bookmarks');
-elgg_push_breadcrumb(elgg_echo('bookmarks'), 'pg/bookmarks/all');
elgg_push_breadcrumb($owner->name, "pg/bookmarks/owner/$owner->username");
elgg_push_breadcrumb(elgg_echo('friends'));
@@ -29,5 +27,4 @@ $params = array(
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
-elgg_pop_context(); \ No newline at end of file
+echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/bookmarks/pages/owner.php b/mod/bookmarks/pages/owner.php
index 5b864ff48..2216b593f 100644
--- a/mod/bookmarks/pages/owner.php
+++ b/mod/bookmarks/pages/owner.php
@@ -2,19 +2,16 @@
/**
* Elgg bookmarks plugin everyone page
*
- * @package ElggBookmarks
+ * @package Bookmarks
*/
-elgg_push_context('bookmarks');
-elgg_push_breadcrumb(elgg_echo('bookmarks'), 'pg/bookmarks/all');
-
$page_owner = elgg_get_page_owner_entity();
if (!$page_owner) {
$page_owner = elgg_get_logged_in_user_guid();
elgg_set_page_owner_guid($page_owner);
}
-elgg_push_breadcrumb($page_owner->name, "pg/bookmarks/owner/$page_owner->username");
+elgg_push_breadcrumb($page_owner->name);
$offset = (int)get_input('offset', 0);
$content .= elgg_list_entities(array(
@@ -35,5 +32,4 @@ $body = elgg_view_layout('content', array(
'title' => $title
));
-echo elgg_view_page($title, $body);
-elgg_pop_context(); \ No newline at end of file
+echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php
index a4cba4805..90dd89f18 100644
--- a/mod/bookmarks/start.php
+++ b/mod/bookmarks/start.php
@@ -6,7 +6,6 @@
*/
elgg_register_event_handler('init', 'system', 'bookmarks_init');
-elgg_register_event_handler('pagesetup', 'system', 'bookmarks_pagesetup');
/**
* Bookmark init
@@ -15,22 +14,26 @@ function bookmarks_init() {
global $CONFIG;
$root = dirname(__FILE__);
-
elgg_register_library('elgg:bookmarks', "$root/lib/bookmarks.php");
- $action_path = "$root/actions/bookmarks";
+ // actions
+ $action_path = "$root/actions/bookmarks";
elgg_register_action('bookmarks/save', "$action_path/save.php", 'logged_in');
elgg_register_action('bookmarks/delete', "$action_path/delete.php", 'logged_in');
elgg_register_action('bookmarks/share', "$action_path/share.php", 'logged_in');
- //add a tools menu option
- $item = new ElggMenuItem('bookmarks', elgg_echo('bookmarks'), 'pg/bookmarks/all');
- elgg_register_menu_item('site', $item);
+ // menus
+ elgg_register_menu_item('site', array(
+ 'name' => 'bookmarks',
+ 'title' => elgg_echo('bookmarks'),
+ 'url' => 'pg/bookmarks/all'
+ ));
+ elgg_register_plugin_hook_handler('register', 'menu:page', 'bookmarks_page_menu');
+ elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'bookmarks_owner_block_menu');
+ elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'bookmarks_user_hover_menu');
- // Register a page handler, so we can have nice URLs
- elgg_register_page_handler('bookmarks', 'bookmarks_page_handler');
- // Add our CSS
+ elgg_register_page_handler('bookmarks', 'bookmarks_page_handler');
elgg_extend_view('css/screen', 'bookmarks/css');
// Register granular notification for this type
@@ -41,79 +44,15 @@ function bookmarks_init() {
// Listen to notification events and supply a more useful message
elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'bookmarks_notify_message');
- // Register a URL handler for shared items
+ // Register a URL handler for bookmarks
elgg_register_entity_url_handler('object','bookmarks', 'bookmark_url');
- // Shares widget
- elgg_register_widget_type('bookmarks',elgg_echo("bookmarks"),elgg_echo("bookmarks:widget:description"));
-
- // Register entity type
- elgg_register_entity_type('object','bookmarks');
-
- // Add group menu option
- add_group_tool_option('bookmarks',elgg_echo('bookmarks:enablebookmarks'),true);
-
- elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'bookmarks_owner_block_menu');
-
- // Extend Groups profile page
- elgg_extend_view('groups/tool_latest','bookmarks/group_bookmarks');
-
- // Register profile menu hook
- elgg_register_plugin_hook_handler('profile_menu', 'profile', 'bookmarks_profile_menu');
-}
-
-/**
- * Sidebar menu for bookmarks
- *
- */
-function bookmarks_pagesetup() {
- global $CONFIG;
-
- $page_owner = page_owner_entity();
-
- //add submenu options
- if (get_context() == "bookmarks") {
-
- if (elgg_is_logged_in()) {
- // link to add bookmark form
- if ($page_owner instanceof ElggGroup) {
- if ($page_owner->isMember(elgg_get_logged_in_user_entity())) {
- add_submenu_item(elgg_echo('bookmarks:add'), $CONFIG->wwwroot."pg/bookmarks/add/" . $page_owner->username);
- }
- } else {
- add_submenu_item(elgg_echo('bookmarks:add'), $CONFIG->wwwroot."pg/bookmarks/add/" . $_SESSION['user']->username);
- add_submenu_item(elgg_echo('bookmarks:inbox'),$CONFIG->wwwroot."pg/bookmarks/inbox/" . $_SESSION['user']->username);
- }
- if (page_owner()) {
- add_submenu_item(sprintf(elgg_echo('bookmarks:read'), $page_owner->name),$CONFIG->wwwroot."pg/bookmarks/owner/" . $page_owner->username);
- }
- if (!$page_owner instanceof ElggGroup) {
- add_submenu_item(elgg_echo('bookmarks:friends'),$CONFIG->wwwroot."pg/bookmarks/friends/" . $_SESSION['user']->username);
- }
- }
-
- if (!$page_owner instanceof ElggGroup) {
- add_submenu_item(elgg_echo('bookmarks:everyone'),$CONFIG->wwwroot."pg/bookmarks/all/");
- }
-
- // Bookmarklet
- if ((elgg_is_logged_in()) && (page_owner()) && (can_write_to_container(0, page_owner()))) {
-
- $bmtext = elgg_echo('bookmarks:bookmarklet');
- if ($page_owner instanceof ElggGroup) {
- $bmtext = elgg_echo('bookmarks:bookmarklet:group');
- }
- add_submenu_item($bmtext, $CONFIG->wwwroot . "pg/bookmarks/bookmarklet/{$page_owner->username}/");
- }
-
- }
-
- if ($page_owner instanceof ElggGroup && get_context() == 'groups') {
- if ($page_owner->bookmarks_enable != "no") {
- add_submenu_item(sprintf(elgg_echo("bookmarks:group"),$page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/owner/" . $page_owner->username);
- }
- }
+ // Register entity type for search
+ elgg_register_entity_type('object', 'bookmarks');
+ // Groups
+ add_group_tool_option('bookmarks', elgg_echo('bookmarks:enablebookmarks'), true);
+ elgg_extend_view('groups/tool_latest', 'bookmarks/group_bookmarks');
}
/**
@@ -137,6 +76,7 @@ function bookmarks_page_handler($page) {
elgg_load_library('elgg:bookmarks');
elgg_push_breadcrumb(elgg_echo('bookmarks'), 'pg/bookmarks/all');
+ elgg_push_context('bookmarks');
// old group usernames
if (substr_count($page[0], 'group:')) {
@@ -187,7 +127,7 @@ function bookmarks_page_handler($page) {
break;
case "bookmarklet":
- set_input('username', $page[1]);
+ set_input('container_guid', $page[1]);
include "$pages/bookmarklet.php";
break;
@@ -195,6 +135,8 @@ function bookmarks_page_handler($page) {
return false;
}
+ elgg_pop_context();
+
return true;
}
@@ -254,12 +196,12 @@ function bookmark_url($entity) {
*/
function bookmarks_owner_block_menu($hook, $type, $return, $params) {
if (elgg_instanceof($params['entity'], 'user')) {
- $url = "pg/bookmarks/owner/{$params['user']->username}";
+ $url = "pg/bookmarks/owner/{$params['entity']->username}";
$item = new ElggMenuItem('bookmarks', elgg_echo('bookmarks'), $url);
$return[] = $item;
} else {
- if ($params['entity']->bookmarks_enable != "no") {
- $url = "pg/bookmarks/owner/{$params['entity']->username}";
+ if ($params['entity']->bookmarks_enable != 'no') {
+ $url = "pg/bookmarks/group/{$params['entity']->guid}/owner";
$item = new ElggMenuItem('bookmarks', elgg_echo('bookmarks:group'), $url);
$return[] = $item;
}
@@ -300,4 +242,52 @@ function bookmarks_notify_message($hook, $entity_type, $returnvalue, $params) {
}
return null;
+}
+
+/**
+ * Add a user hover menu.
+ *
+ * @param unknown_type $hook
+ * @param unknown_type $type
+ * @param unknown_type $return
+ * @param unknown_type $params
+ */
+function bookmarks_user_hover_menu($hook, $type, $return, $params) {
+ $user = $params['entity'];
+
+ $title = elgg_echo('bookmarks');
+ $url = "pg/bookmarks/owner/$user->username";
+ $return[] = new ElggMenuItem('bookmarks', $title, $url);
+
+ return $return;
+}
+
+/**
+ * Add a page menu menu.
+ *
+ * @param unknown_type $hook
+ * @param unknown_type $type
+ * @param unknown_type $return
+ * @param unknown_type $params
+ */
+function bookmarks_page_menu($hook, $type, $return, $params) {
+ if (elgg_is_logged_in()) {
+ $url = 'pg/bookmarks/add/' . elgg_get_logged_in_user_guid()
+ . '?address=' . urlencode(current_page_url());
+ $return[] = new ElggMenuItem('bookmark_this_page', elgg_echo('bookmarks:this'), $url);
+
+ // only show bookmarklet in bookmark pages
+ if (elgg_in_context('bookmarks')) {
+ $page_owner = elgg_get_page_owner_entity();
+ if ($page_owner instanceof ElggGroup) {
+ $title = elgg_echo('bookmarks:bookmarklet:group');
+ } else {
+ $title = elgg_echo('bookmarks:bookmarklet');
+ }
+
+ $return[] = new ElggMenuItem('bookmarklet', $title, 'pg/bookmarks/bookmarklet/' . $page_owner->getGUID());
+ }
+ }
+
+ return $return;
} \ No newline at end of file
diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php
index 531619409..119b9d107 100644
--- a/mod/bookmarks/views/default/bookmarks/bookmarklet.php
+++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php
@@ -1,33 +1,32 @@
<?php
/**
- * Elgg get bookmarks bookmarklet view
- *
- * @package ElggBookmarks
+ * Bookmarklet
+ *
+ * @package Bookmarks
*/
$page_owner = elgg_get_page_owner_entity();
-$bookmarktext = elgg_echo("bookmarks:this");
if ($page_owner instanceof ElggGroup) {
- $bookmarktext = elgg_echo("bookmarks:this:group", array($page_owner->name));
- $name = "group:$page_owner->guid";
+ $title = elgg_echo("bookmarks:this:group", array($page_owner->name));
} else {
- $name = $page_owner->username;
+ $title = elgg_echo("bookmarks:this");
}
+$guid = $page_owner->getGUID();
+
if (!$name && ($user = elgg_get_logged_in_user_entity())) {
$name = $user->username;
}
+$url = elgg_get_site_url();
+
+$bookmarklet = "<a href=\"javascript:location.href='{$url}pg/bookmarks/add/$guid?address='"
+ . "+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">"
+ . "<img src=\"{$url}_graphics/elgg_bookmarklet.gif\" border=\"0\" title=\"$title\" /> </a>";
+
?>
-<h3><?php echo elgg_echo('bookmarks:browser_bookmarklet')?></h3>
-<a href="javascript:location.href='<?php echo elgg_get_site_url(); ?>pg/bookmarks/<?php echo $name; ?>/add?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)"> <img src="<?php echo elgg_get_site_url(); ?>_graphics/elgg_bookmarklet.gif" border="0" title="<?php echo elgg_echo('bookmarks:this');?>" /> </a>
-<br />
-<div class="elgg-discover">
- <a class="link">Instructions</a>
- <div class="elgg-discoverable">
- <p><?php echo elgg_echo("bookmarks:bookmarklet:description"); ?></p>
- <p><?php echo elgg_echo("bookmarks:bookmarklet:descriptionie"); ?></p>
- <p><?php echo elgg_echo("bookmarks:bookmarklet:description:conclusion"); ?></p>
- </div>
-</div> \ No newline at end of file
+<p><?php echo elgg_echo("bookmarks:bookmarklet:description"); ?></p>
+<p><?php echo $bookmarklet; ?></p>
+<p><?php echo elgg_echo("bookmarks:bookmarklet:descriptionie"); ?></p>
+<p><?php echo elgg_echo("bookmarks:bookmarklet:description:conclusion"); ?></p> \ No newline at end of file
diff --git a/mod/bookmarks/views/default/bookmarks/form.php b/mod/bookmarks/views/default/bookmarks/form.php
deleted file mode 100644
index ef8a18dc3..000000000
--- a/mod/bookmarks/views/default/bookmarks/form.php
+++ /dev/null
@@ -1,133 +0,0 @@
-<?php
-
-/**
-* Elgg bookmarks plugin form
-*
-* @package ElggBookmarks
-*/
-
-if(isset($vars['entity'])){
- $guid = $vars['entity']->guid;
- $title = $vars['entity']->title;
- $description = $vars['entity']->description;
- $address = $vars['entity']->address;
- $tags = $vars['entity']->tags;
- $access_id = $vars['entity']->access_id;
- $shares = $vars['entity']->shares;
- $owner = $vars['entity']->getOwnerEntity();
- $highlight = 'default';
-
-} else {
- $guid = 0;
- $title = get_input('title',"");
- $title = stripslashes($title); // strip slashes from URL encoded apostrophes
- $description = "";
- $address = get_input('address',"");
- $highlight = 'all';
-
- if ($address == "previous")
- $address = $_SERVER['HTTP_REFERER'];
- $tags = array();
-
- if (defined('ACCESS_DEFAULT')) {
- $access_id = ACCESS_DEFAULT;
- } else {
- $access_id = 0;
- }
- $shares = array();
- $owner = page_owner_entity();
-}
-
-?>
-<div class="contentWrapper">
-<form action="<?php echo $vars['url']; ?>action/bookmarks/add" method="post">
-<?php echo elgg_view('input/securitytoken'); ?>
-<p>
- <label>
- <?php echo elgg_echo('title'); ?>
- <?php
-
- echo elgg_view('input/text',array(
- 'name' => 'title',
- 'value' => $title,
- ));
-
- ?>
- </label>
-</p>
-<p>
- <label>
- <?php echo elgg_echo('bookmarks:address'); ?>
- <?php
-
- echo elgg_view('input/url',array(
- 'name' => 'address',
- 'value' => $address,
- ));
-
- ?>
- </label>
-</p>
-<p class="longtext_editarea">
- <label>
- <?php echo elgg_echo('description'); ?>
- <br />
- <?php
-
- echo elgg_view('input/longtext',array(
- 'name' => 'description',
- 'value' => $description,
- ));
-
- ?>
- </label>
-</p>
-<p>
- <label>
- <?php echo elgg_echo('tags'); ?>
- <?php
-
- echo elgg_view('input/tags',array(
- 'name' => 'tags',
- 'value' => $tags,
- ));
-
- ?>
- </label>
-</p>
- <?php
-
- //echo elgg_view('bookmarks/sharing',array('shares' => $shares, 'owner' => $owner));
- if ($friends = elgg_get_entities_from_relationship(array('relationship' => 'friend', 'relationship_guid' => $owner->getGUID(), 'inverse_relationship' => FALSE, 'type' => 'user', 'limit' => 9999))) {
-?>
-<p>
- <label><?php echo elgg_echo("bookmarks:with"); ?></label><br />
-<?php
- echo elgg_view('friends/picker',array('entities' => $friends, 'name' => 'shares', 'highlight' => $highlight));
-?>
-</p>
-<?php
- }
-
- ?>
-<p>
- <label>
- <?php echo elgg_echo('access'); ?>
- <?php
-
- echo elgg_view('input/access',array(
- 'name' => 'access',
- 'value' => $access_id,
- ));
-
- ?>
- </label>
-</p>
-<p>
- <?php echo $vars['container_guid'] ? elgg_view('input/hidden', array('name' => 'container_guid', 'value' => $vars['container_guid'])) : ""; ?>
- <input type="hidden" name="bookmark_guid" value="<?php echo $guid; ?>" />
- <input type="submit" value="<?php echo elgg_echo('save'); ?>" />
-</p>
-
-</form>
-</div> \ No newline at end of file
diff --git a/mod/bookmarks/views/default/bookmarks/owner_block.php b/mod/bookmarks/views/default/bookmarks/owner_block.php
deleted file mode 100644
index d9b31d8d4..000000000
--- a/mod/bookmarks/views/default/bookmarks/owner_block.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-$label = elgg_echo('bookmarks:this');
-$user = elgg_get_logged_in_user_entity();
-$url = "'" . $vars['url'] . "pg/bookmarks/add/{$user->username}?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
-
-?>
-<div id="owner_block_bookmark_this">
-<a href="javascript:location.href=<?php echo $url; ?>"><?php echo $label ?></a>
-</div>
diff --git a/mod/bookmarks/views/default/bookmarks/sharing.php b/mod/bookmarks/views/default/bookmarks/sharing.php
deleted file mode 100644
index 779af4de2..000000000
--- a/mod/bookmarks/views/default/bookmarks/sharing.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
- $owner = $vars['owner'];
- if ($friends = elgg_get_entities_from_relationship(array('relationship' => 'friend', 'relationship_guid' => $owner->getGUID(), 'inverse_relationship' => FALSE, 'type' => 'user', 'limit' => 9999))) {
-
-?>
-
-<table border="0" cellspacing="0" cellpadding="0">
-
-<?php
-
- $col = 0;
- foreach($friends as $friend) {
-
- if ($col == 0) echo "<tr>";
-
- $label = elgg_view("profile/icon",array('entity' => $friend, 'size' => 'tiny'));
- $options[$label] = $friend->getGUID();
-
-?>
-
- <td>
-
- <input type="checkbox" name="shares[]" value="<?php echo $options[$label]; ?>" />
-
- </td>
-
- <td >
-
- <div style="width: 25px; margin-bottom: 15px;">
- <?php
-
- echo $label;
-
- ?>
- </div>
- </td>
- <td style="width: 300px; padding: 5px;">
- <?php
-
- echo $friend->name;
-
- ?>
- </td>
-<?php
-
-
- $col++;
-
- if ($col == 3) {
-
- $col = 0;
- echo "</tr>";
-
- }
-
-
- }
- if ($col != 3) {
- echo "</tr>";
- }
-
-
-?>
-
-</table>
-
-<?php
-
- /*echo elgg_view('input/checkboxes',array(
-
- 'name' => 'shares',
- 'options' => $options,
- 'value' => $vars['shares'],
-
- )); */
-
- }
-
-?> \ No newline at end of file
diff --git a/mod/bookmarks/views/default/river/object/bookmarks/annotate.php b/mod/bookmarks/views/default/river/object/bookmarks/annotate.php
deleted file mode 100644
index 8db8a6581..000000000
--- a/mod/bookmarks/views/default/river/object/bookmarks/annotate.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-$statement = $vars['statement'];
-$performed_by = $statement->getSubject();
-$object = $statement->getObject();
-
-$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("bookmarks:river:annotate"),$url) . " ";
-$string .= "<a href=\"" . $object->getURL() . "\">" . elgg_echo("bookmarks:river:item") . "</a>";
-
-echo $string; \ No newline at end of file
diff --git a/mod/bookmarks/views/default/river/object/bookmarks/create.php b/mod/bookmarks/views/default/river/object/bookmarks/create.php
index 82ea75af7..743efdb22 100644
--- a/mod/bookmarks/views/default/river/object/bookmarks/create.php
+++ b/mod/bookmarks/views/default/river/object/bookmarks/create.php
@@ -1,10 +1,36 @@
<?php
-$performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
-$object = get_entity($vars['item']->object_guid);
-$url = $object->getURL();
+/**
+ * New bookmarks river entry
+ *
+ * @package Bookmarks
+ */
-$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("bookmarks:river:created"),$url) . " ";
-$string .= "<a href=\"" . $object->getURL() . "\">" . $object->title . "</a>"; //elgg_echo("bookmarks:river:item") . "</a>";
+$object = $vars['item']->getObjectEntity();
+$excerpt = elgg_get_excerpt($object->description);
-echo $string;
+$params = array(
+ 'href' => $object->getURL(),
+ 'text' => $object->title,
+);
+$link = elgg_view('output/url', $params);
+
+$group_string = '';
+$container = $object->getContainerEntity();
+if ($container instanceof ElggGroup) {
+ $params = array(
+ 'href' => $container->getURL(),
+ 'text' => $container->name,
+ );
+ $group_link = elgg_view('output/url', $params);
+ $group_string = elgg_echo('river:ingroup', array($group_link));
+}
+
+$link = elgg_echo('bookmarks:river:created', array($link));
+
+echo " $link $group_string";
+
+if ($excerpt) {
+ echo '<div class="elgg-river-content">';
+ echo $excerpt;
+ echo '</div>';
+}
diff --git a/mod/bookmarks/views/default/widgets/bookmarks/edit.php b/mod/bookmarks/views/default/widgets/bookmarks/edit.php
index f31b7660f..99d65ac8f 100644
--- a/mod/bookmarks/views/default/widgets/bookmarks/edit.php
+++ b/mod/bookmarks/views/default/widgets/bookmarks/edit.php
@@ -19,6 +19,6 @@ $dropdown = elgg_view('input/dropdown', $params);
?>
<div>
- <?php echo elgg_echo('bookmarks:max_display'); ?>:
+ <?php echo elgg_echo('bookmarks:numbertodisplay'); ?>:
<?php echo $dropdown; ?>
</div>