You are here

function _eloqua_cron_get_post_fields in Eloqua 6

Same name and namespace in other branches
  1. 7 eloqua_webform/eloqua_webform.cron.inc \_eloqua_cron_get_post_fields()

Returns the post fields for the request, modified for eloqua

Parameters

$post:

Return value

array

1 call to _eloqua_cron_get_post_fields()
_eloqua_cron in ./eloqua.cron.inc
Implementation of hook_cron()

File

./eloqua.cron.inc, line 296

Code

function _eloqua_cron_get_post_fields($post) {

  // TODO: Review newest webform for exact behaviour on whether submitted_tree exists.
  $form_data = !empty($post->data['form_post']['submitted_tree']) ? $post->data['form_post']['submitted_tree'] : $post->data['form_post']['submitted'];
  $post_fields = array();

  // Merge any elq values into the post to be submitted
  foreach ($post->data['form_post'] as $name => $value) {
    if (substr($name, 0, 3) === 'elq') {
      $post_fields[$name] = $value;
    }
  }

  // translates the data into a Eloqua-worthy format
  _eloqua_get_submission_data($form_data, $post->data['form_post']['submitted'], $post_fields);

  // Remap any fields that can't be handled by webform
  $post_fields = _eloqua_cron_remap_post_fields($post_fields, $post);
  return $post_fields;
}