You are here

function form_options_flatten in Drupal 6

Same name and namespace in other branches
  1. 4 includes/form.inc \form_options_flatten()
  2. 5 includes/form.inc \form_options_flatten()
  3. 7 includes/form.inc \form_options_flatten()

Related topics

2 calls to form_options_flatten()
node_filter_form_submit in modules/node/node.admin.inc
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 1470

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;
}