theme_token_help($type = 'all', $prefix = '[', $suffix = ']')
contributions/token/token.module, line 23
For a given context, builds a formatted list of tokens and descriptions of their replacement values.
type The token types to display documentation for. Defaults to 'all'.
prefix The prefix your module will use when parsing tokens. Defaults to '['
suffix The suffix your module will use when parsing tokens. Defaults to ']'
An HTML table containing the formatting docs.
<?php
function theme_token_help($type = 'all', $prefix = '[', $suffix = ']') {
token_include();
$full_list = token_get_list($type);
$headers = array(t('Token'), t('Replacement value'));
$rows = array();
foreach ($full_list 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', $headers, $rows, array('class' => 'description'));
return $output;
}
?>