function clients_connections_select_options in Web Service Clients 7
Same name and namespace in other branches
- 6.2 clients.module \clients_connections_select_options()
- 7.3 clients.module \clients_connections_select_options()
- 7.2 clients.module \clients_connections_select_options()
FormAPI helper to get a list of clients for a select form element.
Parameters
$types: (optional) Specify a single type or a list of types to include. If omitted, all are returned.
$required: Whether the select element is required.
Return value
Array of options for a FormAPI select element; assumed to be single rather than multiple-valued.
File
- ./
clients.module, line 694 - Clients module - handles keys and service connections and provides an API for clients
Code
function clients_connections_select_options($types = array(), $required = TRUE) {
$options = array();
if ($required) {
$options[0] = t('- Please choose -');
}
else {
$options[0] = t('- None selected -');
}
foreach (clients_get_connections($types) as $cid => $connection) {
$options[$cid] = $connection['name'];
}
return $options;
}