Submit handler for the bulk form.
array $form: An associative array containing the structure of the form.
array $form_state: An associative array containing the current state of the form.
public function views_form_submit(&$form, &$form_state) {
if ($form_state['step'] == 'views_form_views_form') {
// Filter only selected checkboxes.
$selected = array_filter($form_state['values'][$this->options['id']]);
$entities = array();
foreach (array_intersect_key($this->view->result, $selected) as $row) {
$entity = $this
->getEntity($row);
$entities[$entity
->id()] = $entity;
}
$action = $this->actions[$form_state['values']['action']];
$action
->execute($entities);
$operation_definition = $action
->getPluginDefinition();
if (!empty($operation_definition['confirm_form_path'])) {
$form_state['redirect'] = $operation_definition['confirm_form_path'];
}
}
}