You are here

function webform_submit in Webform 5

Same name and namespace in other branches
  1. 5.2 webform.module \webform_submit()
  2. 6.2 webform.module \webform_submit()

Implementation of hook_submit().

File

./webform.module, line 546

Code

function webform_submit(&$node) {
  $node->webformcomponents = array();
  if (isset($_POST['webformcomponents'])) {
    $node->webformcomponents = _webform_components_decode($_POST['webformcomponents']);
  }
  foreach ($node->webformcomponents as $cid => $component) {
    $post_component = $_POST['components'][$cid];
    $node->webformcomponents[$cid]['weight'] = $post_component['weight'];
    $node->webformcomponents[$cid]['mandatory'] = isset($post_component['mandatory']) ? 1 : 0;
  }
}