function civicrm_entity_contact_assign_rel_contact_field_form_civicrm_entity_admin_settings_form_alter in CiviCRM Entity 7.2
Implements hook_form_FORM_ID_alter().
Alter the CiviCRM Entity enabled entities settings form
Insure necessary entity types for this module remain enabled
_state
Parameters
$form:
File
- modules/
civicrm_entity_contact_assign_rel_contact_field/ civicrm_entity_contact_assign_rel_contact_field.module, line 722 - Provide CiviCRM Entity Contact Assign Relationship Contacts List Field Type. Provides a widget for adding/removing a contacts relationships to a list of contacts.
Code
function civicrm_entity_contact_assign_rel_contact_field_form_civicrm_entity_admin_settings_form_alter(&$form, &$form_state) {
$required_entities = array(
'civicrm_contact' => 'Contact',
'civicrm_relationship' => 'Relationship',
);
foreach ($required_entities as $drupal_entity_type => $entity_type_label) {
if (empty($selected_entities[$drupal_entity_type])) {
$form['civicrm_entity_admin_enabled_entities'][$drupal_entity_type]['#disabled'] = TRUE;
$form['civicrm_entity_admin_enabled_entities'][$drupal_entity_type]['#default_value'] = 1;
}
}
$form['#validate'][] = 'civicrm_entity_contact_assign_rel_contact_field_admin_settings_form_validate';
}