You are here

function _entityform_remove_fieldsets_from_tree in Entityform 7

Same name and namespace in other branches
  1. 7.2 entityform.module \_entityform_remove_fieldsets_from_tree()
4 calls to _entityform_remove_fieldsets_from_tree()
entityform_notifications_form_entityform_settings_alter in entityform_notifications/entityform_notifications.module
Implements hook_form_FORM_ID_alter().
entityform_notifications_form_entityform_type_form_alter in entityform_notifications/entityform_notifications.module
Implements hook_form_FORM_ID_alter().
entityform_settings in ./entityform_type.admin.inc
Entityform global setting form
entityform_type_form in ./entityform_type.admin.inc
Generates the entityform type editing form.

File

./entityform.module, line 1559
Module for the Entityform Entity - a starting point to create your own Entity and associated administration interface

Code

function _entityform_remove_fieldsets_from_tree(&$elements, $parents) {

  //set #parents to skip sets in form values
  foreach (element_children($elements) as $key) {
    if (strrpos($key, '_set') === drupal_strlen($key) - drupal_strlen('_set')) {
      foreach (element_children($elements[$key]) as $sub_key) {
        $new_parents = $parents;
        $new_parents[] = $sub_key;
        $elements[$key][$sub_key]['#parents'] = $new_parents;
      }
    }
  }
}