You are here

function ds_extras_get_bundle_view_modes in Display Suite 7

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

Get view modes for an entity bundle.

1 call to ds_extras_get_bundle_view_modes()
ds_extras_node_page_view in modules/ds_extras/ds_extras.pages.inc
Menu callback: show an individual node with the Switch field.

File

modules/ds_extras/ds_extras.module, line 522
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;
}