You are here

function hook_countries_configuration_options in Countries 8

Same name and namespace in other branches
  1. 7.2 modules/countries_configuration/countries_configuration.api.php \hook_countries_configuration_options()

Form settings for integrating with the countries configuration module.

This API allows multiple forms per module.

1 invocation of hook_countries_configuration_options()
countries_configuration_options in modules/countries_configuration/countries_configuration.module
Wrapper to collect information from hook_countries_configuration_options().

File

modules/countries_configuration/countries_configuration.api.php, line 13
An overview of the hooks that this module provides.

Code

function hook_countries_configuration_options() {
  $items = array(
    // This should be an unique key for this option. To avoid conflicts with
    // other modules, use, or prefix with, the modules name.
    'address' => array(
      // This provides the tab title when editing the form.
      'title' => t('Addresses'),
      // This should provide the form of elements that you want to save.
      'form callback' => 'example_address_country_admin_form',
      // Optional: Provides a better title for the page edit.
      'title callback' => 'example_address_country_admin_form_title',
      // Required: Used when no data exists or when resetting the country data.
      'default values' => array(
        'labels' => array(),
      ),
      // Optional: Includes this title before any callbacks are executed.
      'file' => 'address.admin.inc',
      // Optional: included file path if not in the base module directory.
      'file path' => drupal_get_path('module', 'address') . '/includes',
      // Optional: Provides a help section to forms.
      'help' => t('This form allows you to set country specific configuration options for all address fields. Leave these blank to use the field defaults. Available address components are determined by the field settings.'),
    ),
  );
  $components = address_field_components();
  $items['address']['default values']['labels'] += array_combine(array_keys($components), array_fill(0, count($components), ''));
  return $items;
}