You are here

function relation_endpoint_field_widget_form in Relation 7

Implements hook_field_widget_form().

File

./relation_endpoint.module, line 315
Relation endpoints field.

Code

function relation_endpoint_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
  foreach ($items as $delta => $item) {
    foreach (array(
      'entity_type',
      'entity_id',
    ) as $column) {
      $element[$delta][$column] = array(
        '#type' => 'value',
        '#value' => $item[$column],
      );
    }
  }
  $element['link_list'] = _relation_endpoint_field_create_html_table($items);
  return $element;
}