You are here

function slick_get_fc_fields in Slick Carousel 7.2

Gets a list of fields in the Field collection item.

1 call to slick_get_fc_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 351
Contains optional functions called only if needed by admin pages.

Code

function slick_get_fc_fields($instance, $field_types) {
  $options = array();
  $fields = field_info_fields();
  $bundle = 'field_collection_item';
  $bundle_instance = $instance['field_name'];
  foreach ($fields as $name => $field) {
    $infos = field_info_instance($bundle, $name, $bundle_instance);
    if ($field_types == '_all') {
      $options[$name] = $infos['label'];
    }
    else {
      if (in_array($bundle, array_keys($field['bundles'])) && in_array($bundle_instance, $field['bundles'][$bundle]) && in_array($field['type'], $field_types)) {
        $options[$name] = $infos['label'];
      }
    }
  }
  return $options;
}