organisation.inc 792 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * @file
  4. * Generates a first name + last name format.
  5. */
  6. $plugin = array(
  7. 'title' => t('Organisation (single line)'),
  8. 'format callback' => 'addressfield_format_organisation_generate',
  9. 'type' => 'organisation',
  10. 'weight' => -10,
  11. );
  12. /**
  13. * Format callback.
  14. *
  15. * @see CALLBACK_addressfield_format_callback()
  16. */
  17. function addressfield_format_organisation_generate(&$format, $address) {
  18. $format['organisation_block'] = array(
  19. '#type' => 'addressfield_container',
  20. '#attributes' => array('class' => array('addressfield-container-inline', 'name-block')),
  21. '#weight' => -50,
  22. );
  23. $format['organisation_block']['organisation_name'] = array(
  24. '#title' => t('Company'),
  25. '#size' => 30,
  26. '#attributes' => array('class' => array('organisation-name')),
  27. );
  28. }