You are here

function forward_entity_info_alter in Forward 7.3

Same name and namespace in other branches
  1. 7 forward.module \forward_entity_info_alter()
  2. 7.2 forward.module \forward_entity_info_alter()

Implements hook_entity_info_alter().

File

./forward.module, line 946
Allows forwarding of entities by email, and provides a record of how often each has been forwarded.

Code

function forward_entity_info_alter(&$entity_info) {
  if (variable_get('forward_custom_viewmode', FALSE)) {

    // Add a custom view mode named Forward to the entity type
    // This is then used to build the message body instead of the full or teaser views
    foreach ($entity_info as $type => $info) {
      if (!empty($info['view modes'])) {
        $entity_info[$type]['view modes']['forward'] = array(
          'label' => t('Forward'),
          'custom settings' => TRUE,
        );
      }
    }
  }
}