You are here

function theme_webform_token_help in Webform 5.2

Same name and namespace in other branches
  1. 6.3 webform.module \theme_webform_token_help()
  2. 6.2 webform.module \theme_webform_token_help()
  3. 7.4 webform.module \theme_webform_token_help()
  4. 7.3 webform.module \theme_webform_token_help()
8 theme calls to theme_webform_token_help()
webform_component_edit_form in ./webform_components.inc
_webform_edit_email in components/email.inc
Create a set of form items to be displayed on the form for editing this component. Use care naming the form items, as this correlates directly to the database schema. The component "Name" and "Description" fields are added to every…
_webform_edit_grid in components/grid.inc
Create a set of form items to be displayed on the form for editing this component. Use care naming the form items, as this correlates directly to the database schema. The component "Name" and "Description" fields are added to every…
_webform_edit_hidden in components/hidden.inc
Create a set of form items to be displayed on the form for editing this component. Use care naming the form items, as this correlates directly to the database schema. The component "Name" and "Description" fields are added to every…
_webform_edit_markup in components/markup.inc
Create a set of form items to be displayed on the form for editing this component. Use care naming the form items, as this correlates directly to the database schema. The component "Name" and "Description" fields are added to every…

... See full list

File

./webform.module, line 2222

Code

function theme_webform_token_help() {
  $tokens = array(
    '%username',
    '%useremail',
    '%session[' . t('key') . ']',
    '%post[' . t('key') . ']',
    '%request[' . t('key') . ']',
    '%cookie[' . t('key') . ']',
    '%server[' . t('key') . ']',
  );
  if (module_exists('profile')) {
    $tokens[] = '%profile[' . t('key') . ']';
  }
  $anonymous_tokens = array(
    '%site',
    '%date',
    '%get[' . t('key') . ']',
  );
  $output = '';
  $output .= t('You may use special tokens in this field that will be replaced with dynamic values.');
  $output .= theme('item_list', $anonymous_tokens, t('all users:'));
  $output .= theme('item_list', $tokens, t('authorized users only:'));
  $output .= t('You can use %server[key] to add any of the special PHP <a href="http://www.php.net/reserved.variables#reserved.variables.server">$_SERVER</a> variables, %session[key] to add any of the special PHP <a href="http://www.php.net/reserved.variables#reserved.variables.session">$_SESSION</a> variables and %get[key] to create prefilled forms from the <a href="http://www.php.net/reserved.variables#reserved.variables.get">URL</a>. %cookie, %request and %post also work with their respective PHP variables. For example %server[HTTP_USER_AGENT], %session[id], or %get[q].');
  if (module_exists('profile')) {
    $output .= ' ' . t('If you are using the profiles module, you can also access all profile data using the syntax %profile[form_name]. If you for example have a profile value named profile_city, add the variable %profile[profile_city].');
  }
  $fieldset = array(
    '#title' => t('Token values'),
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#children' => '<div>' . $output . '</div>',
  );
  return theme('fieldset', $fieldset);
}