You are here

function commerce_file_commerce_file_license_info in Commerce File 7

Implements hook_commerce_file_license_info().

File

./commerce_file.commerce.inc, line 12
Implementations of Commerce Hooks

Code

function commerce_file_commerce_file_license_info() {
  return array(
    'duration' => array(
      'name' => 'duration',
      'title' => t('Duration'),
      'base_element' => array(
        '#type' => 'commerce_file_limit_duration',
        '#title' => t('Access duration'),
      ),
      'property info' => array(
        'type' => 'duration',
        'label' => t('The license duration'),
        'description' => t('The amount time that this file is allowed to be downloaded.'),
        'default_value' => COMMERCE_FILE_FIELD_UNLIMITED,
      ),
      'callbacks' => array(
        'check_access' => '_commerce_file_license_property_duration_check_access',
        'current' => '_commerce_file_license_property_duration_current',
        'remaining' => '_commerce_file_license_property_duration_remaining',
      ),
    ),
    'download_limit' => array(
      'name' => 'download_limit',
      'title' => t('Download Limit'),
      'base_element' => array(
        '#type' => 'commerce_file_limit_integer',
        '#title' => t('# of Downloads'),
      ),
      'property info' => array(
        'type' => 'integer',
        'label' => t('The number of downloads allowed'),
        'description' => t('The number of downloads allowed for this file.'),
        'default_value' => 10,
      ),
      'callbacks' => array(
        'check_access' => '_commerce_file_license_property_downloads_check_access',
        'current' => '_commerce_file_license_property_downloads_current',
        'remaining' => '_commerce_file_license_property_downloads_remaining',
      ),
    ),
    'address_limit' => array(
      'name' => 'address_limit',
      'title' => t('IP Address Limit'),
      'base_element' => array(
        '#type' => 'commerce_file_limit_integer',
        '#title' => t('# of IP Addresses'),
      ),
      'property info' => array(
        'type' => 'integer',
        'label' => t('The number of IP addresses allowed'),
        'description' => t('The number of IP addresses allowed to be used by a single user to access this file.'),
        'default_value' => 2,
      ),
      'callbacks' => array(
        'check_access' => '_commerce_file_license_property_ip_check_access',
        'current' => '_commerce_file_license_property_ip_current',
        'remaining' => '_commerce_file_license_property_ip_remaining',
      ),
    ),
  );
}