You are here

function redhen_contact_entity_info_alter in RedHen CRM 7

Implements hook_entity_info_alter().

We are adding the info about the contact types via a hook to avoid a recursion issue as loading the model types requires the entity info as well.

File

modules/redhen_contact/redhen_contact.module, line 105
Module file for RedHen contacts.

Code

function redhen_contact_entity_info_alter(&$entity_info) {

  // @todo: Testing to ensure the schema exists; needed because running gui
  // install profile was hitting this BEFORE the schema was installed.
  if (drupal_get_schema('redhen_contact')) {
    foreach (redhen_contact_get_types() as $type => $info) {
      $entity_info['redhen_contact']['bundles'][$type] = array(
        'label' => $info->label,
        'admin' => array(
          'path' => 'admin/structure/redhen/contact_types/manage/%redhen_contact_type',
          'real path' => 'admin/structure/redhen/contact_types/manage/' . $type,
          'bundle argument' => 5,
          'access arguments' => array(
            'administer redhen_contact types',
          ),
        ),
      );
    }
  }
}