You are here

function field_collection_get_operations in Field collection 7

Returns an array of enabled operations.

2 calls to field_collection_get_operations()
field_collection_field_formatter_settings_summary in ./field_collection.module
Implements hook_field_formatter_settings_summary().
field_collection_field_formatter_view in ./field_collection.module
Implements hook_field_formatter_view().

File

./field_collection.module, line 1133
Module implementing field collection field type.

Code

function field_collection_get_operations($settings, $add = FALSE) {
  $operations = array();
  if ($add) {
    $operations[] = 'add';
  }
  $operations[] = 'edit';
  if (field_collection_item_is_translatable()) {
    $operations[] = 'translate';
  }
  $operations[] = 'delete';
  global $field_collection_operation_keys;
  $field_collection_operation_keys = array_flip($operations);
  $operations = array_filter(array_intersect_key($settings, $field_collection_operation_keys));
  asort($operations);
  return $operations;
}