You are here

function bricks_field_widget_form_alter in Bricks​ 7.5

Same name and namespace in other branches
  1. 7.4 bricks.module \bricks_field_widget_form_alter()

Implements hook_field_widget_form_alter().

File

./bricks.module, line 167

Code

function bricks_field_widget_form_alter(&$element, &$form_state, $context) {
  $field = $context['field'];
  if (_bricks_field_is_treeable($field) && $context['instance']['widget']['type'] != 'inline_entity_form') {
    $element['target_id']['#size'] = 10;
    if (isset($element['entityreference_live_preview'])) {
      $element['entityreference_live_preview']['#weight'] = -1;
    }
    $item = isset($context['items'][$context['delta']]) ? $context['items'][$context['delta']] : NULL;
    _bricks_field_widget_elements($element, $item);
  }
}