You are here

function views_bulk_operations_config_form in Views Bulk Operations (VBO) 7.3

Multistep form callback for the "configure" step.

2 string references to 'views_bulk_operations_config_form'
hook_views_bulk_operations_form_alter in ./views_bulk_operations.api.php
Perform alterations on the VBO form before it is rendered.
views_bulk_operations_form_submit in ./views_bulk_operations.module
Submit handler for all steps of the VBO multistep form.

File

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

Code

function views_bulk_operations_config_form($form, &$form_state, $view, $output) {
  $vbo = _views_bulk_operations_get_field($view);
  $operation = $form_state['operation'];
  drupal_set_title(t('Set parameters for %operation', array(
    '%operation' => $operation
      ->label(),
  )), PASS_THROUGH);
  $context = array(
    'entity_type' => $vbo
      ->get_entity_type(),
    // Pass the View along.
    // Has no performance penalty since objects are passed by reference,
    // but needing the full views object in a core action is in most cases
    // a sign of a wrong implementation. Do it only if you have to.
    'view' => $view,
  );
  $form += $operation
    ->form($form, $form_state, $context);
  $query = drupal_get_query_parameters($_GET, array(
    'q',
  ));
  $form['actions'] = array(
    '#type' => 'container',
    '#attributes' => array(
      'class' => array(
        'form-actions',
      ),
    ),
    '#weight' => 999,
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Next'),
    '#validate' => array(
      'views_bulk_operations_config_form_validate',
    ),
    '#submit' => array(
      'views_bulk_operations_form_submit',
    ),
    '#suffix' => l(t('Cancel'), $vbo->view
      ->get_url(), array(
      'query' => $query,
    )),
  );
  return $form;
}