addressfield.api.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * @file
  4. * API documentation for Addressfield.
  5. */
  6. /**
  7. * Format generation callback.
  8. *
  9. * @param $format
  10. * The address format being generated.
  11. * @param $address
  12. * The address this format is generated for.
  13. * @param $context
  14. * An associative array of context information pertaining to how the address
  15. * format should be generated. If no mode is given, it will initialize to the
  16. * default value. The remaining context keys should only be present when the
  17. * address format is being generated for a field:
  18. * - mode: either 'form' or 'render'; defaults to 'render'.
  19. * - field: the field info array.
  20. * - instance: the field instance array.
  21. * - langcode: the langcode of the language the field is being rendered in.
  22. * - delta: the delta value of the given address.
  23. *
  24. * @ingroup addressfield_format
  25. */
  26. function CALLBACK_addressfield_format_callback(&$format, $address, $context = array()) {
  27. // No example.
  28. }
  29. /**
  30. * Allows modules to add arbitrary AJAX commands to the array returned from the
  31. * standard address field widget refresh.
  32. *
  33. * @param &$commands
  34. * The array of AJAX commands used to refresh the address field widget.
  35. * @param $form
  36. * The rebuilt form array.
  37. * @param $form_state
  38. * The form state array from the form.
  39. *
  40. * @see addressfield_standard_widget_refresh()
  41. */
  42. function hook_addressfield_standard_widget_refresh_alter(&$commands, $form, $form_state) {
  43. // Display an alert message.
  44. $commands[] = ajax_command_alert(t('The address field widget has been updated.'));
  45. }