summaryrefslogtreecommitdiff
path: root/modules/node/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-09-19 11:07:37 +0000
committerDries Buytaert <dries@buytaert.net>2009-09-19 11:07:37 +0000
commitfd1c63b5c0ce91849d6088b7aad40b27ea7bb96f (patch)
tree7742fc7fdc55f819c066be08a3419995b591439b /modules/node/node.module
parenta557b0de2ac5d0b2048a456f94f9b8047afa71b9 (diff)
downloadbrdo-fd1c63b5c0ce91849d6088b7aad40b27ea7bb96f.tar.gz
brdo-fd1c63b5c0ce91849d6088b7aad40b27ea7bb96f.tar.bz2
- Patch ##525540 by jvandyk, sun, jhodgdon, fago | webchick, TheRec, Dave Reid, brianV, sun.core, cweagans, Dries: gave trigger.module and includes/actions.inc an API overhaul. Simplified definitions of actions and triggers and removed dependency on the combination of hooks and operations. Triggers now directly map to module hooks.
Diffstat (limited to 'modules/node/node.module')
-rw-r--r--modules/node/node.module101
1 files changed, 34 insertions, 67 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 46cf0a91c..719e392bc 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -2754,123 +2754,90 @@ function node_forms() {
}
/**
- * Implement hook_hook_info().
- */
-function node_hook_info() {
- return array(
- 'node' => array(
- 'node' => array(
- 'presave' => array(
- 'runs when' => t('When either saving a new post or updating an existing post'),
- ),
- 'insert' => array(
- 'runs when' => t('After saving a new post'),
- ),
- 'update' => array(
- 'runs when' => t('After saving an updated post'),
- ),
- 'delete' => array(
- 'runs when' => t('After deleting a post')
- ),
- 'view' => array(
- 'runs when' => t('When content is viewed by an authenticated user')
- ),
- ),
- ),
- );
-}
-
-/**
* Implement hook_action_info().
*/
function node_action_info() {
return array(
'node_publish_action' => array(
'type' => 'node',
- 'description' => t('Publish post'),
+ 'label' => t('Publish content'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
- 'hooks' => array(
- 'node' => array('presave'),
- 'comment' => array('insert', 'update'),
- ),
+ 'triggers' => array('node_presave', 'comment_insert', 'comment_update'),
),
'node_unpublish_action' => array(
'type' => 'node',
- 'description' => t('Unpublish post'),
+ 'label' => t('Unpublish content'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
- 'hooks' => array(
- 'node' => array('presave'),
- 'comment' => array('delete', 'insert', 'update'),
+ 'triggers' => array(
+ 'node_presave',
+ 'comment_insert',
+ 'comment_update',
+ 'comment_delete'
),
),
'node_make_sticky_action' => array(
'type' => 'node',
- 'description' => t('Make post sticky'),
+ 'label' => t('Make content sticky'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
- 'hooks' => array(
- 'node' => array('presave'),
- 'comment' => array('insert', 'update'),
- ),
+ 'triggers' => array('node_presave', 'comment_insert', 'comment_update'),
),
'node_make_unsticky_action' => array(
'type' => 'node',
- 'description' => t('Make post unsticky'),
+ 'label' => t('Make content unsticky'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
- 'hooks' => array(
- 'node' => array('presave'),
- 'comment' => array('delete', 'insert', 'update'),
+ 'triggers' => array(
+ 'node_presave',
+ 'comment_insert',
+ 'comment_update',
+ 'comment_delete'
),
),
'node_promote_action' => array(
'type' => 'node',
- 'description' => t('Promote post to front page'),
+ 'label' => t('Promote content to front page'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
- 'hooks' => array(
- 'node' => array('presave'),
- 'comment' => array('insert', 'update'),
- ),
+ 'triggers' => array('node_presave', 'comment_insert', 'comment_update'),
),
'node_unpromote_action' => array(
'type' => 'node',
- 'description' => t('Remove post from front page'),
+ 'label' => t('Remove content from front page'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
- 'hooks' => array(
- 'node' => array('presave'),
- 'comment' => array('delete', 'insert', 'update'),
+ 'triggers' => array(
+ 'node_presave',
+ 'comment_insert',
+ 'comment_update',
+ 'comment_delete'
),
),
'node_assign_owner_action' => array(
'type' => 'node',
- 'description' => t('Change the author of a post'),
+ 'label' => t('Change the author of content'),
'configurable' => TRUE,
'behavior' => array('changes_node_property'),
- 'hooks' => array(
- 'any' => TRUE,
- 'node' => array('presave'),
- 'comment' => array('delete', 'insert', 'update'),
+ 'triggers' => array(
+ 'node_presave',
+ 'comment_insert',
+ 'comment_update',
+ 'comment_delete',
),
),
'node_save_action' => array(
'type' => 'node',
- 'description' => t('Save post'),
+ 'label' => t('Save content'),
'configurable' => FALSE,
- 'hooks' => array(
- 'comment' => array('delete', 'insert', 'update'),
- ),
+ 'triggers' => array('comment_delete', 'comment_insert', 'comment_update'),
),
'node_unpublish_by_keyword_action' => array(
'type' => 'node',
- 'description' => t('Unpublish post containing keyword(s)'),
+ 'label' => t('Unpublish content containing keyword(s)'),
'configurable' => TRUE,
- 'hooks' => array(
- 'node' => array('presave', 'insert', 'update'),
- ),
+ 'triggers' => array('node_presave', 'node_insert', 'node_update'),
),
);
}