function services_keyauth_admin_keys_list in Services 6.2
Same name and namespace in other branches
- 7 auth/services_keyauth/services_keyauth.admin.inc \services_keyauth_admin_keys_list()
Display all the available API keys.
1 string reference to 'services_keyauth_admin_keys_list'
- services_keyauth_menu in auth/
services_keyauth/ services_keyauth.module - Implementation of hook_menu().
File
- auth/
services_keyauth/ services_keyauth.admin.inc, line 11 - Generate security keys.
Code
function services_keyauth_admin_keys_list() {
$keys = services_keyauth_get_keys();
$header = array(
t('Key'),
t('Title'),
t('Domain'),
array(
'data' => t('Operations'),
'colspan' => '2',
),
);
$rows = array();
foreach ($keys as $kid => $key) {
$row = array();
$row[] = $kid;
$row[] = $key->title;
$row[] = $key->domain;
// Populate the operations field.
$operations = array();
// Set the edit column.
$operations[] = array(
'data' => l(t('edit'), 'admin/build/services/keys/' . $kid),
);
// Set the delete column.
$operations[] = array(
'data' => l(t('delete'), 'admin/build/services/keys/' . $kid . '/delete'),
);
foreach ($operations as $operation) {
$row[] = $operation;
}
$rows[] = $row;
}
if (empty($rows)) {
$rows[] = array(
array(
'data' => t('No API keys created.'),
'colspan' => '5',
'class' => 'message',
),
);
}
return theme('table', $header, $rows);
}