You are here

function workflow_rules_check_state_label in Workflow 6.2

Same name and namespace in other branches
  1. 6 workflow_rules/workflow_rules.module \workflow_rules_check_state_label()

Label callback for check state condition.

File

workflow_rules/workflow_rules.module, line 199
Rules integration for the Workflow module

Code

function workflow_rules_check_state_label($settings, $argument_labels) {
  if (in_array('ANY', $settings['state'])) {
    $settings['state'] = array(
      'ANY',
    );
  }
  $states = array();
  foreach ($settings['state'] as $state) {
    if ($state != 'ANY') {
      $temp = workflow_get_state($state);
      $states[] = $temp['state'];
    }
    else {
      $states[] = t('Any state');
    }
  }
  return t('Check if content workflow state is @state', array(
    '@state' => implode(', ', $states),
  ));
}