You are here

function context_empty in Context 6.3

Same name and namespace in other branches
  1. 6 context.module \context_empty()
  2. 6.2 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.

2 calls to context_empty()
context_ui_editor_process in context_ui/context_ui.module
Values processor for context_ui_editor_submit(). Split out for reuse by overriding submit handlers.
context_ui_form_process in context_ui/export_ui/context_export_ui.class.php
Modifies a context object from submitted form values.

File

./context.module, line 431

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;
}