You are here

public function FormBuilderFormBase::unsetElement in Form Builder 7

File

./form_builder.classes.inc, line 646

Class

FormBuilderFormBase

Code

public function unsetElement($element_id) {
  $element = $this->elementArrays[$element_id];
  foreach (element_children($element) as $key) {
    if (!empty($element[$key]['#form_builder']['element_id'])) {
      $this
        ->unsetElement($element[$key]['#form_builder']['element_id']);
    }
  }
  unset($this->elementArrays[$element_id]);
  $parent =& $this->elementArrays[$element['#form_builder']['parent_id']];
  unset($parent[$element['#key']]);
}