diff options
Diffstat (limited to 'modules/trigger/trigger.module')
-rw-r--r-- | modules/trigger/trigger.module | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/modules/trigger/trigger.module b/modules/trigger/trigger.module index e59d33851..bc127a8b4 100644 --- a/modules/trigger/trigger.module +++ b/modules/trigger/trigger.module @@ -200,9 +200,11 @@ function _trigger_normalize_node_context($type, $node) { } /** - * Implementation of hook_nodeapi(). + * Simple wrapper function to make user hooks work with new entry points. + * + * @TODO: Take advantage of the new API and reorganise/remove this function. */ -function trigger_nodeapi(&$node, $op, $a3, $a4) { +function _trigger_nodeapi(&$node, $op, $a3, $a4) { // Keep objects for reuse so that changes actions make to objects can persist. static $objects; // Prevent recursion by tracking which operations have already been called. @@ -239,6 +241,41 @@ function trigger_nodeapi(&$node, $op, $a3, $a4) { } } } + +/** + * Implementation of hook_nodeapi_view(). + */ +function trigger_nodeapi_view(&$node, $a3, $a4) { + _trigger_nodeapi($node, 'view', $a3, $a4); +} + +/** + * Implementation of hook_nodeapi_update(). + */ +function trigger_nodeapi_update(&$node, $a3, $a4) { + _trigger_nodeapi($node, 'update', $a3, $a4); +} + +/** + * Implementation of hook_nodeapi_presave(). + */ +function trigger_nodeapi_presave(&$node, $a3, $a4) { + _trigger_nodeapi($node, 'presave', $a3, $a4); +} + +/** + * Implementation of hook_nodeapi_insert(). + */ +function trigger_nodeapi_insert(&$node, $a3, $a4) { + _trigger_nodeapi($node, 'insert', $a3, $a4); +} + +/** + * Implementation of hook_nodeapi_delete(). + */ +function trigger_nodeapi_delete(&$node, $a3, $a4) { + _trigger_nodeapi($node, 'delete', $a3, $a4); +} /** * When an action is called in a context that does not match its type, |