You are here

function paragraphs_pack_get_field_image in Paragraphs pack 7

Get/Create image field.

This field can be used only on paragraph entity type.

Parameters

string $uri_scheme: A name of a scheme (private/public).

Return value

array An array containing field values.

1 call to paragraphs_pack_get_field_image()
paragraphs_pack_add_field_image in includes/paragraphs_pack.fields_crud.inc
Adds image field to a paragraph bundle.

File

includes/paragraphs_pack.fields_crud.inc, line 382
Fields CRUD functions.

Code

function paragraphs_pack_get_field_image($uri_scheme = '') {
  $field = _paragraphs_pack_get_field(array(
    'field_name' => PP_FIELD_IMAGE,
    'type' => 'image',
    'entity_types' => array(
      PP_PARAGRAPH_TYPE,
    ),
    'cardinality' => FIELD_CARDINALITY_UNLIMITED,
    'settings' => array(
      'uri_scheme' => variable_get('file_default_scheme', 'public'),
    ),
  ));
  if (!empty($uri_scheme)) {
    $field['settings']['uri_scheme'] = $uri_scheme;
  }
  return $field;
}