You are here

function _taxonomy_menu_flatten_form_settings in Taxonomy menu 7.2

Same name and namespace in other branches
  1. 8 taxonomy_menu.admin.inc \_taxonomy_menu_flatten_form_settings()

Flatten an array of submitted values.

@TODO Replace by more concise, PHP 5.3 compatible, function in Drupal 8.

array_walk_recursive($settings, function ($a, $b) use (&$flatten) {
  $flatten[$b] = $a;
});

Parameters

array $settings: An array of settings to be flattened.

Return value

array A flattened array of settings.

1 call to _taxonomy_menu_flatten_form_settings()
taxonomy_menu_vocab_submit in ./taxonomy_menu.admin.inc
Form submission handler for taxonomy_form_vocabulary().

File

./taxonomy_menu.admin.inc, line 393
Administrative page callbacks for the Taxonomy menu module.

Code

function _taxonomy_menu_flatten_form_settings($settings) {
  $flatten = array();
  foreach (array_keys($settings) as $index => $key) {
    if (is_array($settings[$key])) {
      $flatten += _taxonomy_menu_flatten_form_settings($settings[$key]);
    }
    else {
      $flatten[$key] = $settings[$key];
    }
  }
  return $flatten;
}