You are here

function ds_entity_view_modes in Display Suite 7

Same name and namespace in other branches
  1. 7.2 ds.module \ds_entity_view_modes()

Get entity view modes.

Parameters

$entity_type: The name of the entity type.

7 calls to ds_entity_view_modes()
ds_edit_view_mode_form_validate in ./ds.view_modes.inc
Validates the view mode submission form generated by ds_edit_view_mode_form().
ds_extras_ds_field_settings_form in modules/ds_extras/ds_extras.admin.inc
Implements hook_ds_field_settings_form().
ds_extras_form_node_form_alter in modules/ds_extras/ds_extras.module
Implements hook_form_FORM_ID_alter().
ds_extras_get_bundle_view_modes in modules/ds_extras/ds_extras.module
Get view modes for an entity bundle.
ds_field_formatter_info in ./ds.module
Implements hook_field_formatter_info().

... See full list

File

./ds.module, line 414
Display Suite core functions.

Code

function ds_entity_view_modes($entity_type = NULL) {
  if (!empty($entity_type)) {
    switch ($entity_type) {

      // For taxonomy terms the base table and the entity type are different
      case 'taxonomy_term_data':
        $entity_info = entity_get_info('taxonomy_term');
        break;
      default:
        $entity_info = entity_get_info($entity_type);
        break;
    }
    return $entity_info['view modes'];
  }
}