You are here

function og_rules_event_info in Organic groups 7.2

Same name and namespace in other branches
  1. 6.2 includes/og.rules.inc \og_rules_event_info()
  2. 6 includes/og.rules.inc \og_rules_event_info()
  3. 7 og.rules.inc \og_rules_event_info()

Implementation of hook_rules_event_info().

Adds some additional event that make reacting on user subscriptions easier.

File

./og.rules.inc, line 16
Rules integration for the Organic groups module.

Code

function og_rules_event_info() {
  $defaults = array(
    'variables' => array(
      'og_membership' => array(
        'type' => 'og_membership',
        'label' => t("The user's OG membership"),
      ),
      'account' => array(
        'type' => 'user',
        'label' => t('User'),
      ),
    ),
    'group' => t('OG membership'),
  );
  return array(
    'og_user_insert' => $defaults + array(
      'label' => t('User has become a group member'),
      'help' => t("A user has become a group member, but might have been not yet approved."),
    ),
    'og_user_approved' => $defaults + array(
      'label' => t('User membership has been approved'),
    ),
    'og_user_blocked' => $defaults + array(
      'label' => t('User membership has been blocked'),
    ),
    'og_user_delete' => $defaults + array(
      'label' => t('User has been removed from group'),
      'help' => t("A user has been removed from group and is no longer a group member."),
    ),
    'og_role_grant' => array_merge_recursive($defaults, array(
      'label' => t('OG role granted to user'),
      'help' => t("An OG role has been granted to this user."),
      'variables' => array(
        'og_rid' => array(
          'type' => 'integer',
          'label' => t('OG role ID'),
          'description' => t('The id of the OG user role.'),
        ),
      ),
    )),
    'og_role_revoke' => array_merge_recursive($defaults, array(
      'label' => t('OG role revoked from user'),
      'help' => t("An OG role has been revoked from this user."),
      'variables' => array(
        'og_rid' => array(
          'type' => 'integer',
          'label' => t('OG role ID'),
          'description' => t('The id of the OG user role.'),
        ),
      ),
    )),
  );
}