You are here

function _upload_element_parse_value in Upload element 6

A private helper function to parse the real value from the element. This takes into account the submit_action when present.

Parameters

array $element Upload element:

Return value

mixed File object or FALSE.

3 calls to _upload_element_parse_value()
theme_upload_element_image_preview in ./upload_element.module
This creates the thumbnail preview HTML.
theme_upload_element_preview in ./upload_element.module
Simple theming function to display the uploaded file.
upload_element_element_validate in ./upload_element.module
The custom validation required for files that are marked as deleted, but are required.

File

./upload_element.module, line 249
A module that provides two new elements to the FAPI for file handling.

Code

function _upload_element_parse_value($element) {
  if (is_object($element['#value'])) {
    if (isset($element['#value']->submit_action)) {
      return $element['#value']->submit_action == UPLOAD_ELEMENT_DELETE ? FALSE : $element['#value'];
    }
    else {
      return $element['#value'];
    }
  }
  return FALSE;
}