You are here

function voting_rules_rules_condition_info in Voting Rules 7

Same name and namespace in other branches
  1. 6 voting_rules.rules.inc \voting_rules_rules_condition_info()

Implements hook_rules_condition_info().

File

./voting_rules.rules.inc, line 216
Provides Rules integration for the Voting API module.

Code

function voting_rules_rules_condition_info() {
  return array(
    'voting_rules_condition_check_vote_value' => array(
      'label' => t('Check the value of the vote'),
      'named parameter' => TRUE,
      'parameter' => array(
        'vote' => array(
          'label' => t('Vote'),
          'description' => t('The vote.'),
          'type' => 'vote',
        ),
        'operator' => array(
          'type' => 'text',
          'label' => t('Operator'),
          'description' => t('The comparison operator.'),
          'optional' => TRUE,
          'default value' => '==',
          'options list' => 'voting_rules_condition_operator_options',
          'restriction' => 'input',
        ),
        'value' => array(
          'type' => 'text',
          'label' => t('Data value'),
          'description' => t('The value to compare the data with.'),
        ),
      ),
      'group' => t('Voting API'),
    ),
    'voting_rules_condition_check_results' => array(
      'label' => t('Evaluate the results of a vote'),
      'named parameter' => TRUE,
      'parameter' => array(
        'vote_results' => array(
          'label' => t('Vote results'),
          'description' => t('The vote results.'),
          'type' => 'vote_results',
        ),
        'function' => array(
          'type' => 'text',
          'label' => t('Function'),
          'description' => t('The function used to compute the value.'),
          'default value' => 'sum',
          'options list' => 'voting_rules_condition_function_options',
          'restriction' => 'input',
        ),
        'operator' => array(
          'type' => 'text',
          'label' => t('Operator'),
          'description' => t('The comparison operator.'),
          'default value' => '==',
          'options list' => 'voting_rules_condition_operator_options',
          'restriction' => 'input',
        ),
        'value' => array(
          'type' => 'text',
          'label' => t('Data value'),
          'description' => t('The value to compare the data with.'),
        ),
      ),
      'group' => t('Voting API'),
    ),
  );
}