function theme_ldap_server_token_table in Lightweight Directory Access Protocol (LDAP) 7.2
Same name and namespace in other branches
- 8.2 ldap_servers/ldap_servers.theme.inc \theme_ldap_server_token_table()
- 7 ldap_servers/ldap_servers.theme.inc \theme_ldap_server_token_table()
File
- ldap_servers/
ldap_servers.theme.inc, line 107 - Theming functions for ldap_servers module.
Code
function theme_ldap_server_token_table($variables) {
$header = [
[
'data' => 'Token',
'sort' => 'asc',
],
[
'data' => 'Value',
],
];
foreach ($variables['tokens'] as $token => $value) {
$rows[] = [
'data' => [
$token,
$value,
],
];
}
$token_table = '<div class="content"><h2>' . t('Available Tokens') . '</h2>' . theme_table([
'colgroups' => NULL,
'caption' => 'tokens',
'header' => $header,
'rows' => $rows,
'sticky' => TRUE,
'attributes' => [],
'empty' => 'No data',
]) . '</div>';
return $token_table;
}