You are here

function context_empty in Context 6.2

Same name and namespace in other branches
  1. 6.3 context.module \context_empty()
  2. 6 context.module \context_empty()
  3. 7.3 context.module \context_empty()

Recursive helper function to determine whether an array and its children are entirely empty.

1 call to context_empty()
context_ui_export in context_ui/context_ui.admin.inc
Provides a form with an exported context definition for use in modules.

File

./context.module, line 635

Code

function context_empty($element) {
  $empty = TRUE;
  if (is_array($element)) {
    foreach ($element as $child) {
      $empty = $empty && context_empty($child);
    }
  }
  else {
    $empty = $empty && empty($element);
  }
  return $empty;
}