function civicrm_entity_profile_enable in CiviCRM Entity 7.2
Implements hook_enable().
File
- modules/
civicrm_entity_profile/ civicrm_entity_profile.install, line 6
Code
function civicrm_entity_profile_enable() {
$selected_entities = variable_get('civicrm_entity_admin_enabled_entities', array());
$update = FALSE;
$required_entities = array(
'civicrm_event' => 'Event',
'civicrm_uf_field' => 'UF Field',
'civicrm_uf_group' => 'UF Group',
'civicrm_uf_join' => 'UF Join',
);
foreach ($required_entities as $drupal_entity_type => $entity_type_label) {
if (empty($selected_entities[$drupal_entity_type])) {
$update = TRUE;
$selected_entities[$drupal_entity_type] = $drupal_entity_type;
}
}
if ($update) {
variable_set('civicrm_entity_admin_enabled_entities', $selected_entities);
drupal_flush_all_caches();
}
}