You are here

function opigno_rules_action_info in Opigno 7

File

./opigno.rules.inc, line 47

Code

function opigno_rules_action_info() {
  $items = array();
  $items['opigno_load_og_membership'] = array(
    'label' => t("Load OG Membership"),
    'group' => t('Organic groups'),
    'parameter' => array(
      'user' => array(
        'type' => 'user',
        'label' => t('User'),
        'description' => t('The user who get the role'),
      ),
      'group' => array(
        'type' => array_keys(og_get_all_group_entity()),
        'label' => t('Group'),
        'wrapped' => TRUE,
      ),
    ),
    'provides' => array(
      'og_membership' => array(
        'type' => 'og_membership',
        'label' => t('OG Membership'),
      ),
    ),
    'base' => 'opigno_load_og_membership',
  );
  $items['opigno_load_og_user_roles'] = array(
    'label' => t("Load OG User Roles"),
    'group' => t('Organic groups'),
    'parameter' => array(
      'group_type' => array(
        'type' => 'text',
        'label' => t('Group type'),
        'description' => t('The entity type of the group.'),
      ),
      'gid' => array(
        'type' => 'integer',
        'label' => t('Group id'),
        'description' => t(' The group ID'),
      ),
      'uid' => array(
        'type' => 'integer',
        'label' => t('User id'),
        'description' => t('The user id'),
      ),
      'include' => array(
        'type' => 'boolean',
        'label' => t('Include or not the anonymous and authenticated role'),
        'description' => t('Both anonymous or authenticated role ID will be returned.'),
      ),
    ),
    'provides' => array(
      'og_roles' => array(
        'type' => 'list<integer>',
        'label' => t('OG roles'),
      ),
    ),
    'base' => 'opigno_load_og_user_roles',
  );
  $items['og_revoke_og_role_to_user'] = array(
    'label' => t('Revoke user a og role'),
    'group' => t('Organic groups'),
    'parameter' => array(
      'role' => array(
        'type' => 'text',
        'label' => t('Role'),
        'description' => t('The role to be removed'),
      ),
      'user' => array(
        'type' => 'user',
        'label' => t('User'),
        'description' => t('The user who get the role'),
      ),
      'group' => array(
        'type' => array_keys(og_get_all_group_entity()),
        'label' => t('Group'),
        'wrapped' => TRUE,
      ),
    ),
    'base' => 'opigno_rules_revoke_role_to_user',
    'access callback' => 'og_rules_integration_access',
  );
  $items['og_give_og_role_to_user'] = array(
    'label' => t('Give user a og role'),
    'group' => t('Organic groups'),
    'parameter' => array(
      'role' => array(
        'type' => 'text',
        'label' => t('Role'),
        'description' => t('The role to add'),
      ),
      'user' => array(
        'type' => 'user',
        'label' => t('User'),
        'description' => t('The user who get the role'),
      ),
      'group' => array(
        'type' => array_keys(og_get_all_group_entity()),
        'label' => t('Group'),
        'wrapped' => TRUE,
      ),
    ),
    'base' => 'opigno_rules_add_role_to_user',
    'access callback' => 'og_rules_integration_access',
  );
  return $items;
}