From 0b9a0eae2bf248fe3b03be16837e20e2c6431224 Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 17 Feb 2011 04:55:37 +0000 Subject: Further cleanup of bookmarks. Moved bookmarklet to plugin. Pulled in the 1.7 bookmark pin and made the "Bookmark this page" less ugly. Added js to append the title. git-svn-id: http://code.elgg.org/elgg/trunk@8273 36083f99-b078-4883-b0ff-0f9b5a30f544 --- _graphics/elgg_bookmarklet.gif | Bin 790 -> 0 bytes mod/bookmarks/graphics/bookmark.gif | Bin 0 -> 576 bytes mod/bookmarks/graphics/bookmarklet.gif | Bin 0 -> 790 bytes mod/bookmarks/start.php | 9 ++++----- mod/bookmarks/views/default/bookmarks/bookmarklet.php | 2 +- mod/bookmarks/views/default/bookmarks/css.php | 3 +++ mod/bookmarks/views/default/bookmarks/js.php | 11 +++++++++++ mod/bookmarks/views/default/bookmarks/page_links.php | 16 ++++++++++++++++ 8 files changed, 35 insertions(+), 6 deletions(-) delete mode 100644 _graphics/elgg_bookmarklet.gif create mode 100644 mod/bookmarks/graphics/bookmark.gif create mode 100644 mod/bookmarks/graphics/bookmarklet.gif create mode 100644 mod/bookmarks/views/default/bookmarks/css.php create mode 100644 mod/bookmarks/views/default/bookmarks/js.php create mode 100644 mod/bookmarks/views/default/bookmarks/page_links.php diff --git a/_graphics/elgg_bookmarklet.gif b/_graphics/elgg_bookmarklet.gif deleted file mode 100644 index 45b24709b..000000000 Binary files a/_graphics/elgg_bookmarklet.gif and /dev/null differ diff --git a/mod/bookmarks/graphics/bookmark.gif b/mod/bookmarks/graphics/bookmark.gif new file mode 100644 index 000000000..55c5e3e15 Binary files /dev/null and b/mod/bookmarks/graphics/bookmark.gif differ diff --git a/mod/bookmarks/graphics/bookmarklet.gif b/mod/bookmarks/graphics/bookmarklet.gif new file mode 100644 index 000000000..45b24709b Binary files /dev/null and b/mod/bookmarks/graphics/bookmarklet.gif differ diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index 1fd9768a1..31c414741 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -28,13 +28,16 @@ function bookmarks_init() { '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'); - elgg_register_page_handler('bookmarks', 'bookmarks_page_handler'); + elgg_extend_view('css/screen', 'bookmarks/css'); + elgg_extend_view('js/elgg', 'bookmarks/js'); + elgg_extend_view('page/links', 'bookmarks/page_links'); // Register granular notification for this type if (is_callable('register_notification_object')) { @@ -280,10 +283,6 @@ function bookmarks_user_hover_menu($hook, $type, $return, $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(); diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php index 119b9d107..42bd1e913 100644 --- a/mod/bookmarks/views/default/bookmarks/bookmarklet.php +++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php @@ -23,7 +23,7 @@ $url = elgg_get_site_url(); $bookmarklet = " '', + 'href' => $url, + 'title' => $label, + 'rel' => 'nofollow', + 'encode_text' => false, + 'class' => 'right elgg-bookmark-page', +)); -- cgit v1.2.3