function _views_bulk_operations_get_selection in Views Bulk Operations (VBO) 7.3
Same name and namespace in other branches
- 6 views_bulk_operations.module \_views_bulk_operations_get_selection()
Goes through the submitted values, and returns an array of selected rows, in the form of $row_index => $entity_id.
2 calls to _views_bulk_operations_get_selection()
- views_bulk_operations_form_submit in ./
views_bulk_operations.module - Submit handler for all steps of the VBO multistep form.
- views_bulk_operations_form_validate in ./
views_bulk_operations.module - Validation callback for the first step of the VBO form.
File
- ./
views_bulk_operations.module, line 709 - Allows operations to be performed on items selected in a view.
Code
function _views_bulk_operations_get_selection($vbo, $form_state) {
$selection = array();
$field_name = $vbo->options['id'];
if (!empty($form_state['values'][$field_name])) {
// If using "force single", the selection needs to be converted to an array.
if (is_array($form_state['values'][$field_name])) {
$selection = array_filter($form_state['values'][$field_name]);
}
else {
$selection = array(
$form_state['values'][$field_name],
);
}
}
return $selection;
}