You are here

function node_rules_action_info in Rules 6

Implementation of hook_rules_action_info().

Related topics

File

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

Code

function node_rules_action_info() {
  return array(
    'rules_action_node_set_author' => array(
      'label' => t('Set the content author'),
      'arguments' => array(
        'node' => array(
          'type' => 'node',
          'label' => t('Content'),
        ),
        'author' => array(
          'type' => 'user',
          'label' => t('User, who is set as author'),
        ),
      ),
      'module' => 'Node',
    ),
    'rules_action_node_load_author' => array(
      'label' => t('Load the content author'),
      'arguments' => array(
        'node' => array(
          'type' => 'node',
          'label' => t('Content'),
        ),
      ),
      'new variables' => array(
        'author' => array(
          'type' => 'user',
          'label' => t('Content author'),
          'label callback' => 'rules_action_node_load_author_variable_label',
        ),
      ),
      'module' => 'Node',
    ),
    'rules_action_set_node_title' => array(
      'label' => t('Set content title'),
      'arguments' => array(
        'node' => array(
          'type' => 'node',
          'label' => t('Content'),
        ),
        'title' => array(
          'type' => 'string',
          'label' => t('Title'),
        ),
      ),
      'module' => 'Node',
    ),
    'rules_action_add_node' => array(
      'label' => t('Add new content'),
      'arguments' => array(
        'author' => array(
          'type' => 'user',
          'label' => t('User, who is set as author'),
        ),
        'title' => array(
          'type' => 'string',
          'label' => t('Title'),
          'description' => t('The title of the newly created content.'),
        ),
      ),
      'new variables' => array(
        'node_added' => array(
          'type' => 'node',
          'label' => t('New content'),
          'save' => TRUE,
          'label callback' => 'rules_action_add_node_variable_label',
        ),
      ),
      'module' => 'Node',
    ),
    'rules_action_load_node' => array(
      'label' => t('Load content by id'),
      'arguments' => array(
        'nid' => array(
          'type' => 'number',
          'label' => t('Content ID'),
        ),
        'vid' => array(
          'type' => 'number',
          'label' => t('Content Revision ID'),
          'description' => t("If you want to load a specific revision, specify it's revision id. Else leave it empty to load the current revision."),
          'required' => FALSE,
        ),
      ),
      'new variables' => array(
        'node_loaded' => array(
          'type' => 'node',
          'label' => t('Loaded content'),
          'label callback' => 'rules_action_load_node_variable_label',
        ),
      ),
      'module' => 'Node',
    ),
    'rules_action_delete_node' => array(
      'label' => t('Delete content'),
      'arguments' => array(
        'node' => array(
          'type' => 'node',
          'label' => t('Content'),
        ),
      ),
      'module' => 'Node',
    ),
  );
}