You are here

function node_gallery_image_process_finished in Node Gallery 6.3

Used as a finished callback for batch API deletion of images.

Parameters

$success: Scalar provided by batch API.

$results: Array provided by batch API.

$operations: Array provided by batch API.

4 string references to 'node_gallery_image_process_finished'
node_gallery_manage_images_submit in ./node_gallery.pages.inc
_node_gallery_delete in ./node_gallery.module
Deletes the child image nodes when deleting a gallery.
_node_gallery_set_publish in ./node_gallery.module
Publishes the child image nodes when publishing a gallery.
_node_gallery_update_group_settings in ./node_gallery.module
Updates the organic group settings of all gallery images when the settings in the gallery changed.

File

./node_gallery.module, line 974
Node gallery module file.

Code

function node_gallery_image_process_finished($success, $results, $operations) {
  if ($success) {
    drupal_set_message(t('Image modifications complete.'));
    cache_clear_all();
    _field_file_cache(NULL, TRUE);
    content_clear_type_cache();
  }
  else {

    // An error occurred.
    // $operations contains the operations that remained unprocessed.
    $error_operation = reset($operations);
    $operation = array_shift($error_operation);
    $arguments = array_shift($error_operation);
    $arguments_as_string = implode(', ', $arguments);
    watchdog('node_gallery', "Error when calling operation '%s'('%s')", array(
      $operation,
      $arguments_as_string,
    ));
    drupal_set_message(t('An error occurred and has been recorded in the system log.'), 'error');
  }
}