You are here

function _itweak_upload_group_id in iTweak Upload 7.3

2 calls to _itweak_upload_group_id()
itweak_upload_field_formatter_view in ./itweak_upload.module
Implements hook_field_formatter_view().
_itweak_upload_lightbox_get_link_options in ./itweak_upload.module
Retrieve link options - carries handler setting for link display mode.

File

./itweak_upload.module, line 143
iTweakUpload - Tweak attachments display and file upload forms.

Code

function _itweak_upload_group_id($entity_type, $entity) {
  switch ($entity_type) {
    case 'node':
      $group = $entity_type . $entity->nid;
      break;
    case 'comment':
      $group = $entity_type . $entity->cid;
      break;
    default:
      $entity = (array) $entity;
      $keys = array_keys($entity);
      $key = $keys[0];
      $group = $entity_type . $entity[$key];
      break;
  }
  return $group;
}