From: cash Date: Sat, 26 Feb 2011 20:57:09 +0000 (+0000) Subject: Fixes #2982 friends collections work even if the code is convoluted and poorly written. X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=a2250e1854f23351b2a39e304e2bd5977f3fd867;p=lorea%2Felgg.git Fixes #2982 friends collections work even if the code is convoluted and poorly written. git-svn-id: http://code.elgg.org/elgg/trunk@8495 36083f99-b078-4883-b0ff-0f9b5a30f544 --- diff --git a/_graphics/friendspicker.png b/_graphics/friendspicker.png new file mode 100644 index 000000000..78b540397 Binary files /dev/null and b/_graphics/friendspicker.png differ diff --git a/actions/friends/collections/edit.php b/actions/friends/collections/edit.php index 8fd1eae18..b7fb716f2 100644 --- a/actions/friends/collections/edit.php +++ b/actions/friends/collections/edit.php @@ -1,6 +1,6 @@ "Friend collections", 'collections:add' => "New collection", 'friends:collections:add' => "New friends collection", - 'friends:addfriends' => "Add friends", + 'friends:addfriends' => "Select friends", 'friends:collectionname' => "Collection name", 'friends:collectionfriends' => "Friends in collection", 'friends:collectionedit' => "Edit this collection", - 'friends:nocollections' => "You do not yet have any collections.", + 'friends:nocollections' => "You do not have any collections yet.", 'friends:collectiondeleted' => "Your collection has been deleted.", 'friends:collectiondeletefailed' => "We were unable to delete the collection. Either you don't have permission, or some other problem has occurred.", 'friends:collectionadded' => "Your collection was successfully created", diff --git a/pages/friends/collections/add.php b/pages/friends/collections/add.php index 51425db37..0bc3f1fcb 100644 --- a/pages/friends/collections/add.php +++ b/pages/friends/collections/add.php @@ -13,12 +13,8 @@ $title = elgg_echo('friends:collections:add'); $content = elgg_view_title($title); -$form_body = elgg_view('forms/friends/collections/edit', array( - 'friends' => get_user_friends(elgg_get_logged_in_user_guid(), "", 9999) -)); -$content .= elgg_view('input/form', array( - 'action' => 'action/friends/collections/add', - 'body' => $form_body, +$content .= elgg_view_form('friends/collections/add', array(), array( + 'friends' => get_user_friends(elgg_get_logged_in_user_guid(), "", 9999), )); $body = elgg_view_layout('one_sidebar', array('content' => $content)); diff --git a/pages/friends/collections/pickercallback.php b/pages/friends/collections/pickercallback.php index 8da44d8c0..228037590 100644 --- a/pages/friends/collections/pickercallback.php +++ b/pages/friends/collections/pickercallback.php @@ -43,27 +43,15 @@ switch($type) { break; default: $friends = $pageowner->getFriends('', 9999); - $params = array( - 'collection' => get_access_collection($collection), - 'friends' => $friends, - 'friendspicker' => $friendspicker, - ); - $content = elgg_view_form('friends/collections/edit', array(), $params); - /* - $form_body = elgg_view('input/hidden', array( - 'name' => 'collection_id', - 'value' => get_access_collection($collection)->id, - )); + $content = elgg_view('input/friendspicker', array( 'entities' => $friends, 'value' => $members, 'callback' => true, 'friendspicker' => $friendspicker, - 'formcontents' => $form_body, + 'collection_id' => $collection, 'formtarget' => $site_url . 'action/friends/collections/edit', )); - * - */ break; } diff --git a/views/default/core/friends/collections.php b/views/default/core/friends/collections.php index 5c1c824e7..d88d591ad 100644 --- a/views/default/core/friends/collections.php +++ b/views/default/core/friends/collections.php @@ -32,7 +32,7 @@ if (is_array($vars['collections']) && sizeof($vars['collections'])) { -