You are here

function theme_views_bulk_operations_confirmation in Views Bulk Operations (VBO) 7.3

Same name and namespace in other branches
  1. 5 views_bulk_operations.module \theme_views_bulk_operations_confirmation()
  2. 6.3 views_bulk_operations.module \theme_views_bulk_operations_confirmation()
  3. 6 views_bulk_operations.module \theme_views_bulk_operations_confirmation()

Theme function to show the confirmation page before executing the operation.

1 theme call to theme_views_bulk_operations_confirmation()
views_bulk_operations_confirm_form in ./views_bulk_operations.module
Multistep form callback for the "confirm" step.

File

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

Code

function theme_views_bulk_operations_confirmation($variables) {
  $select_all_pages = $variables['select_all_pages'];
  $vbo = $variables['vbo'];
  $entity_type = $vbo
    ->get_entity_type();
  $rows = $variables['rows'];
  $items = array();

  // Load the entities from the current page, and show their titles.
  $entities = _views_bulk_operations_entity_load($entity_type, array_values($rows), $vbo->revision);
  foreach ($entities as $entity) {
    $items[] = check_plain(entity_label($entity_type, $entity));
  }

  // All rows on all pages have been selected, so show a count of additional items.
  if ($select_all_pages) {
    $more_count = $vbo->view->total_rows - count($vbo->view->result);
    $items[] = t('...and %count more.', array(
      '%count' => $more_count,
    ));
  }
  $count = format_plural(count($entities), 'item', '@count items');
  $output = theme('item_list', array(
    'items' => $items,
    'title' => t('You selected the following %count:', array(
      '%count' => $count,
    )),
  ));
  return $output;
}