You are here

function node_gallery_api_batch_item_process_finished in Node Gallery 7

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

Parameters

int $success: Scalar provided by batch API.

array $results: Array provided by batch API.

array $operations: Array provided by batch API.

1 string reference to 'node_gallery_api_batch_item_process_finished'
node_gallery_api_manage_items_submit in ./node_gallery_api.pages.inc
Submit handler for Manage Items form.

File

./node_gallery_api.inc, line 483
Node Gallery API function

Code

function node_gallery_api_batch_item_process_finished($success, $results, $operations) {
  if ($success) {
    drupal_set_message(t('Item modifications complete.'));
    cache_clear_all('node_gallery', 'cache', TRUE);
    cache_clear_all();
  }
  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');
  }
}