You are here

function link_widget in Link 6

Same name and namespace in other branches
  1. 5 link.module \link_widget()
  2. 6.2 link.module \link_widget()

Implementation of hook_widget().

File

./link.module, line 228
Defines simple link field types.

Code

function link_widget(&$form, &$form_state, $field, $items, $delta = 0) {
  $element = array(
    '#type' => $field['widget']['type'],
    '#default_value' => isset($items[$delta]) ? $items[$delta] : '',
    '#title' => $field['widget']['label'],
    '#weight' => $field['widget']['weight'],
    '#description' => $field['widget']['description'],
    '#required' => $field['required'],
    '#field' => $field,
  );
  return $element;
}