aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/actions/remove.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-03 23:15:07 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-03 23:15:07 +0000
commit0320936f29dd83534b5af386a981131be7981a9a (patch)
tree1d524f4a43c5974bf10b1177a8935754ee176ec5 /mod/bookmarks/actions/remove.php
parente2ba75ce7dad46f87c43b7ef256e79053af5566e (diff)
downloadelgg-0320936f29dd83534b5af386a981131be7981a9a.tar.gz
elgg-0320936f29dd83534b5af386a981131be7981a9a.tar.bz2
Updated bookmarks with new interface.
git-svn-id: http://code.elgg.org/elgg/trunk@5266 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/bookmarks/actions/remove.php')
-rwxr-xr-xmod/bookmarks/actions/remove.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/mod/bookmarks/actions/remove.php b/mod/bookmarks/actions/remove.php
new file mode 100755
index 000000000..b8b1ad6a3
--- /dev/null
+++ b/mod/bookmarks/actions/remove.php
@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * Elgg bookmarks remove a reference
+ * Guid one is the object, guid two is the bookmark, 'reference' is the relationship name
+ */
+
+//set some variables
+$object_guid = get_input('object_guid');
+$bookmark_guid = get_input('bookmark');
+$object = get_entity($object_guid);
+$bookmark = get_entity($bookmark_guid);
+//check both the object and bookmark exist
+if($bookmark && $object){
+ //check the user can add a reference
+ if($object->canEdit()){
+ //remove the relationship between the object and bookmark
+ if(remove_entity_relationship($object_guid, "reference", $bookmark_guid)){
+ // Success message
+ system_message(elgg_echo("bookmarks:removed"));
+ }else{
+ // Failure message
+ system_message(elgg_echo("bookmarks:removederror"));
+ }
+ }else{
+ // Failure message
+ system_message(elgg_echo("bookmarks:removederror"));
+ }
+}else{
+ // Failure message
+ system_message(elgg_echo("bookmarks:removederror"));
+}
+
+forward($object->getURL()); \ No newline at end of file