You are here

og_vocab.rules.inc in OG Vocabulary 6

Rules integration for the og_vocab module.

File

og_vocab.rules.inc
View source
<?php

/**
 * @file
 * Rules integration for the og_vocab module.
 */

/**
 * Implementation of hook_rules_action_info().
 */
function og_vocab_rules_action_info() {
  $items['og_vocab_rules_action_assign_vocab'] = array(
    'label' => t('Assign vocabulary to group'),
    'arguments' => array(
      'group' => array(
        'type' => 'node',
        'label' => t('Group'),
      ),
      'taxonomy_vocab' => array(
        'type' => 'taxonomy_vocab',
        'label' => t('Taxonomy vocabulary that will be assigned to group'),
      ),
    ),
    'module' => 'Organic groups vocabulary',
  );
  $items['og_vocab_rules_action_remove_vocab'] = array(
    'label' => t('Remove vocabulary from group'),
    'arguments' => array(
      'taxonomy_vocab' => array(
        'type' => 'taxonomy_vocab',
        'label' => t('Taxonomy vocabulary that will removed from group'),
      ),
    ),
    'module' => 'Organic groups vocabulary',
  );
  $items['og_vocab_rules_action_remove_all_group'] = array(
    'label' => t('Remove all vocabulary from group'),
    'arguments' => array(
      'group' => array(
        'type' => 'node',
        'label' => t('Group'),
      ),
    ),
    'module' => 'Organic groups vocabulary',
  );
  return $items;
}

/**
 * Action: Assign vocabulary to group.
 */
function og_vocab_rules_action_assign_vocab($node, $vocab, $settings) {
  og_vocab_write_record($node->nid, $vocab->vid);
}

/**
 * Action: Remove vocabulary from group.
 */
function og_vocab_rules_action_remove_vocab($vocab, $settings) {
  og_vocab_remove_record($vocab->vid);
}

/**
 * Action: Remove vocabulary from group.
 */
function og_vocab_rules_action_remove_all_group($node, $settings) {
  og_vocab_remove_all_records($node->nid);
}

Functions

Namesort descending Description
og_vocab_rules_action_assign_vocab Action: Assign vocabulary to group.
og_vocab_rules_action_info Implementation of hook_rules_action_info().
og_vocab_rules_action_remove_all_group Action: Remove vocabulary from group.
og_vocab_rules_action_remove_vocab Action: Remove vocabulary from group.