You are here

function ip2country_rules_condition_info in IP-based Determination of a Visitor's Country 7

Implements hook_rules_condition_info().

File

./ip2country.rules.inc, line 15
Rules integration for the ip2country module.

Code

function ip2country_rules_condition_info() {
  $conditions = array();
  $conditions['ip2country_user_country'] = array(
    'label' => t('User is in country (based on IP address)'),
    'group' => t('User'),
    'parameter' => array(
      'countries' => array(
        'label' => t('Countries'),
        'type' => 'list<text>',
        'options list' => 'country_get_list',
        'restriction' => 'input',
      ),
    ),
    'callbacks' => array(
      'execute' => 'ip2country_user_country',
      'help' => 'ip2country_user_country_help',
    ),
  );
  return $conditions;
}