You are here

function _webform_addressfield in Addressfield Tokens 7

Stores an addressfield submitted in a webform component.

Ideally store it in the $form_state instead, but there appears to be no way to get it to actually pass through to _webform_render_addressfield().

Parameters

int $cid: The ID of the webform component.

mixed $address: If set, this address will be stored with the given $cid.

Return value

array The address stored with the given $cid, if there is one; otherwise, NULL.

2 calls to _webform_addressfield()
_webform_addressfield_country_validate in ./addressfield_tokens.components.inc
Validates a country, and if changed, rebuilds the form for the new country.
_webform_render_addressfield in ./addressfield_tokens.components.inc
Render a Webform component to be part of a form.

File

./addressfield_tokens.components.inc, line 215
Webform Component information for an address field type.

Code

function _webform_addressfield($cid, $address = NULL) {
  $out =& drupal_static(__FUNCTION__, array());
  if (isset($address)) {
    $out[$cid] = $address;
  }
  if (isset($out[$cid])) {
    return $out[$cid];
  }
  return NULL;
}