You are here

function views_bulk_operations_views_post_build in Views Bulk Operations (VBO) 7.3

Implements hook_views_post_build().

Hides the VBO field if no operations are available. This causes the entire VBO form to be hidden.

See also

views_bulk_operations_form_alter().

File

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

Code

function views_bulk_operations_views_post_build(&$view) {
  $vbo = _views_bulk_operations_get_field($view);
  if ($vbo && count($vbo
    ->get_selected_operations()) < 1) {
    $vbo->options['exclude'] = TRUE;
  }
}