You are here

function commerce_file_rules_condition_info in Commerce File 7

Implements hook_rules_condition_info().

File

./commerce_file.rules.inc, line 79
Provides Rules integration for entities provided via the CRUD API.

Code

function commerce_file_rules_condition_info() {
  $group = _commerce_file_translatables('license_label');
  $license_label = $group;
  $conditions = array();
  $conditions['commerce_file_license_condition_address_exists'] = array(
    'label' => t("User's current IP address has been used to access the licensed file"),
    'parameter' => array(
      'license' => array(
        'type' => COMMERCE_FILE_LICENSE_ENTITY_NAME,
        'label' => $license_label,
        'restriction' => 'selector',
      ),
    ),
    'group' => $group,
    'callbacks' => array(
      'execute' => 'commerce_file_license_rules_condition_address_exists',
    ),
  );
  $conditions['commerce_file_license_condition_limit_is_unlimited'] = array(
    'label' => t("Determine if a limit value is unlimited"),
    'parameter' => array(
      'value' => array(
        'type' => 'text',
        'label' => t('Value'),
        'description' => t('The limit value of the license to compare.'),
        'restriction' => 'selector',
      ),
    ),
    'group' => $group,
    'callbacks' => array(
      'execute' => 'commerce_file_license_rules_condition_limit_is_unlimited',
    ),
  );
  return $conditions;
}