function field_test_entity_view_mode_info_alter

Implements hook_entity_view_mode_info_alter().

File

drupal/core/modules/field/tests/modules/field_test/field_test.entity.inc, line 34
Defines an entity type.

Code

function field_test_entity_view_mode_info_alter(&$view_modes) {
  $entity_info = entity_get_info();
  foreach ($entity_info as $entity_type => $info) {
    if ($entity_info[$entity_type]['module'] == 'field_test') {
      $view_modes[$entity_type] = array(
        'full' => array(
          'label' => t('Full object'),
          'status' => TRUE,
        ),
        'teaser' => array(
          'label' => t('Teaser'),
          'status' => TRUE,
        ),
      );
    }
  }
}