You are here

function ds_extras_get_bundle_view_modes in Display Suite 7.2

Same name and namespace in other branches
  1. 7 modules/ds_extras/ds_extras.module \ds_extras_get_bundle_view_modes()

Get view modes for an entity bundle.

3 calls to ds_extras_get_bundle_view_modes()
ds_extras_form_node_form_alter in modules/ds_extras/ds_extras.module
Implements hook_form_FORM_ID_alter().
ds_extras_form_node_type_form_alter in modules/ds_extras/ds_extras.module
Implements hook_form_FORM_ID_alter().
ds_extras_node_page_view in modules/ds_extras/includes/ds_extras.pages.inc
Menu callback: show an individual node with the Switch field.

File

modules/ds_extras/ds_extras.module, line 451
Display Suite extras main functions.

Code

function ds_extras_get_bundle_view_modes($type, $bundle) {
  $view_modes = array(
    'default' => t('Default'),
  );
  $view_mode_settings = field_view_mode_settings($type, $bundle);
  $ds_vm = ds_entity_view_modes($type);
  foreach ($ds_vm as $key => $item) {
    $overriden = !empty($view_mode_settings[$key]['custom_settings']) ? TRUE : FALSE;
    if ($overriden) {
      $view_modes[$key] = $item['label'];
    }
  }
  return $view_modes;
}