You are here

function _civicrm_entity_enabled_entities in CiviCRM Entity 7.2

Same name and namespace in other branches
  1. 7 civicrm_entity.module \_civicrm_entity_enabled_entities()

Whitelist of enabled entities. We don't have a compelling reason for not including all entities but some entities are fairly non-standard and of course the rule hook would instantiate rules more often if all were enabled.

The whitelist approach is mostly out of caution

Return value

array of enabled entities keyed by the drupal entity name

22 calls to _civicrm_entity_enabled_entities()
CivicrmEntityUIController::hook_menu in ./civicrm_entity_ui_controller.inc
Provides definitions for implementing hook_menu().
civicrm_entity_actions_action_info in modules/civicrm_entity_actions/civicrm_entity_actions.module
Implements hook_action_info().
civicrm_entity_actions_activity_assign_action_form in modules/civicrm_entity_actions/civicrm_entity_actions_activity.inc
civicrm_entity_civicrm_post in ./civicrm_entity.module
Implement the post hook and fire the corresponding rules event.
civicrm_entity_civicrm_pre in ./civicrm_entity.module
Implement the pre hook and delete Drupal field data when civicrm deletes an entity.

... See full list

2 string references to '_civicrm_entity_enabled_entities'
civicrm_entity_rules_action_info in ./civicrm_entity.rules.inc
Implements hook_rules_action_info().
civicrm_entity_rules_condition_info in ./civicrm_entity.rules.inc
Implements hook_rules_condition_info().

File

./civicrm_entity.module, line 2027

Code

function _civicrm_entity_enabled_entities() {
  $available_entities = _civicrm_entity_available_entities();
  $available_entities_option_set = _civicrm_entity_available_entities_get_option_set($available_entities);
  $selected_entities = variable_get('civicrm_entity_admin_enabled_entities', $available_entities_option_set);
  $enabled_entities = array();
  foreach ($available_entities as $entity_type => $api_entity) {
    if (!empty($selected_entities[$entity_type])) {
      $enabled_entities[$entity_type] = $api_entity;
    }
  }
  return $enabled_entities;
}