aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-04 16:23:15 +0000
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-04 16:23:15 +0000
commit05def0b596a06ce9256ea47e415fd128019280b2 (patch)
tree8b4a94cec0d4fbf37ecb194f71a0f6f1b3961aeb /mod
parent8e56ebfaa05eb987e65bbff91aae268c479301de (diff)
downloadelgg-05def0b596a06ce9256ea47e415fd128019280b2.tar.gz
elgg-05def0b596a06ce9256ea47e415fd128019280b2.tar.bz2
Extending topbar view to include My Friends link.
git-svn-id: http://code.elgg.org/elgg/trunk@5968 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r--mod/profile/start.php1
-rw-r--r--mod/profile/views/default/profile/topbar_extend.php11
2 files changed, 12 insertions, 0 deletions
diff --git a/mod/profile/start.php b/mod/profile/start.php
index 1b47445d7..f83f10869 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -23,6 +23,7 @@ function profile_init() {
register_entity_url_handler('profile_url', 'user', 'all');
// Set up the menu for logged-in users
+ elgg_extend_view('elgg_topbar/extend', 'profile/topbar_extend');
//if (isloggedin()) {
// add_menu(elgg_echo('profile:yours'), $_SESSION['user']->getURL() . '/extend');
//}
diff --git a/mod/profile/views/default/profile/topbar_extend.php b/mod/profile/views/default/profile/topbar_extend.php
new file mode 100644
index 000000000..c1c4e13bb
--- /dev/null
+++ b/mod/profile/views/default/profile/topbar_extend.php
@@ -0,0 +1,11 @@
+<?php
+/**
+ *
+ */
+
+$user = get_loggedin_user();
+
+if (($user instanceof ElggUser) && ($user->guid > 0)) {
+ $friends = elgg_echo('friends');
+ echo "<a class='myfriends' href=\"{$vars['url']}pg/friends/{$user->username}\" title=\"$friends\">$friends</a>";
+}