You are here

function supersized_field_widget_process in Supersized 7

Same name and namespace in other branches
  1. 8 supersized.field.inc \supersized_field_widget_process()

An element #process callback for the image_image field type.

Expands the image_image type to include the alt and title fields.

1 string reference to 'supersized_field_widget_process'
supersized_field_widget_form in ./supersized.field.inc
Implements hook_field_widget_form().

File

./supersized.field.inc, line 491
Implement an image field, based on the file module's file field.

Code

function supersized_field_widget_process($element, &$form_state, $form) {
  $instance = field_widget_instance($element, $form_state);
  $settings = $instance['settings'];
  $widget_settings = $instance['widget']['settings'];
  $item = $element['#value'];
  $item['fid'] = $element['fid']['#value'];
  $element = image_field_widget_process($element, $form_state, $form);
  $element['description'] = array(
    '#title' => t('Desscription'),
    '#type' => 'textarea',
    '#default_value' => isset($item['description']) ? $item['description'] : '',
    '#description' => t('This will be display as the description of this slide.'),
    '#weight' => 0,
    '#access' => (bool) $item['fid'] && $settings['description_field'],
  );
  $element['link'] = array(
    '#type' => 'textfield',
    '#title' => t('Link'),
    '#default_value' => isset($item['link']) ? $item['link'] : '',
    '#description' => t('The link of the slide.'),
    '#maxlength' => 2048,
    '#weight' => 1,
    '#access' => (bool) $item['fid'] && $settings['link_field'],
  );
  return $element;
}