You are here

function _workflow_rules_rules_field_condition_info in Workflow 7

Implements subfunction of hook_rules_condition_info(). Using "node:" and "node:unchanged", there is no need to create more conditions to check transitions.

1 call to _workflow_rules_rules_field_condition_info()
workflow_rules_rules_condition_info in workflow_rules/workflow_rules.rules.inc
Implements hook_rules_condition_info().

File

workflow_rules/workflow_rules.field.inc, line 29
Rules integration for the Workflow module with Entity API

Code

function _workflow_rules_rules_field_condition_info() {
  $conditions = array();
  $conditions['workflow_rules_field_check_state'] = array(
    'group' => t('Workflow'),
    'label' => t('Workflow Field state comparison'),
    'parameter' => array(
      'field' => array(
        'type' => WORKFLOW_FIELD_PROPERTY_TYPE,
        'label' => t('Workflow state to compare'),
        'description' => t('The state to be compared. Use "node:" to compare the previous state, use "node-unchanged:" to compare the new state.'),
        'restriction' => 'selector',
      ),
      'sid' => array(
        'type' => 'list<integer>',
        'label' => t('Workflow state'),
        'options list' => '_workflow_rules_workflow_get_options',
        'description' => t('The workflow state value.'),
      ),
    ),
    'base' => '_workflow_rules_workflow_check_given_state',
    'callbacks' => array(
      'execute' => '_workflow_rules_workflow_check_given_state',
    ),
  );
  return $conditions;
}