function services_admin_keys_list in Services 5
Same name and namespace in other branches
- 6 services_admin_keys.inc \services_admin_keys_list()
@file The file contains code which is used to create the keys interface
1 string reference to 'services_admin_keys_list'
- services_menu in ./
services.module - Implementation of hook_menu.
File
- ./
services_admin_keys.inc, line 6 - The file contains code which is used to create the keys interface
Code
function services_admin_keys_list() {
$keys = services_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'),
);
//$row = array(array('data' => l($kid, 'admin/build/services/keys/'. $type_url_str), 'class' => $class), array('data' => check_plain($type->type), 'class' => $class), array('data' => check_plain($type->description), 'class' => $class));
foreach ($operations as $operation) {
$operation['class'] = $class;
$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);
}