function library_autocomplete_input in Library 6
Same name and namespace in other branches
- 5.2 library.module \library_autocomplete_input()
- 6.2 library.module \library_autocomplete_input()
- 7 library.module \library_autocomplete_input()
1 call to library_autocomplete_input()
- library_transaction_form in ./
library.pages.inc - @file Functions for generating page displays related to the library module
File
- ./
library.module, line 1280
Code
function library_autocomplete_input($item = NULL) {
if (variable_get('library_item_barcodes', LIBRARY_NO_BARCODES) == LIBRARY_BARCODES) {
$form['item_id'] = array(
'#type' => 'textfield',
'#title' => t('Item Barcode'),
'#default_value' => $item ? $item->barcode : '',
'#required' => TRUE,
'#description' => t('Enter the barcode of the item.'),
);
}
else {
$my_default_value = $item ? $item->title : '';
$my_default_value .= $item ? ' [id:' . $item->id . ']' : '';
$form['item_id'] = array(
'#type' => 'textfield',
'#title' => t('Library Item'),
'#default_value' => $my_default_value,
'#autocomplete_path' => 'library-items/autocomplete',
'#required' => TRUE,
'#description' => t('Begin typing the title of the item, then select the chosen item from the provided list.'),
);
}
return $form;
}