function _views_bulk_operations_execute_finished in Views Bulk Operations (VBO) 6
Helper function to cleanup operations.
1 call to _views_bulk_operations_execute_finished()
- _views_bulk_operations_execute in ./
views_bulk_operations.module - Helper function to execute the chosen action upon selected objects.
1 string reference to '_views_bulk_operations_execute_finished'
- _views_bulk_operations_execute in ./
views_bulk_operations.module - Helper function to execute the chosen action upon selected objects.
File
- ./
views_bulk_operations.module, line 1794 - Allows operations to be performed on items selected in a view.
Code
function _views_bulk_operations_execute_finished($success, $results, $operations, $options = NULL) {
if ($success) {
if ($results['rows'] > 0) {
$message = t('!results items processed in about !time ms:', array(
'!results' => $results['rows'],
'!time' => round((microtime(TRUE) - $results['time']) * 1000),
));
}
else {
$message = t('No items were processed:');
}
$message .= "\n" . theme('item_list', $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),
));
}
if (empty($options)) {
$options = $_SESSION['vbo_options'];
}
// Inform other modules that VBO has finished executing.
module_invoke_all('views_bulk_operations_finish', $options['operation'], $options['params'], array(
'results' => $results,
));
if (!empty($options['display_result'])) {
drupal_set_message($message);
}
unset($_SESSION['vbo_options']);
// unset the options which were used for just one invocation
}