You are here

function hook_uc_addresses_field_handlers in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 uc_addresses.api.php \hook_uc_addresses_field_handlers()

With this hook you can register new field handlers that can be used by fields in address edit forms.

A field handler is a class that extends UcAddressesFormFieldHandler. The declaration of field handlers is based on the CTools plugin API.

For a working example, look at uc_addresses_uc_addresses_field_handlers() in the file uc_addresses.uc_addresses_fields.inc.

Return value

array A list of field handler definitions.

3 functions implement hook_uc_addresses_field_handlers()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

uc_addresses_example_uc_addresses_field_handlers in uc_addresses_example/uc_addresses_example.module
Implements hook_uc_addresses_field_handlers().
uc_addresses_test_uc_addresses_field_handlers in tests/uc_addresses_test.module
Implements hook_uc_addresses_field_handlers().
uc_addresses_uc_addresses_field_handlers in ./uc_addresses.uc_addresses_fields.inc
Implements hook_uc_addresses_field_handlers().

File

./uc_addresses.api.php, line 28
These hooks are invoked by the Ubercart Addresses module. @todo more documentation needed for hook_uc_addresses_field_handlers(). @todo Document the rest of the API.

Code

function hook_uc_addresses_field_handlers() {
  $path = drupal_get_path('module', 'mymodule') . '/handlers';
  $info = array();
  $info['MyCustomFieldHandler'] = array(
    'handler' => array(
      'parent' => 'UcAddressesFieldHandler',
      'class' => 'MyCustomFieldHandler',
      'file' => 'MyCustomFieldHandler.class.php',
      'path' => $path,
    ),
  );
  return $info;
}