You are here

function asaf_find_area in Asaf (ajax submit for any form) 8

Same name and namespace in other branches
  1. 7 asaf.module \asaf_find_area()
1 call to asaf_find_area()
asaf_ajax_callback in ./asaf.module

File

./asaf.module, line 295
Main module file.

Code

function asaf_find_area($areaName, $element) {
  if (!isset($element['#asaf_area']) || $element['#asaf_area'] != $areaName) {
    foreach (element_children($element) as $key) {
      $child = asaf_find_area($areaName, $element[$key]);
      if (isset($child['#asaf_area']) && $child['#asaf_area'] == $areaName) {
        $element = $child;
        break;
      }
    }
  }
  return $element;
}