function theme_ldap_query_list in Lightweight Directory Access Protocol (LDAP) 8.2
Same name and namespace in other branches
- 7.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_query: 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 20 - theming functions for ldap_query module
Code
function theme_ldap_query_list($variables) {
extract($variables);
$table = array(
'header' => array(
t('Name'),
t('Base DN'),
t('Filter'),
t('Attributes'),
t('Enabled'),
),
'attributes' => array(
'id' => 'ldap_queries',
'class' => 'data',
),
'colgroups' => array(),
'sticky' => FALSE,
'empty' => '',
'caption' => 'LDAP Queries',
);
if ($actions) {
$table['header'][] = "Operations";
}
if (count($ldap_queries)) {
foreach ($ldap_queries as $qid => $ldap_query) {
$row = array(
$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'] = array();
}
$output = theme('table', $table);
return $output;
}