function token_custom_page in Custom Tokens 5
Callbacks
1 string reference to 'token_custom_page'
- token_custom_menu in ./
token_custom.module - Implementation of hook_menu().
File
- ./
token_custom.module, line 130
Code
function token_custom_page() {
$result = db_query("SELECT * FROM {token_custom}");
$headers = array();
$headers[] = t('Token ID');
$headers[] = t('Description');
$headers[] = t('Type');
$headers[] = t('Demo (if available)');
$headers[] = '';
$rows = array();
while ($row = db_fetch_object($result)) {
$r = array();
$r[] = $row->id;
$r[] = $row->description;
$r[] = $row->type;
$text = "[{$row->id}]";
switch ($row->type) {
case 'user':
global $user;
$r[] = token_replace($text, $row->type, $user);
break;
default:
$r[] = token_replace($text, $row->type);
break;
}
$r[] = l('edit', 'admin/build/tokens/edit/' . $row->tkid);
$rows[] = $r;
}
$demo_notes = t('<p>Available demos and notes:<ul><li>Global</li><li>User: Using your current user</li></ul></p>');
return $demo_notes . theme('table', $headers, $rows);
}