You are here

function commerce_file_field_widget_info in Commerce File 7

Implements hook_field_widget_info().

File

includes/commerce_file.field.inc, line 340
Implement an commerce_file field, based on the file module's file field.

Code

function commerce_file_field_widget_info() {
  $base = array(
    'field types' => array(
      'commerce_file',
    ),
    'settings' => array(
      'progress_indicator' => 'throbber',
    ),
    'behaviors' => array(
      'multiple values' => FIELD_BEHAVIOR_CUSTOM,
      'default value' => FIELD_BEHAVIOR_NONE,
    ),
  );

  // set license settings default to inherited
  $license_info = _commerce_file_collate_license_info();
  $base['settings'] += array(
    'data' => array_fill_keys(array_keys($license_info), COMMERCE_FILE_FIELD_INHERIT),
  );

  // return widgets
  return array(
    'commerce_file_generic' => array_merge_recursive($base, array(
      'label' => t('Commerce File'),
    )),
  );
}