Projet

Général

Profil

Révision 7b2d1845

Ajouté par Assos Assos il y a presque 4 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/webform/includes/webform.submissions.inc
13 13
/**
14 14
 * Given an array of submitted values, flatten it into data for a submission.
15 15
 *
16
 * @param $node
16
 * @param object $node
17 17
 *   The node object containing the current webform.
18
 * @param $submitted
18
 * @param array $submitted
19 19
 *   The submitted user values from the webform.
20 20
 *
21 21
 * @return array
22 22
 *   An array suitable for use in the 'data' property of a $submission object.
23 23
 */
24 24
function webform_submission_data($node, $submitted) {
25
  require_once __DIR__ . '/webform.components.inc';
26

  
25 27
  $data = array();
26 28

  
27 29
  foreach ($submitted as $cid => $values) {
28
    // Don't save pseudo-fields or pagebreaks as submitted data.
29
    if (!isset($node->webform['components'][$cid]) || $node->webform['components'][$cid]['type'] == 'pagebreak') {
30
    // Don't save pseudo-fields or components that do not collect data.
31
    if (!isset($node->webform['components'][$cid]) || !webform_component_feature($node->webform['components'][$cid]['type'], 'stores_data')) {
30 32
      continue;
31 33
    }
32 34

  

Formats disponibles : Unified diff