aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/bookmarks/start.php14
-rw-r--r--mod/bookmarks/views/default/bookmarks/page_links.php20
-rw-r--r--views/default/page/elements/page_links.php37
-rw-r--r--views/default/page/elements/sidebar.php2
4 files changed, 13 insertions, 60 deletions
diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php
index a58ec37c5..d5790cb3a 100644
--- a/mod/bookmarks/start.php
+++ b/mod/bookmarks/start.php
@@ -38,8 +38,18 @@ function bookmarks_init() {
elgg_extend_view('css/elgg', 'bookmarks/css');
elgg_extend_view('js/elgg', 'bookmarks/js');
- elgg_extend_view('page/links', 'bookmarks/page_links');
-
+ if (elgg_is_logged_in()) {
+ $user_guid = elgg_get_logged_in_user_guid();
+ $address = urlencode(current_page_url());
+
+ elgg_register_menu_item('page_links', array(
+ 'name' => 'bookmark',
+ 'text' => elgg_view_icon('bookmark'),
+ 'href' => "pg/bookmarks/add/$user_guid?address=$address",
+ 'title' => elgg_echo('bookmarks:this'),
+ 'rel' => 'nofollow',
+ ));
+ }
// Register granular notification for this type
if (is_callable('register_notification_object')) {
register_notification_object('object', 'bookmarks', elgg_echo('bookmarks:new'));
diff --git a/mod/bookmarks/views/default/bookmarks/page_links.php b/mod/bookmarks/views/default/bookmarks/page_links.php
deleted file mode 100644
index 8774230f0..000000000
--- a/mod/bookmarks/views/default/bookmarks/page_links.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/**
- * Shows a "Bookmark this" link and icon
- */
-if (!elgg_is_logged_in()) {
- return;
-}
-
-$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' => elgg_view_icon('bookmark'),
- 'href' => $url,
- 'title' => $label,
- 'rel' => 'nofollow',
- 'encode_text' => false,
- 'class' => 'right elgg-bookmark-page',
-)); \ No newline at end of file
diff --git a/views/default/page/elements/page_links.php b/views/default/page/elements/page_links.php
deleted file mode 100644
index bd901ee42..000000000
--- a/views/default/page/elements/page_links.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-/**
- * Page links: RSS link, reported content link, etc.
- */
-
-// Are there feeds to display?
-global $autofeed;
-$rss_link = '';
-if (isset($autofeed) && $autofeed == true) {
- $url = full_url();
- if (substr_count($url,'?')) {
- $url .= "&view=rss";
- } else {
- $url .= "?view=rss";
- }
- $url = elgg_format_url($url);
- $label = elgg_echo('feed:rss');
-
- $rss_link = elgg_view('output/url', array(
- 'text' => elgg_view_icon('rss'),
- 'href' => $url,
- 'title' => $label,
- 'rel' => 'nofollow',
- 'encode_text' => false,
- 'class' => 'right',
- ));
-}
-
-// view to extend by plugins
-$links = elgg_view('page/links', $vars);
-
-if ($links || $rss_link) {
- echo '<div class="elgg-page-links clearfix mbm">';
- echo $rss_link;
- echo $links;
- echo '</div>';
-}
diff --git a/views/default/page/elements/sidebar.php b/views/default/page/elements/sidebar.php
index 8950c5f3f..95ff7308e 100644
--- a/views/default/page/elements/sidebar.php
+++ b/views/default/page/elements/sidebar.php
@@ -5,7 +5,7 @@
* @uses $vars['sidebar'] Optional content that is displayed at the bottom of sidebar
*/
-echo elgg_view('page/elements/page_links', $vars);
+echo elgg_view_menu('page_links', array('sort_by' => 'name'));
echo elgg_view('page/elements/owner_block', $vars);