You are here

function paragraphs_pack_get_allowed_view_modes in Paragraphs pack 7

Returns the array of allowed view modes for a list field.

Parameters

$instance: The instance information.

Return value

The array of allowed view modes. Keys of the array are view mode ..., values of the array are the display labels.

2 calls to paragraphs_pack_get_allowed_view_modes()
paragraphs_pack_field_validate in includes/paragraphs_pack.fields.inc
Implements hook_field_validate().
paragraphs_pack_options_list in includes/paragraphs_pack.fields.inc
Implements hook_options_list().
1 string reference to 'paragraphs_pack_get_allowed_view_modes'
paragraphs_pack_field_update_field in includes/paragraphs_pack.fields.inc
Implements hook_field_update_field().

File

includes/paragraphs_pack.fields.inc, line 135
Implements custom fields: PP_FIELD_TYPE_VIEW_MODE.

Code

function paragraphs_pack_get_allowed_view_modes($instance) {
  $view_modes =& drupal_static(__FUNCTION__, array());
  if (!isset($view_modes[$instance['id']])) {
    $entity_type = $instance['settings']['entity_type'];
    $view_modes[$instance['id']] = paragraphs_pack_get_entity_type_view_modes($entity_type);
  }
  return $view_modes[$instance['id']];
}