You are here

function addressfield_format_organisation_generate in Address Field 7

Format callback.

See also

CALLBACK_addressfield_format_callback()

1 string reference to 'addressfield_format_organisation_generate'
organisation.inc in plugins/format/organisation.inc

File

plugins/format/organisation.inc, line 20

Code

function addressfield_format_organisation_generate(&$format, $address) {
  $format['organisation_block'] = array(
    '#type' => 'addressfield_container',
    '#attributes' => array(
      'class' => array(
        'addressfield-container-inline',
        'organisation-block',
      ),
    ),
    '#weight' => -50,
    // The addressfield is considered empty without a country, hide all fields
    // until one is selected.
    '#access' => !empty($address['country']),
  );
  $format['organisation_block']['organisation_name'] = array(
    '#title' => t('Company'),
    '#size' => 30,
    '#maxlength' => 255,
    '#attributes' => array(
      'class' => array(
        'organisation-name',
      ),
      'autocomplete' => 'organization',
    ),
  );
}