You are here

function _webform_submit_matrix in Webform Matrix Component 7.4

Same name and namespace in other branches
  1. 6 components/matrix.inc \_webform_submit_matrix()
  2. 7 components/matrix.inc \_webform_submit_matrix()
  3. 7.2 components/matrix.inc \_webform_submit_matrix()
  4. 7.3 components/matrix.inc \_webform_submit_matrix()

Implements _webform_submit_component().

File

components/matrix.inc, line 496
Webform module matrix component.

Code

function _webform_submit_matrix($component, $value) {
  $form_key = $component['form_key'];
  if (isset($value['add_row_' . $form_key])) {
    unset($value['add_row_' . $form_key]);
  }
  if (isset($value['remove_row_' . $form_key])) {
    unset($value['remove_row_' . $form_key]);
  }
  if (is_array($value)) {
    $keys = array_keys($value);
    foreach ($keys as $key) {
      if (preg_match('/remove_row_line_' . $form_key . '_./', $key)) {
        unset($value[$key]);
      }
    }
  }
  return serialize($value);
}