From 31354451ce2c236c9c963064652c39fe54be4afd Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 15 Mar 2014 14:58:59 -0300 Subject: Squashed 'mod/elgg-favorites/' content from commit d96e69b git-subtree-dir: mod/elgg-favorites git-subtree-split: d96e69bd1365c3e3c4d998e72d9941ea1ea2278b --- actions/favorites/add.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 actions/favorites/add.php (limited to 'actions/favorites/add.php') diff --git a/actions/favorites/add.php b/actions/favorites/add.php new file mode 100644 index 000000000..bee00c291 --- /dev/null +++ b/actions/favorites/add.php @@ -0,0 +1,17 @@ + 0) && + ($user_guid > 0) && + !check_entity_relationship($user_guid ,'flags_content', $entity_guid)) { + if (add_entity_relationship($user_guid ,'flags_content', $entity_guid)) { + // elgg_dump("Notice: Added flag relationship between $user_guid and $entity_guid. ", FALSE, 'NOTICE'); + system_message(elgg_echo('favorites:added')); + } else { + // elgg_dump("Could not add flag / fav relation between $user_guid and $entity_guid.", FALSE, 'WARN'); + register_error(elgg_echo('favorites:addfailed')); + } + } + if (!elgg_is_xhr()) { + forward($_SERVER['HTTP_REFERER']); + } -- cgit v1.2.3