You are here

function theme_flag_tokens_browser in Flag 7.3

Same name and namespace in other branches
  1. 8.4 flag.tokens.inc \theme_flag_tokens_browser()
  2. 6.2 includes/flag.token.inc \theme_flag_tokens_browser()
  3. 7.2 flag.tokens.inc \theme_flag_tokens_browser()

Returns HTML for a tokens browser.

Parameters

array $variables: An associative array containing:

  • types: An array naming the types of tokens to show.
  • global_types: Whether to show global tokens.
2 theme calls to theme_flag_tokens_browser()
flag_actions_system_send_email_action_form in ./flag_actions.module
Make modifications to the "Send e-mail" action form.
flag_form in includes/flag.admin.inc
Add/Edit flag page.

File

./flag.tokens.inc, line 214
Flag module tokens support.

Code

function theme_flag_tokens_browser($variables) {
  $types = $variables['types'];
  $global_types = $variables['global_types'];
  if (module_exists('token')) {
    return theme('token_tree', array(
      'token_types' => $types,
      'global_types' => $global_types,
      'dialog' => TRUE,
    ));
  }
  else {
    return '<p><em>' . t("Note: You don't have the <a href='@token-url'>Token</a> module installed, so the list of available tokens isn't shown here. You don't have to install <a href='@token-url'>Token</a> to be able to use tokens, but if you have it installed, and enabled, you'll be able to enjoy an interactive tokens browser.", array(
      '@token-url' => 'http://drupal.org/project/token',
    )) . '</em></p>';
  }
}