function clients_resource_view in Web Service Clients 6
Same name and namespace in other branches
- 7 clients.module \clients_resource_view()
@todo hide password until clicked to prevent overshoulder attacks when keys are being checked
1 string reference to 'clients_resource_view'
- clients_menu in ./
clients.module - Implementation of hook_menu()
File
- ./
clients.module, line 476 - Clients module - handles keys and service connections and provides an API for clients @author Django Beatty - adub
Code
function clients_resource_view($arg) {
drupal_set_breadcrumb(array(
l(t('Home'), NULL),
l(t('Administer'), 'admin'),
l(t('Site configuration'), 'admin/settings'),
l(t('Clients'), 'admin/settings/clients'),
l(t('Resources'), 'admin/settings/clients/resources'),
));
$resource = clients_resource_load((int) $arg);
$output[] = array(
'Name',
$resource->name,
);
$connection = clients_connection_load((int) $resource->cid);
$output[] = array(
'Connection',
$connection->name,
);
$output[] = array(
'Type',
$connection->type,
);
foreach ($resource->configuration['options'] as $label => $val) {
if (is_array($val)) {
$val = implode(', ', $val);
// needs to be recursive?
}
$output[] = array(
ucfirst($label),
$val,
);
}
$operations = l(t('Edit'), 'admin/settings/clients/resources/' . $arg . '/edit') . ' | ' . l(t('Delete'), 'admin/settings/clients/resources/' . $arg . '/delete');
$output[] = array(
'Operations',
$operations,
);
// add any service agnostic stuff here
return theme_table(array(), $output);
}