You are here

function redhen_org_entity_info_alter in RedHen CRM 7

Implements hook_entity_info_alter().

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

File

modules/redhen_org/redhen_org.module, line 89

Code

function redhen_org_entity_info_alter(&$entity_info) {

  // We're 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_org')) {
    foreach (redhen_org_get_types() as $type => $info) {
      $entity_info['redhen_org']['bundles'][$type] = array(
        'label' => $info->label,
        'admin' => array(
          'path' => 'admin/structure/redhen/org_types/manage/%redhen_org_type',
          'real path' => 'admin/structure/redhen/org_types/manage/' . $type,
          'bundle argument' => 5,
          'access arguments' => array(
            'administer redhen_org types',
          ),
        ),
      );
    }
  }
}