You are here

function rules_events_node_arguments in Rules 6

Returns some arguments suitable for using it with a node

Related topics

1 call to rules_events_node_arguments()
node_rules_event_info in rules/modules/node.rules.inc
Implementation of hook_rules_event_info()

File

rules/modules/node.rules.inc, line 53
rules integration for the node module

Code

function rules_events_node_arguments($node_label, $author_label, $update = FALSE) {
  $args = array(
    'node' => array(
      'type' => 'node',
      'label' => $node_label,
    ),
    'author' => array(
      'type' => 'user',
      'label' => $author_label,
      'handler' => 'rules_events_argument_node_author',
    ),
  );
  if ($update) {
    $args += array(
      'node_unchanged' => array(
        'type' => 'node',
        'label' => t('unchanged content'),
        'handler' => 'rules_events_argument_node_unchanged',
      ),
      'author_unchanged' => array(
        'type' => 'user',
        'label' => t("unchanged content's author"),
        'handler' => 'rules_events_argument_unchanged_node_author',
      ),
    );
  }
  return $args + rules_events_global_user_argument();
}