You are here

function slick_get_paragraphs_fields in Slick Carousel 7.2

Gets a list of fields in the Paragraphs item.

1 call to slick_get_paragraphs_fields()
_slick_fields_field_formatter_settings_form in slick_fields/includes/slick_fields.formatters.admin.inc
Off-loaded hook_field_formatter_settings_form().

File

includes/slick.admin.inc, line 403
Contains optional functions called only if needed by admin pages.

Code

function slick_get_paragraphs_fields($instance, $bundles, $field_types) {
  $entity_type = 'paragraphs_item';
  $paragraphs_options = array();

  // Add panelizer support.
  if ($instance['entity_type'] == 'ctools') {
    foreach ($bundles as $bundle_type => $types) {
      foreach ($types as $type) {
        $instance = field_info_instance($bundle_type, $instance['field_name'], $type);
        $allowed_bundles = $instance['settings']['allowed_bundles'];
        $paragraphs_options += _slick_get_paragraphs_fields_options($allowed_bundles, $entity_type, $field_types);
      }
    }
  }
  else {
    $allowed_bundles = $instance['settings']['allowed_bundles'];
    $paragraphs_options = _slick_get_paragraphs_fields_options($allowed_bundles, $entity_type, $field_types);
  }
  return $paragraphs_options;
}