From 8342ead0d181b784f9eb2550d21dc374d8fbd5eb Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 19 May 2011 23:52:50 +0000 Subject: '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 --- engine/lib/river.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engine/lib/river.php') 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; -- cgit v1.2.3