You are here

function dragndrop_upload_callback in Drag & Drop Upload 7

Default ajax callback for dropzones.

Calls the 'callback' function from the dropzone settings array.

Parameters

string $id: Id of the dropzone that has been generated in dragndrop_upload_dropzone_add().

Return value

mixed Return from callback function (should be ajax commands or text).

1 string reference to 'dragndrop_upload_callback'
dragndrop_upload_menu in ./dragndrop_upload.module
Implements hook_menu().

File

./dragndrop_upload.module, line 66
Provides API for drag & drop upload features.

Code

function dragndrop_upload_callback($id) {
  if ($settings = dragndrop_upload_cache_get($id)) {
    $file = $_FILES[$settings['name']];
    if (is_callable($settings['callback'])) {
      return $settings['callback']($settings['name'], $file);
    }
  }
}