function finder_autocomplete_finder_element in Finder 6
Same name and namespace in other branches
- 7 modules/finder_autocomplete/finder_autocomplete.module \finder_autocomplete_finder_element()
Implementation of hook_finder_element().
See also
File
- modules/
finder_autocomplete/ finder_autocomplete.module, line 137 - The finder autocomplete module.
Code
function finder_autocomplete_finder_element($element, &$form_element) {
if ($element->element == 'autocomplete') {
$form_element['#type'] = 'textfield';
$autocomplete_path = 'finder_autocomplete/autocomplete/' . $element->finder_id . '/' . $element->finder_element_id;
if ($element->settings['form']['autosubmit']) {
$form_element['#theme'] = 'finder_autocomplete_textfield';
}
$form_element['#autocomplete_path'] = $autocomplete_path;
$properties = array(
'field_prefix',
'field_suffix',
'maxlength',
'size',
);
foreach ($properties as $property) {
if ($element->settings['form'][$property]) {
$form_element['#' . $property] = $element->settings['form'][$property];
}
}
}
}