From c1411ffc81908882edaace315c46e500419d2aba Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 26 Feb 2011 14:23:32 +0000 Subject: Refs #2982 adding and deleting friend collections works - editing does not git-svn-id: http://code.elgg.org/elgg/trunk@8490 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/users.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'engine') diff --git a/engine/lib/users.php b/engine/lib/users.php index fd68ef276..1b9a6128b 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1145,18 +1145,20 @@ function friends_of_page_handler($page_elements) { */ function collections_page_handler($page_elements) { elgg_set_context('friends'); + $base = elgg_get_config('path'); if (isset($page_elements[0])) { if ($page_elements[0] == "add") { set_page_owner(elgg_get_logged_in_user_guid()); collections_submenu_items(); - require_once(dirname(dirname(dirname(__FILE__))) . "/pages/friends/add.php"); + require_once "{$base}pages/friends/collections/add.php"; } else { - if ($user = get_user_by_username($page_elements[0])) { + $user = get_user_by_username($page_elements[0]); + if ($user) { set_page_owner($user->getGUID()); if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) { collections_submenu_items(); } - require_once(dirname(dirname(dirname(__FILE__))) . "/pages/friends/collections.php"); + require_once "{$base}pages/friends/collections/view.php"; } } } @@ -1566,9 +1568,9 @@ function users_init() { elgg_register_action('avatar/crop'); elgg_register_action('profile/edit'); - elgg_register_action('friends/addcollection'); - elgg_register_action('friends/deletecollection'); - elgg_register_action('friends/editcollection'); + elgg_register_action('friends/collections/add'); + elgg_register_action('friends/collections/delete'); + elgg_register_action('friends/collections/edit'); elgg_register_plugin_hook_handler('entity:icon:url', 'user', 'user_avatar_hook'); -- cgit v1.2.3