You are here

protected function D6Webform::replaceTokens in Webform: Migrate 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/migrate/source/d6/D6Webform.php \Drupal\webform_migrate\Plugin\migrate\source\d6\D6Webform::replaceTokens()

Translate webform tokens into regular tokens.

%uid - The user id (unsafe) %username - The name of the user if logged in. Blank for anonymous users. (unsafe) %useremail - The e-mail address of the user if logged in. Blank for anonymous users. (unsafe) %ip_address - The IP address of the user. (unsafe) %site - The name of the site (i.e. Northland Pioneer College, Arizona) (safe) %date - The current date, formatted according to the site settings.(safe) %nid - The node ID. (safe) %title - The node title. (safe) %sid - The Submission id (unsafe) %submission_url - The Submission url (unsafe) %profile[key] - Any user profile field or value, such as %profile[name] or %profile[profile_first_name] (unsafe) %get[key] - Tokens may be populated from the URL by creating URLs of the form http://example.com/my-form?foo=bar. Using the token %get[foo] would print "bar". (safe) %post[key] - Tokens may also be populated from POST values that are submitted by forms. (safe) %email[key] (unsafe) %value[key] (unsafe) %email_values (unsafe) %cookie[key] (unsafe) %session[key] (unsafe) %request[key] (unsafe) %server[key] (unsafe)

Safe values are available to all users and unsafe values should only be shown to authenticated users.

1 call to D6Webform::replaceTokens()
D6Webform::buildFormElements in src/Plugin/migrate/source/d6/D6Webform.php
Build form elements from webform component table.

File

src/Plugin/migrate/source/d6/D6Webform.php, line 594

Class

D6Webform
Drupal 6 webform source from database.

Namespace

Drupal\webform_migrate\Plugin\migrate\source\d6

Code

protected function replaceTokens($str) {
  return $str;
}