You are here

function webform_rules_token_info in Webform Rules 7

Implements hook_token_info().

File

./webform_rules.module, line 156
Adds rules integration for webform submissions.

Code

function webform_rules_token_info() {
  $types['webform'] = array(
    'name' => t('Webform data'),
    'description' => t('Tokens related to data submitted by webforms.'),
  );
  $webform['sid'] = array(
    'name' => t('Submission Id'),
    'description' => t('The unique identifier of the submission.'),
  );
  $webform['data'] = array(
    'name' => t('Submitted data'),
    'description' => t('The submitted webform data.'),
  );
  $webform['data-raw'] = array(
    'name' => t('Raw submitted data'),
    'description' => t('The unfiltered submitted webform data.'),
  );
  $webform['{component}-title'] = array(
    'name' => t('Component title'),
    'description' => t('The title of the selected component, e.g. "email-title".'),
  );
  $webform['{component}-value'] = array(
    'name' => t('Component value'),
    'description' => t('The value of the selected component, e.g. "email-value".'),
  );
  $webform['{component}-value-html'] = array(
    'name' => t('Component value as html'),
    'description' => t('The value of the selected component rendered as html, e.g. "email-value-html".'),
  );
  $webform['{component}-value-raw'] = array(
    'name' => t('Raw component value'),
    'description' => t('The raw value of the selected component, e.g. "email-value-raw". However this is not cleaned up by check_plain(). This is raw user input so take care if you use this somewhere else.'),
  );
  $webform['{component}-display'] = array(
    'name' => t('Component display'),
    'description' => t('Title and value of the selected component, e.g. "email-display".'),
  );
  $webform['{component}-display-html'] = array(
    'name' => t('Component display as html'),
    'description' => t('Title and value of the selected component rendered as html, e.g. "email-display-html".'),
  );
  return array(
    'types' => $types,
    'tokens' => array(
      'webform' => $webform,
    ),
  );
}