aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/river.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-05-19 23:52:50 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-05-19 23:52:50 +0000
commit8342ead0d181b784f9eb2550d21dc374d8fbd5eb (patch)
treeeedaa4bbc31ce775abcfcafa9ff643d0c1ef18ec /engine/lib/river.php
parentf158c3117196a61641e1c2dc9539a5ba573515c1 (diff)
downloadelgg-8342ead0d181b784f9eb2550d21dc374d8fbd5eb.tar.gz
elgg-8342ead0d181b784f9eb2550d21dc374d8fbd5eb.tar.bz2
'creating', 'river' is the plugin hook for preventing or catching a river addition before it happens
git-svn-id: http://code.elgg.org/elgg/trunk@9103 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/river.php')
-rw-r--r--engine/lib/river.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/engine/lib/river.php b/engine/lib/river.php
index 80f285e50..49b070082 100644
--- a/engine/lib/river.php
+++ b/engine/lib/river.php
@@ -23,7 +23,9 @@
function add_to_river($view, $action_type, $subject_guid, $object_guid, $access_id = "",
$posted = 0, $annotation_id = 0) {
- // use default viewtype for when called from REST api
+ global $CONFIG;
+
+ // use default viewtype for when called from web services api
if (!elgg_view_exists($view, 'default')) {
return false;
}
@@ -60,7 +62,7 @@ $posted = 0, $annotation_id = 0) {
);
// return false to stop insert
- $params = elgg_trigger_plugin_hook('add', 'river', null, $params);
+ $params = elgg_trigger_plugin_hook('creating', 'river', null, $params);
if ($params == false) {
// inserting did not fail - it was just prevented
return true;
@@ -68,9 +70,6 @@ $posted = 0, $annotation_id = 0) {
extract($params);
- // Load config
- global $CONFIG;
-
// Attempt to save river item; return success status
$insert_data = insert_data("insert into {$CONFIG->dbprefix}river " .
" set type = '$type', " .
@@ -83,7 +82,8 @@ $posted = 0, $annotation_id = 0) {
" annotation_id = $annotation_id, " .
" posted = $posted");
- //update the entities which had the action carried out on it
+ // update the entities which had the action carried out on it
+ // @todo shouldn't this be down elsewhere? Like when an annotation is saved?
if ($insert_data) {
update_entity_last_action($object_guid, $posted);
return $insert_data;