You are here

function webform_workflow_token_info in Webform Workflow 7

Implements hook_token_info().

File

./webform_workflow.tokens.inc, line 11
Builds placeholder replacement tokens for webform_workflow-related data.

Code

function webform_workflow_token_info() {
  $info = array();
  $info['types']['webform-workflow-transition'] = array(
    'name' => t('Workflow state transition'),
    'description' => t('A transition between two states.'),
    'needs-data' => 'webform-workflow-transition',
  );
  $info['tokens']['webform-workflow-transition']['previous-state'] = array(
    'name' => t('Previous state'),
    'description' => t('The previous workflow state.'),
    'type' => 'webform_workflow_state',
  );
  $info['tokens']['webform-workflow-transition']['new-state'] = array(
    'name' => t('New state'),
    'description' => t('The new workflow state.'),
    'type' => 'webform_workflow_state',
  );
  $info['tokens']['webform-workflow-transition']['timestamp'] = array(
    'name' => t('Timestamp'),
    'description' => t('The date and time of the state change.'),
    'type' => 'date',
  );
  $info['tokens']['webform-workflow-transition']['user'] = array(
    'name' => t('User'),
    'description' => t('The user who made the state change.'),
    'type' => 'user',
  );
  $info['tokens']['webform-workflow-transition']['message'] = array(
    'name' => t('Log message'),
    'description' => t('The log message entered for the transition.'),
  );
  $info['tokens']['submission']['state'] = array(
    'name' => t('Workflow state'),
    'description' => t('The current workflow state for this submission.'),
    'type' => 'webform_workflow_state',
  );
  return $info;
}