function theme_ldap_servers_list in Lightweight Directory Access Protocol (LDAP) 7
Same name and namespace in other branches
- 8.2 ldap_servers/ldap_servers.theme.inc \theme_ldap_servers_list()
- 7.2 ldap_servers/ldap_servers.theme.inc \theme_ldap_servers_list()
Returns HTML for ldap servers list.
Parameters
$variables: An associative array containing:
- ldap_servers: an array of one or more ldap server configurations.
- actions: true or false indicating include update, delete, etc. links
- type: 'table', 'list', etc for style to render
1 theme call to theme_ldap_servers_list()
- ldap_servers_servers_list in ldap_servers/
ldap_servers.admin.inc - LDAP servers list.
File
- ldap_servers/
ldap_servers.theme.inc, line 22 - theming functions for ldap_servers module
Code
function theme_ldap_servers_list($variables) {
extract($variables);
$table = array(
'header' => array(
t('Name'),
t('Type'),
t('Enabled'),
t('Server Address'),
),
'attributes' => array(
'id' => 'ldap_servers_servers',
'class' => 'data',
),
'colgroups' => array(),
'sticky' => FALSE,
'empty' => '',
'caption' => 'LDAP Server Configurations',
);
if ($actions) {
$table['header'][] = "Operations";
}
if (count($ldap_servers)) {
foreach ($ldap_servers as $sid => $ldap_server) {
$row = array(
$ldap_server->name,
$ldap_server->ldap_type,
$ldap_server->status == 1 ? "Yes" : "No",
$ldap_server->address,
);
if ($actions) {
$admin = new LdapServerAdmin($ldap_server->sid);
$row[] = join(' | ', $admin
->getLdapServerActions());
}
$table['rows'][] = $row;
}
}
else {
$table['rows'] = array();
}
$output = theme('table', $table);
return $output;
}