function finder_buttons_element_validate in Finder 7.2
Validation callback for text element.
1 string reference to 'finder_buttons_element_validate'
- finder_buttons_element in plugins/
element_handler/ buttons.inc - Element callback.
File
- plugins/
element_handler/ buttons.inc, line 129 - The finder buttons element handler plugin.
Code
function finder_buttons_element_validate($form_element, &$form_state) {
$finder = $form_state['finder'];
foreach ($finder->elements as $key => $element) {
if ($finder
->esetting($element, 'multiple')) {
// remove values in the array that are empty or 0
foreach ($form_state['values'][$element->id] as $k => $v) {
if (!$v) {
unset($form_state['values'][$element->id][$k]);
}
}
// append an 'empty string' choice if we just wiped the whole array and we need a value for the url args
if ($finder
->setting('url') && empty($form_state['values'][$element->id])) {
$form_state['values'][$element->id][] = '';
}
}
}
}