function form_options_flatten in Drupal 5
Same name and namespace in other branches
- 4 includes/form.inc \form_options_flatten()
- 6 includes/form.inc \form_options_flatten()
- 7 includes/form.inc \form_options_flatten()
Related topics
2 calls to form_options_flatten()
- node_filter_form_submit in modules/
node/ node.module - Process result from node administration filter form.
- _form_validate in includes/
form.inc - Performs validation on form elements. First ensures required fields are completed, #maxlength is not exceeded, and selected options were in the list of options given to the user. Then calls user-defined validators.
File
- includes/
form.inc, line 897
Code
function form_options_flatten($array, $reset = TRUE) {
static $return;
if ($reset) {
$return = array();
}
foreach ($array as $key => $value) {
if (is_object($value)) {
form_options_flatten($value->option, FALSE);
}
else {
if (is_array($value)) {
form_options_flatten($value, FALSE);
}
else {
$return[$key] = 1;
}
}
}
return $return;
}