From 7e8a3d71ca771f077edea92e3e73685d30ca7aba Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 31 Jul 2008 14:05:54 +0000 Subject: Friends collections are now fully part of the main core git-svn-id: https://code.elgg.org/elgg/trunk@1630 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/friends/addcollection.php | 49 +++++++++++++++++++++++++++++++++ actions/friends/deletecollection.php | 49 +++++++++++++++++++++++++++++++++ actions/friends/editcollection.php | 52 ++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 actions/friends/addcollection.php create mode 100644 actions/friends/deletecollection.php create mode 100644 actions/friends/editcollection.php (limited to 'actions') diff --git a/actions/friends/addcollection.php b/actions/friends/addcollection.php new file mode 100644 index 000000000..64ee89fe8 --- /dev/null +++ b/actions/friends/addcollection.php @@ -0,0 +1,49 @@ +getGUID()); + + //if the collection was created and the user passed some friends from the form, add them + if($create_collection && (!empty($friends))){ + + //add friends to the collection + foreach($friends as $friend){ + add_user_to_access_collection($friend, $create_collection); + } + + } + + // Success message + system_message(elgg_echo("friends:collectionadded")); + // Forward to the collections page + forward("pg/collections/" . $_SESSION['user']->username); + + } else { + + register_error(elgg_echo("friends:nocollectionname")); + // Forward to the add collection page + forward("pg/collections/add"); + + } + +?> \ No newline at end of file diff --git a/actions/friends/deletecollection.php b/actions/friends/deletecollection.php new file mode 100644 index 000000000..3d389e6c2 --- /dev/null +++ b/actions/friends/deletecollection.php @@ -0,0 +1,49 @@ +owner_guid == $_SESSION['user']->getGUID()){ + + $delete_collection = delete_access_collection($collection_id); + + // Success message + system_message(elgg_echo("friends:collectiondeleted")); + + } else { + + // Failure message + system_message(elgg_echo("friends:collectiondeletefailed")); + + } + + } else { + + // Failure message + system_message(elgg_echo("friends:collectiondeletefailed")); + + } + + // Forward to the collections page + forward("pg/collections/" . $_SESSION['user']->username); + +?> \ No newline at end of file diff --git a/actions/friends/editcollection.php b/actions/friends/editcollection.php new file mode 100644 index 000000000..f8458da46 --- /dev/null +++ b/actions/friends/editcollection.php @@ -0,0 +1,52 @@ +getGUID()); + + + // Success message + system_message(elgg_echo("friends:collectionadded")); + // Forward to the collections page + forward("pg/collections/" . $_SESSION['user']->username); + + } else { + + register_error(elgg_echo("friends:nocollectionname")); + + } + + } else { + + register_error(elgg_echo("friends:nocollectionname")); + + } + + // Forward to the add collection page + forward("pg/collections/add"); + +?> \ No newline at end of file -- cgit v1.2.3