Révision f066bdb5
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/addressfield/addressfield.api.php | ||
---|---|---|
29 | 29 |
// No example. |
30 | 30 |
} |
31 | 31 |
|
32 |
/** |
|
33 |
* Allows modules to alter the predefined address formats. |
|
34 |
* |
|
35 |
* @param $address_formats |
|
36 |
* The array of all predefined address formats. |
|
37 |
* |
|
38 |
* @see addressfield_get_address_format() |
|
39 |
*/ |
|
40 |
function hook_addressfield_address_formats_alter(&$address_formats) { |
|
41 |
// Remove the postal_code from the list of required fields for China. |
|
42 |
$address_formats['CN']['required_fields'] = array('locality', 'administrative_area'); |
|
43 |
} |
|
44 |
|
|
45 |
/** |
|
46 |
* Allows modules to alter the predefined administrative areas. |
|
47 |
* |
|
48 |
* @param $administrative_areas |
|
49 |
* The array of all predefined administrative areas. |
|
50 |
* |
|
51 |
* @see addressfield_get_administrative_areas() |
|
52 |
*/ |
|
53 |
function hook_addressfield_administrative_areas_alter(&$administrative_areas) { |
|
54 |
// Alter the label of the Spanish administrative area with the iso code PM. |
|
55 |
$administrative_areas['ES']['PM'] = t('Balears / Baleares'); |
|
56 |
|
|
57 |
// Add administrative areas for imaginary country XT, keyed by their |
|
58 |
// imaginary ISO codes. |
|
59 |
$administrative_areas['XT'] = array( |
|
60 |
'A' => t('Aland'), |
|
61 |
'B' => t('Bland'), |
|
62 |
); |
|
63 |
} |
|
64 |
|
|
32 | 65 |
/** |
33 | 66 |
* Allows modules to add arbitrary AJAX commands to the array returned from the |
34 | 67 |
* standard address field widget refresh. |
Formats disponibles : Unified diff
Weekly update of contrib modules