You are here

function uc_addresses_get_address_fields in Ubercart Addresses 6.2

Same name and namespace in other branches
  1. 7 uc_addresses.module \uc_addresses_get_address_fields()

Returns all fields registered by hook_uc_addresses_fields().

Return value

array A list of all available address field definitions.

8 calls to uc_addresses_get_address_fields()
UcAddressesFieldHandler::checkContext in handlers/UcAddressesFieldHandler.class.php
Checks if the field passes the context.
UcAddressesFieldHandler::__construct in handlers/UcAddressesFieldHandler.class.php
UcAddressesFormField object constructor.
UcAddressesSchemaAddress::getDefinedFields in class/UcAddressesSchemaAddress.class.php
Returns defined fields.
UcAddressesTestModuleTestCase::testTestModule in tests/uc_addresses.test.test
Test if test module is installed without problems.
uc_addresses_get_address_field_handler in ./uc_addresses.module
Returns a specific handler instance of a field.

... See full list

1 string reference to 'uc_addresses_get_address_fields'
UcAddressesSchemaAddress::getDefinedFields in class/UcAddressesSchemaAddress.class.php
Returns defined fields.

File

./uc_addresses.module, line 842
Adds user profile address support to Ubercart.

Code

function uc_addresses_get_address_fields() {
  static $fields = array();
  if (count($fields) < 1) {
    ctools_include('plugins');
    ctools_plugin_api_include('uc_addresses', 'uc_addresses_fields', 2, 2);
    $fields = module_invoke_all('uc_addresses_fields');

    // Allow other modules to alter the field definitions.
    drupal_alter('uc_addresses_fields', $fields);
    foreach ($fields as $fieldname => $fielddata) {

      // Add name for the field (never set manually).
      $fields[$fieldname]['name'] = $fieldname;

      // Add default values for properties that are not set.
      $fields[$fieldname] += array(
        'type' => 'text',
        'title' => check_plain($fieldname),
        'description' => '',
        'display_settings' => array(),
        'compare' => TRUE,
      );

      // Add default display settings.
      $fields[$fieldname]['display_settings'] += array(
        'default' => TRUE,
      );
    }
  }
  return $fields;
}