function finder_text_finder_element in Finder 6
Same name and namespace in other branches
- 7 modules/finder_text/finder_text.module \finder_text_finder_element()
Implementation of hook_finder_element().
See also
finder_text_finder_element_validate()
File
- modules/
finder_text/ finder_text.module, line 104 - The finder text module.
Code
function finder_text_finder_element($element, &$form_element) {
if ($element->element == 'text') {
$form_element['#type'] = 'textfield';
$properties = array(
'field_prefix',
'field_suffix',
);
if ($element->settings['form']['rows']) {
$form_element['#type'] = 'textarea';
$properties[] = 'rows';
$properties[] = 'cols';
$element->settings['form']['cols'] = $element->settings['form']['size'];
}
else {
$properties[] = 'maxlength';
$properties[] = 'minlength';
$properties[] = 'size';
}
foreach ($properties as $property) {
if ($element->settings['form'][$property]) {
$form_element['#' . $property] = $element->settings['form'][$property];
}
}
$form_element['#element_validate'][] = 'finder_text_finder_element_validate';
}
}