You are here

function taxonomy_rules_action_info in Rules 6

Implementation of hook_rules_action_info().

Related topics

File

rules/modules/taxonomy.rules.inc, line 61
Rules integration for the taxonomy module.

Code

function taxonomy_rules_action_info() {
  $info = array();

  // Term actions.
  $info['rules_action_taxonomy_load_term'] = array(
    'label' => t('Load a term'),
    'new variables' => array(
      'taxonomy_term' => array(
        'type' => 'taxonomy_term',
        'label' => t('Taxonomy term'),
      ),
    ),
    'eval input' => array(
      'term|term_text',
    ),
    'help' => t('Loading a taxonomy term will allow you to act on this term, for example you will be able to assign this term to a content.'),
    'module' => 'Taxonomy',
  );
  $info['rules_action_taxonomy_add_term'] = array(
    'label' => t('Add a new term to vocabulary'),
    'arguments' => array(
      'taxonomy_vocab' => array(
        'type' => 'taxonomy_vocab',
        'label' => t('Taxonomy vocabulary'),
      ),
    ),
    'new variables' => array(
      'taxonomy_term' => array(
        'type' => 'taxonomy_term',
        'label' => t('Taxonomy term'),
      ),
    ),
    'eval input' => array(
      'term|name',
      'term|description',
    ),
    'module' => 'Taxonomy',
  );
  $info['rules_action_taxonomy_delete_term'] = array(
    'label' => t('Delete a term'),
    'arguments' => array(
      'taxonomy_term' => array(
        'type' => 'taxonomy_term',
        'label' => t('Taxonomy term'),
      ),
    ),
    'module' => 'Taxonomy',
  );
  $info['rules_action_taxonomy_term_assign_to_content'] = array(
    'label' => t('Assign a term to content'),
    'arguments' => array(
      'node' => array(
        'type' => 'node',
        'label' => t('Content'),
      ),
      'taxonomy_term' => array(
        'type' => 'taxonomy_term',
        'label' => t('Taxonomy term'),
      ),
    ),
    'module' => 'Taxonomy',
  );
  $info['rules_action_taxonomy_term_remove_from_content'] = array(
    'label' => t('Remove a term from content'),
    'arguments' => array(
      'node' => array(
        'type' => 'node',
        'label' => t('Content'),
      ),
      'taxonomy_term' => array(
        'type' => 'taxonomy_term',
        'label' => t('Taxonomy term'),
      ),
    ),
    'module' => 'Taxonomy',
  );

  // Vocabulary actions.
  $info['rules_action_taxonomy_load_vocab'] = array(
    'label' => t('Load a vocabulary'),
    'new variables' => array(
      'taxonomy_vocab' => array(
        'type' => 'taxonomy_vocab',
        'label' => t('Taxonomy vocabulary'),
      ),
    ),
    'eval input' => array(
      'vocabulary|vocab_text',
    ),
    'help' => t('Loading a taxonomy vocabulary will allow you to act on this vocabulary.'),
    'module' => 'Taxonomy',
  );
  $info['rules_action_taxonomy_add_vocab'] = array(
    'label' => t('Add a new vocabulary'),
    'new variables' => array(
      'taxonomy_vocab' => array(
        'type' => 'taxonomy_vocab',
        'label' => t('Taxonomy vocabulary'),
      ),
    ),
    'eval input' => array(
      'name',
      'description',
      'help',
    ),
    'module' => 'Taxonomy',
  );
  return $info;
}