You are here

function theme_views_bulk_operations_confirmation in Views Bulk Operations (VBO) 6

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. 7.3 views_bulk_operations.module \theme_views_bulk_operations_confirmation()

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

1 theme call to theme_views_bulk_operations_confirmation()
views_bulk_operations_form in ./views_bulk_operations.module
Form implementation for main VBO multistep form.

File

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

Code

function theme_views_bulk_operations_confirmation($objects, $invert, $view) {
  $selectall = $invert ? count($objects) == 0 : count($objects) == $view->total_rows;
  if ($selectall) {
    $output = format_plural($view->total_rows, 'You selected the only item in this view.', 'You selected all <strong>@count</strong> items in this view.');
  }
  else {
    $object_info = _views_bulk_operations_object_info_for_view($view);
    $items = array();
    foreach ($objects as $row) {
      $oid = $row->{$view->base_field};
      if ($object = call_user_func($object_info['load'], $oid)) {
        $items[] = check_plain((string) $object->{$object_info['title']});
      }
    }
    $output = theme('item_list', $items, $invert ? format_plural(count($objects), 'You selected all ' . $view->total_rows . ' but the following item:', 'You selected all ' . $view->total_rows . ' but the following <strong>@count</strong> items:') : format_plural(count($objects), 'You selected the following item:', 'You selected the following <strong>@count</strong> items:'));
  }
  return $output;
}