You are here

function views_bulk_operations_execute_finished in Views Bulk Operations (VBO) 7.3

Helper function that runs after the execution process is complete.

1 call to views_bulk_operations_execute_finished()
views_bulk_operations_direct_process in ./views_bulk_operations.module
Processes the passed rows directly (without batching and queueing).
1 string reference to 'views_bulk_operations_execute_finished'
views_bulk_operations_execute in ./views_bulk_operations.module
Entry point for executing the chosen operation upon selected rows.

File

./views_bulk_operations.module, line 1274
Allows operations to be performed on items selected in a view.

Code

function views_bulk_operations_execute_finished($success, $results, $operations) {
  if ($success) {
    if (count($results['log']) > 1) {
      $message = theme('item_list', array(
        'items' => $results['log'],
      ));
    }
    else {
      $message = reset($results['log']);
    }
  }
  else {

    // An error occurred.
    // $operations contains the operations that remained unprocessed.
    $error_operation = reset($operations);
    $message = t('An error occurred while processing @operation with arguments: @arguments', array(
      '@operation' => $error_operation[0],
      '@arguments' => print_r($error_operation[0], TRUE),
    ));
  }
  _views_bulk_operations_log($message);
}