function _merci_choice_form in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6.2
Same name and namespace in other branches
- 6 merci.module \_merci_choice_form()
- 7.2 merci.module \_merci_choice_form()
Builds an individual item selector.
Parameters
$node: The reservation node object.
$form_state: Current form state array.
$delta: Which selector number to build.
$default: Default value for the select.
Return value
The form array for the selector.
2 calls to _merci_choice_form()
- merci_form in ./
merci.module - Implementation of hook_form().
- merci_staff_form_alter in modules/
merci_staff/ merci_staff.module
File
- ./
merci.module, line 1545 - MERCI - Managed Equipment Reservation Checkout and Inventory
Code
function _merci_choice_form($node, $form_state, $delta, $default = '', $reset = NULL) {
static $options = array();
// We'll manually set the #parents property of these fields so that
// their values appear in the $form_state['values']['choice'] array.
//$buckets = t('Buckets');
if (empty($options) or $reset) {
// NOTE: we don't filter by node here because we only want items not
//reserved by any node including the node calling the function.
$options = merci_build_reservable_items($node, $form_state, NULL);
}
$form = array(
'#type' => 'select',
'#options' => $options['options'],
'#default_value' => $default,
);
return $form;
}