You are here

function views_bulk_operations_fields_action_submit in Views Bulk Operations (VBO) 6

Same name and namespace in other branches
  1. 6.3 fields.action.inc \views_bulk_operations_fields_action_submit()
1 call to views_bulk_operations_fields_action_submit()
views_bulk_operations_fields_rules_action_submit in ./views_bulk_operations.rules.inc

File

actions/fields.action.inc, line 383
Drupal action to set individual field values.

Code

function views_bulk_operations_fields_action_submit($form, $form_state) {
  $values = array();
  foreach ($form['#field_info'] as $field_name => $field) {
    if ($field['type'] == 'non_cck') {
      $values[$field_name] = $form_state['values'][$field_name];
    }
    else {
      unset($form_state['values'][$field_name][$field_name . '_add_more']);
      $values[$field_name] = content_set_empty($field, $form_state['values'][$field_name]);
    }
    $values[$field_name . '_check'] = $form_state['values'][$field_name . '_check'];
    $values[$field_name . '_add'] = $form_state['values'][$field_name . '_add'];
    if (isset($form_state['values'][$field_name . '_code'])) {
      $values[$field_name . '_code'] = $form_state['values'][$field_name . '_code'];
    }
  }
  $values['#field_info'] = $form['#field_info'];
  return $values;
}