organisation.inc in Address Field 7
File
plugins/format/organisation.inc
View source
<?php
$plugin = array(
'title' => t('Organisation (single line)'),
'format callback' => 'addressfield_format_organisation_generate',
'type' => 'organisation',
'weight' => -10,
);
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,
'#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',
),
);
}