function theme_flag_tokens_browser in Flag 6.2
Same name and namespace in other branches
- 8.4 flag.tokens.inc \theme_flag_tokens_browser()
- 7.3 flag.tokens.inc \theme_flag_tokens_browser()
- 7.2 flag.tokens.inc \theme_flag_tokens_browser()
This is a replacement for Token's theme_token_help().
This is a duplicate of the Token's function, but with a small modification: the $type parameter is now $types, allowing for listing tokens from several categories.
@todo Incorporate this feature into the Token module(?)
2 theme calls to theme_flag_tokens_browser()
- flag_actions_token_actions_send_email_action_form in ./
flag_actions.module - Make modifications to the "Send tokenized e-mail" action form.
- flag_form in includes/
flag.admin.inc - Add/Edit flag page.
File
- includes/
flag.token.inc, line 73 - Flag module tokens support.
Code
function theme_flag_tokens_browser($types = array(
'all',
), $prefix = '[', $suffix = ']') {
token_include();
$tokens = flag_token_get_list($types);
$header = array(
t('Token'),
t('Replacement value'),
);
$rows = array();
foreach ($tokens as $key => $category) {
$rows[] = array(
array(
'data' => drupal_ucfirst($key) . ' ' . t('tokens'),
'class' => 'region',
'colspan' => 2,
),
);
foreach ($category as $token => $description) {
$row = array();
$row[] = $prefix . $token . $suffix;
$row[] = $description;
$rows[] = $row;
}
}
$output = theme('table', $header, $rows, array(
'class' => 'description',
));
return $output;
}