You are here

function _imagick_form_elements_process in Imagick 7

Helper function to process all form elements

1 call to _imagick_form_elements_process()
imagick_form_image_effect_form_alter in ./imagick.module
Implements hook_form_FORM_ID_alter()

File

./imagick.module, line 706
Imagick toolkit for image manipulation within Drupal.

Code

function _imagick_form_elements_process($form, $function) {
  $children = element_children($form);

  // If element has children, loop over all of them first
  if (count($children) > 0) {
    foreach ($children as $key) {
      $form[$key] = _imagick_form_elements_process($form[$key], $function);
    }
  }
  else {
    $function($form);
  }
  return $form;
}