function chado_node_format_tokens
2.x tripal_core.chado_nodes.title_and_path.api.inc | chado_node_format_tokens($tokens) |
3.x tripal_core.chado_nodes.title_and_path.inc | chado_node_format_tokens($tokens) |
Format a set of tokens for consistent display
Parameters
$tokens: An array of tokens from chado_node_generate_tokens()
Return value
HTML displaying the token list
3 calls to chado_node_format_tokens()
- chado_add_admin_form_set_title in tripal_core/
api/ tripal_core.chado_nodes.title_and_path.api.inc - Generic "Set Node Title" sub-form for setting the title of any chado node
- chado_add_admin_form_set_url in tripal_core/
api/ tripal_core.chado_nodes.title_and_path.api.inc - Generic "Set Node URL" sub-form for setting the url of any chado node
- tripal_core_field_widget_form_alter in tripal_core/
tripal_core.module - Adds support for tokens in the field_resource_links field.
File
- tripal_core/
api/ tripal_core.chado_nodes.title_and_path.api.inc, line 1422 - Contains API functions to set titles and paths for all chado nodes
Code
function chado_node_format_tokens($tokens) {
$header = array('name' => 'Name', 'token' => 'Token', 'description' => 'Description');
$rows = array();
usort($tokens, 'chado_sort_tokens_by_location');
foreach ($tokens as $token) {
$rows[] = array(
'name' => $token['name'],
'token' => $token['token'],
'description' => $token['description']
);
}
$table = array(
'header' => $header,
'rows' => $rows,
'attributes' => array(
'id' => 'tripal_tokens',
'class' => 'tripal-data-table'
),
'sticky' => FALSE,
'caption' => '',
'colgroups' => array(),
'empty' => '',
);
return theme_table($table);
}