You are here

function entityform_tokens in Entityform 7.2

Same name and namespace in other branches
  1. 7 entityform.module \entityform_tokens()

Implements hook_tokens().

File

./entityform.tokens.inc, line 29
Token related hooks.

Code

function entityform_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $return = array();
  if ($type == 'entityform_type' && !empty($data['entityform_type'])) {
    $entityform_type = $data['entityform_type'];
    foreach ($tokens as $name => $original) {
      switch ($name) {
        case 'submit_url':
          $return[$original] = url(_entityform_type_get_submit_url($entityform_type->type), array(
            'absolute' => TRUE,
          ));
          break;
      }
    }
  }
  return $return;
}