You are here

function bricks_inline_field_widget_form_alter in Bricks​ 7.5

Implements hook_field_widget_form_alter().

File

bricks_inline/bricks_inline.module, line 21
Main file for bricks_inline module.

Code

function bricks_inline_field_widget_form_alter(&$element, &$form_state, $context) {
  $field = $context['field'];
  if (_bricks_field_is_treeable($field) && $context['instance']['widget']['type'] == 'inline_entity_form') {
    $entities =& $element['entities'];
    $entities['#theme'] = 'bricks_inline_entity_form_table';
    foreach (element_children($entities) as $delta) {
      $item = isset($context['items'][$delta]) ? $context['items'][$delta] : NULL;
      _bricks_field_widget_elements($entities[$delta], $item);
    }
  }
}