Index: nodehierarchy.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/nodehierarchy/nodehierarchy.module,v retrieving revision 1.1.2.3 diff -u -r1.1.2.3 nodehierarchy.module --- nodehierarchy.module 18 Feb 2008 05:54:51 -0000 1.1.2.3 +++ nodehierarchy.module 2 Mar 2008 10:46:44 -0000 @@ -14,7 +14,11 @@ if (module_exists('token')) { include_once('./'. drupal_get_path('module', 'nodehierarchy') .'/nodehierarchy_token.inc'); } - + // Workflow-ng module support. + if (module_exists('workflow_ng')) { + include_once drupal_get_path('module', 'nodehierarchy') .'/nodehierarchy_workflow_ng.inc'; + } + include_once('./'. drupal_get_path('module', 'nodehierarchy') .'/nodehierarchy_theme.inc'); } } Index: nodehierarchy_workflow_ng.inc =================================================================== RCS file: nodehierarchy_workflow_ng.inc diff -N nodehierarchy_workflow_ng.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ nodehierarchy_workflow_ng.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,54 @@ + array( + '#label' => t('Content has parent'), + '#arguments' => array( + 'node' => array('#entity' => 'node', '#label' => t('Content')), + ), + '#module' => t('Node Hierarchy'), + ), + ); +} + +function nodehierarchy_has_parent($node, $settings) { + return (bool)$node->parent; +} + + +/** + * Implementation of hook_action_info() + */ +function nodehierarchy_action_info() { + return array( + 'nodehierarchy_action_load' => array( + '#label' => t('Load a content\'s parent content'), + '#arguments' => array( + 'node' => array('#entity' => 'node', '#label' => t('Child content')), + ), + '#new arguments' => array( + 'node_parent' => array('#entity' => 'node', '#label' => t('Parent content')), + ), + '#module' => t('Node Hierarchy'), + ), + ); +} + +/** + * Loads the node's parent + */ +function nodehierarchy_action_load($node, $settings) { + if ($parent = node_load($node->parent)) { + return array('#new arguments' => array('node_parent' => $parent)); + } +}