You are here

function linkimagefield_widget_process in Link Image Field 6

Same name and namespace in other branches
  1. 7 linkimagefield.module \linkimagefield_widget_process()

Element #process callback function.

Parameters

array $element:

array $edit:

arrayreference $form_state:

array $form:

Return value

array

1 string reference to 'linkimagefield_widget_process'
linkimagefield_elements in ./linkimagefield.module
Implementation of hook_elements().

File

./linkimagefield_widget.inc, line 86
linkimagefield widget code @author John Young <john@codeandcreative.com>

Code

function linkimagefield_widget_process($element, $edit, &$form_state, $form) {
  $file = $element['#value'];
  $element = imagefield_widget_process($element, $edit, &$form_state, $form);
  $default_url = empty($file['status']) && empty($file['data']['url']);
  $field = content_fields($element['#field_name'], $element['#type_name']);
  $element['#theme'] = 'linkimagefield_widget_item';
  $element['data']['url'] = array(
    '#title' => t('URL'),
    '#type' => 'textfield',
    '#default_value' => $default_alt ? $field['widget']['url'] : $file['data']['url'],
    '#description' => t('This URL will be loaded when the image is clicked'),
    '#maxlength' => 255,
  );
  return $element;
}