function theme_ldap_query_list in Lightweight Directory Access Protocol (LDAP) 7.2
Same name and namespace in other branches
- 8.2 ldap_query/ldap_query.theme.inc \theme_ldap_query_list()
- 7 ldap_query/ldap_query.theme.inc \theme_ldap_query_list()
Returns HTML for ldap servers list.
Parameters
$variables: An associative array containing:
- ldap_queries: 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_query_list()
- ldap_query_list in ldap_query/
ldap_query.admin.inc - LDAP queries list.
File
- ldap_query/
ldap_query.theme.inc, line 19 - Theming functions for ldap_query module.
Code
function theme_ldap_query_list($variables) {
/** @var array $ldap_queries */
/** @var bool $actions */
/** @var string $type */
extract($variables);
$table = [
'header' => [
t('Name'),
t('Base DN'),
t('Filter'),
t('Attributes'),
t('Enabled'),
],
'attributes' => [
'id' => 'ldap_queries',
'class' => 'data',
],
'colgroups' => [],
'sticky' => FALSE,
'empty' => '',
'caption' => 'LDAP Queries',
];
if ($actions) {
$table['header'][] = "Operations";
}
if (count($ldap_queries)) {
foreach ($ldap_queries as $qid => $ldap_query) {
$row = [
$ldap_query->name,
$ldap_query->base_dn_str,
$ldap_query->filter,
$ldap_query->attributes_str,
$ldap_query->status == 1 ? "Yes" : "No",
];
if ($actions) {
$admin = new LdapQueryAdmin($ldap_query->qid);
$row[] = join(' | ', $admin
->getActions());
}
$table['rows'][] = $row;
}
}
else {
$table['rows'] = [];
}
$output = theme('table', $table);
return $output;
}