You are here

function _jammer_generic_remove_element in Jammer 6

Same name and namespace in other branches
  1. 7 jammer_generic.module \_jammer_generic_remove_element()

Helper function, recursive.

1 call to _jammer_generic_remove_element()
jammer_generic_form_alter in ./jammer_generic.module
Implementation of hook_form_alter().

File

./jammer_generic.module, line 163
Remove configured form elements from forms.

Code

function _jammer_generic_remove_element($value_array, $key, $element_id) {
  if ($key == $element_id) {
    $value_array['#access'] = FALSE;
  }
  foreach (element_children($value_array) as $value_key) {
    $value_array[$value_key] = _jammer_generic_remove_element($value_array[$value_key], $value_key, $element_id);

    // Recursive.
  }
  return $value_array;
}