You are here

function commerce_file_license_issue_by_host_form_id in Commerce File 7

Builds an appropriate issue license form ID based on the entity on the form.

See also

commerce_file_forms().

2 calls to commerce_file_license_issue_by_host_form_id()
commerce_file_handler_area_license_issue_order_form::render in views/handlers/commerce_file_handler_area_license_issue_order_form.inc
Render the area.
commerce_file_handler_field_license_issue_line_item_form::render in views/handlers/commerce_file_handler_field_license_issue_line_item_form.inc
Render the field.

File

./commerce_file.module, line 662
Provides integration of file licenses with Commerce

Code

function commerce_file_license_issue_by_host_form_id($entity_type, array $host_ids = array()) {
  if (empty($host_ids)) {
    return 'commerce_file_license_issue_by_host_form_' . $entity_type;
  }

  // Make sure the length of the form id is limited.
  $data = implode('_', $host_ids);
  if (strlen($data) > 50) {
    $data = drupal_hash_base64($data);
  }
  return 'commerce_file_license_issue_by_host_form_' . $entity_type . '_' . $data;
}