diff options
Diffstat (limited to 'mod/bookmarks/views')
-rw-r--r-- | mod/bookmarks/views/default/bookmarks/bookmarklet.php | 2 | ||||
-rw-r--r-- | mod/bookmarks/views/default/bookmarks/css.php | 3 | ||||
-rw-r--r-- | mod/bookmarks/views/default/bookmarks/js.php | 11 | ||||
-rw-r--r-- | mod/bookmarks/views/default/bookmarks/page_links.php | 16 |
4 files changed, 31 insertions, 1 deletions
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 = "<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>"; + . "<img src=\"{$url}mod/bookmarks/graphics/bookmarklet.gif\" border=\"0\" title=\"$title\" /> </a>"; ?> <p><?php echo elgg_echo("bookmarks:bookmarklet:description"); ?></p> diff --git a/mod/bookmarks/views/default/bookmarks/css.php b/mod/bookmarks/views/default/bookmarks/css.php new file mode 100644 index 000000000..0d734c847 --- /dev/null +++ b/mod/bookmarks/views/default/bookmarks/css.php @@ -0,0 +1,3 @@ +.elgg-icon-bookmark { + background: transparent url(<?php echo elgg_get_site_url();?>mod/bookmarks/graphics/bookmark.gif); +}
\ No newline at end of file diff --git a/mod/bookmarks/views/default/bookmarks/js.php b/mod/bookmarks/views/default/bookmarks/js.php new file mode 100644 index 000000000..35dc82f70 --- /dev/null +++ b/mod/bookmarks/views/default/bookmarks/js.php @@ -0,0 +1,11 @@ +elgg.provide('elgg.bookmarks'); + +elgg.bookmarks.init = function() { + // append the title to the url + var title = document.title; + var e = $('a.elgg-bookmark-page'); + var link = e.attr('href') + '&title=' + encodeURIComponent(title); + e.attr('href', link); +} + +elgg.register_event_handler('init', 'system', elgg.bookmarks.init);
\ No newline at end of file diff --git a/mod/bookmarks/views/default/bookmarks/page_links.php b/mod/bookmarks/views/default/bookmarks/page_links.php new file mode 100644 index 000000000..79678a47b --- /dev/null +++ b/mod/bookmarks/views/default/bookmarks/page_links.php @@ -0,0 +1,16 @@ +<?php +/** + * Shows a "Bookmark this" link and icon + */ +$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); + +echo elgg_view('output/url', array( + 'text' => '<span class="elgg-icon elgg-icon-bookmark"></span>', + 'href' => $url, + 'title' => $label, + 'rel' => 'nofollow', + 'encode_text' => false, + 'class' => 'right elgg-bookmark-page', +)); |