aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/actions/edit.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/edit.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/edit.php')
-rwxr-xr-xmod/bookmarks/actions/edit.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/mod/bookmarks/actions/edit.php b/mod/bookmarks/actions/edit.php
new file mode 100755
index 000000000..16e324154
--- /dev/null
+++ b/mod/bookmarks/actions/edit.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Elgg bookmarks edit action
+ *
+ */
+
+gatekeeper();
+action_gatekeeper();
+//set some required variables
+$guid = get_input('guid');
+$title = get_input('title');
+$address = get_input('address');
+$notes = get_input('notes');
+$access = get_input('access');
+$tags = get_input('tags');
+$tagarray = string_to_tag_array($tags);
+
+// Make sure we actually have permission to edit
+$bookmark = get_entity($guid);
+if ($bookmark->getSubtype() == "bookmarks" && $bookmark->canEdit()) {
+ $bookmark->title = $title;
+ $bookmark->description = $notes;
+ $bookmark->address = $address;
+ $bookmark->access_id = $access;
+ $bookmark->tags = $tagarray;
+ if ($bookmark->save()) {
+ system_message(elgg_echo('bookmarks:edit:success'));
+ } else {
+ system_message(elgg_echo('bookmarks:edit:fail'));
+ }
+}else{
+ system_message(elgg_echo('bookmarks:edit:fail'));
+}
+$account = get_entity($bookmark->container_guid);
+forward("pg/bookmarks/" . $account->username); \ No newline at end of file