You are here

function _hierarchical_select_mark_as_disabled in Hierarchical Select 6.3

Same name and namespace in other branches
  1. 5.3 hierarchical_select.module \_hierarchical_select_mark_as_disabled()
  2. 7.3 hierarchical_select.module \_hierarchical_select_mark_as_disabled()

Helper function that marks every element in the given element as disabled.

Parameters

&$element: The element of which we want to mark all elements as disabled.

Return value

A structured array for use in the Forms API.

1 call to _hierarchical_select_mark_as_disabled()
hierarchical_select_process in ./hierarchical_select.module
Hierarchical select form element type #process callback.

File

./hierarchical_select.module, line 1416
This module defines the "hierarchical_select" form element, which is a greatly enhanced way for letting the user select items in a hierarchy.

Code

function _hierarchical_select_mark_as_disabled(&$element) {
  $element['#disabled'] = TRUE;

  // Recurse through all children:
  foreach (element_children($element) as $key) {
    if (isset($element[$key]) && $element[$key]) {
      _hierarchical_select_mark_as_disabled($element[$key]);
    }
  }
}