You are here

function focal_point_widget_process in Focal Point 7

Field widget process function.

1 string reference to 'focal_point_widget_process'
focal_point_field_widget_form_alter in ./focal_point.module
Implements hook_field_widget_form_alter().

File

./focal_point.module, line 218

Code

function focal_point_widget_process($element, &$form_state, $form) {

  // If a file has already been uploaded, include the necessary components of
  // for the focal point widget.
  $access = (bool) (!empty($element['#file']));
  if ($access) {
    $default_value = !empty($element['#default_value']['focal_point']) ? $element['#default_value']['focal_point'] : _focal_point_guess_default($element['#file']->fid);
  }
  else {
    $default_value = !empty($element['#default_value']['focal_point']) ? $element['#default_value']['focal_point'] : '';
  }
  $element['focal_point'] = _focal_point_field($element['#focal_point_id'], $default_value, $access);
  return $element;
}