You are here

function panelizer_view_mode_extra_field_displays in Panelizer 7.3

Check whether a view mode uses core display of fields and panelizer.

Return value

bool Whether or not a bundle/view_mode is panelized and has fields displaying through core settings.

2 calls to panelizer_view_mode_extra_field_displays()
panelizer_form_field_ui_display_overview_form_alter in ./panelizer.module
Implements hook_form_FORM_ID_alter().
panelizer_requirements in ./panelizer.install
Implements hook_requirements().

File

./panelizer.install, line 310
Install, update and uninstall functions for the panelizer module.

Code

function panelizer_view_mode_extra_field_displays($entity_type, $bundle, $view_mode) {
  $handler = panelizer_entity_plugin_get_handler($entity_type);
  if (panelizer_is_panelized($handler, $bundle, $view_mode)) {
    $bundle = field_extract_bundle($entity_type, $bundle);
    $instances = field_info_instances($entity_type, $bundle);

    // @todo, handle extra fields.
    // field_info_extra_fields($entity_type, $bundle, 'display');
    // Look through all the fields and look for fields that aren't hidden.
    // As soon as one is found, end this function. Finding any non-hidden
    // fields is the point of this function.
    foreach ($instances as $instance) {
      if (!empty($instance['display'][$view_mode]['type']) && $instance['display'][$view_mode]['type'] !== 'hidden') {
        return TRUE;
      }
    }
  }
  return FALSE;
}