aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks
diff options
context:
space:
mode:
Diffstat (limited to 'mod/bookmarks')
-rwxr-xr-xmod/bookmarks/actions/edit.php68
-rwxr-xr-xmod/bookmarks/actions/reference.php66
-rwxr-xr-xmod/bookmarks/actions/remove.php66
-rwxr-xr-xmod/bookmarks/views/default/bookmarks/stats.php20
4 files changed, 110 insertions, 110 deletions
diff --git a/mod/bookmarks/actions/edit.php b/mod/bookmarks/actions/edit.php
index 16e324154..dd0330b2d 100755
--- a/mod/bookmarks/actions/edit.php
+++ b/mod/bookmarks/actions/edit.php
@@ -1,35 +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);
+<?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
diff --git a/mod/bookmarks/actions/reference.php b/mod/bookmarks/actions/reference.php
index ae79b78cd..515ac1ed1 100755
--- a/mod/bookmarks/actions/reference.php
+++ b/mod/bookmarks/actions/reference.php
@@ -1,34 +1,34 @@
-<?php
-
-/**
- * Elgg bookmarks add as 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('reference');
-$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()){
- //create a relationship between the object and bookmark
- if(add_entity_relationship($object_guid, "reference", $bookmark_guid)){
- // Success message
- system_message(elgg_echo("bookmarks:referenceadded"));
- }else{
- // Failure message
- system_message(elgg_echo("bookmarks:referenceerror"));
- }
- }else{
- // Failure message
- system_message(elgg_echo("bookmarks:referenceerror"));
- }
-}else{
- // Failure message
- system_message(elgg_echo("bookmarks:referenceerror"));
-}
-
+<?php
+
+/**
+ * Elgg bookmarks add as 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('reference');
+$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()){
+ //create a relationship between the object and bookmark
+ if(add_entity_relationship($object_guid, "reference", $bookmark_guid)){
+ // Success message
+ system_message(elgg_echo("bookmarks:referenceadded"));
+ }else{
+ // Failure message
+ system_message(elgg_echo("bookmarks:referenceerror"));
+ }
+ }else{
+ // Failure message
+ system_message(elgg_echo("bookmarks:referenceerror"));
+ }
+}else{
+ // Failure message
+ system_message(elgg_echo("bookmarks:referenceerror"));
+}
+
forward($object->getURL()); \ No newline at end of file
diff --git a/mod/bookmarks/actions/remove.php b/mod/bookmarks/actions/remove.php
index b8b1ad6a3..f704a5cc3 100755
--- a/mod/bookmarks/actions/remove.php
+++ b/mod/bookmarks/actions/remove.php
@@ -1,34 +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"));
-}
-
+<?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
diff --git a/mod/bookmarks/views/default/bookmarks/stats.php b/mod/bookmarks/views/default/bookmarks/stats.php
index 07450fd2e..a9cad12b3 100755
--- a/mod/bookmarks/views/default/bookmarks/stats.php
+++ b/mod/bookmarks/views/default/bookmarks/stats.php
@@ -1,10 +1,10 @@
-<?php
-/**
- * All site bookmark stats
- **/
-
-$count_bookmarks = elgg_get_entities("object", "bookmarks",0,"",10,0,true,0,null,0,0);
-$count_bookmark_comments = count_annotations(0, "object", "bookmarks","generic_comment");
-
-echo "<h3>Bookmark stats</h3>";
-echo "<p>".$count_bookmarks . " resources bookmarked.</p>";
+<?php
+/**
+ * All site bookmark stats
+ **/
+
+$count_bookmarks = elgg_get_entities("object", "bookmarks",0,"",10,0,true,0,null,0,0);
+$count_bookmark_comments = count_annotations(0, "object", "bookmarks","generic_comment");
+
+echo "<h3>Bookmark stats</h3>";
+echo "<p>".$count_bookmarks . " resources bookmarked.</p>";