You are here

function _eloqua_get_submission_data in Eloqua 7

Same name and namespace in other branches
  1. 6 eloqua.cron.inc \_eloqua_get_submission_data()

Handle translating post values into what Eloqua wants in terms of structure.

Dates are by default handled in YYYY-mm-dd Times are by default handled in HH:mm

Parameters

array $tree: The post tree name => value pairs.

array $posted_values: The post tree, could be name => value pairs or index => value pairs.

array $result: The re-structured tree that Eloqua will leverage.

1 call to _eloqua_get_submission_data()
_eloqua_cron_get_post_fields in eloqua_webform/eloqua_webform.cron.inc
Returns the post fields for the request, modified for Eloqua.

File

eloqua_webform/eloqua_webform.cron.inc, line 104
Cron Support Functions for Eloqua

Code

function _eloqua_get_submission_data($tree, $posted_values, &$result) {
  foreach ($tree as $name => $value) {

    // Expand fieldsets.
    if (is_array($value) && !in_array($value, $posted_values)) {
      _eloqua_get_submission_data($value, $posted_values, $result);
    }
    elseif (is_array($value)) {
      $result[$name] = implode(',', $value);
    }
    else {
      $result[$name] = $value;
    }
  }
}