You are here

function theme_addressfield_formatter in Addressfield Tokens 7

Implements theme_field();

Themes an address according to the default renderer.

4 theme calls to theme_addressfield_formatter()
_webform_csv_data_addressfield in ./addressfield_tokens.components.inc
Format the submitted data of a component for CSV downloading.
_webform_display_addressfield in ./addressfield_tokens.components.inc
Display the result of a submission for a component.
_webform_display_addressfield in ./addressfield_tokens.components.inc
Display the result of a submission for a component.
_webform_table_addressfield in ./addressfield_tokens.components.inc
Return the result of a component value for display in a table.

File

./addressfield_tokens.theme.inc, line 12
Theme Controllers.

Code

function theme_addressfield_formatter($vars) {
  $address = $vars['address'];
  if (isset($address['addressfield'])) {
    $address = $address['addressfield'];
  }
  $handlers = $vars['handlers'];
  if (empty($handlers)) {
    $handlers = array(
      'address',
    );
  }
  $out = addressfield_generate($address, $handlers, array(
    'mode' => 'render',
  ));
  return '<div class="addressfield">' . render($out) . '</div>';
}