Projet

Général

Profil

Révision f066bdb5

Ajouté par Assos Assos il y a plus de 9 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/addressfield/addressfield.address_formats.inc
1
<?php
2

  
3
/**
4
 * Contains the predefined address formats.
5
 *
6
 * Derived from Google's dataset: https://i18napis.appspot.com/address.
7
 */
8

  
9
/**
10
 * Returns the address format for the given country code.
11
 *
12
 * @param $country_code
13
 *   The country code for which the address format should be returned.
14
 *
15
 * @return
16
 *   The address format array with the following keys:
17
 *   - used_fields: An array of fields used by this format. Possible values:
18
 *     'dependent_locality', 'locality', 'administrative_area', 'postal_code'.
19
 *   - required_fields: An array of required fields. See "used_fields".
20
 *   - dependent_locality_label: The label for the dependent locality field.
21
 *   - locality_label: The label for the locality field.
22
 *   - administrative_area_label: The label for the administrative area field.
23
 *   - postal_code_label: The label for the postal code field.
24
 *
25
 */
26
function addressfield_get_address_format($country_code) {
27
  $default_values = array(
28
    'used_fields' => array('locality'),
29
    'required_fields' => array('locality'),
30
    'dependent_locality_label' => t('Suburb'),
31
    'locality_label' => t('City'),
32
    'administrative_area_label' => t('Province'),
33
    'postal_code_label' => t('Postal code'),
34
  );
35

  
36
  $address_formats = array();
37
  // These formats differ from the default only by the presence of the
38
  // postal code in 'used_fields'.
39
  $countries_with_optional_postal_code = array(
40
    'AC', 'AD', 'AL', 'AZ', 'BA', 'BB', 'BD', 'BG', 'BH', 'BM', 'BN', 'BT',
41
    'CR', 'CY', 'CZ', 'DO', 'DZ', 'EC', 'EE', 'EH', 'ET', 'FO', 'GE', 'GN',
42
    'GT', 'GW', 'HR', 'HT', 'HU', 'IL', 'IS', 'JO', 'KE', 'KG', 'KH', 'KW',
43
    'LA', 'LB', 'LK', 'LR', 'LS', 'LT', 'LV', 'MA', 'MC', 'MD', 'ME', 'MG',
44
    'MK', 'MM', 'MT', 'MU', 'MV', 'NE', 'NP', 'OM', 'PK', 'PY', 'RO', 'RS',
45
    'SA', 'SI', 'SK', 'SN', 'SZ', 'TA', 'TJ', 'TM', 'TN', 'VA', 'VC', 'VG',
46
    'XK', 'ZM',
47
  );
48
  foreach ($countries_with_optional_postal_code as $code) {
49
    $address_formats[$code] = array(
50
      'used_fields' => array('locality', 'postal_code'),
51
    );
52
  }
53

  
54
  // These formats differ from the default only by the presence of the
55
  // postal code in 'used_fields' and 'required_fields'.
56
  $countries_with_required_postal_code = array(
57
    'AT', 'AX', 'BE', 'BL', 'CH', 'DE', 'DK', 'FI', 'FK', 'FR', 'GF', 'GG',
58
    'GL', 'GP', 'GR', 'GS', 'IM', 'IO', 'JE', 'LI', 'LU', 'MF', 'MQ', 'NC',
59
    'NL', 'NO', 'PL', 'PM', 'PN', 'PT', 'RE', 'SE', 'SH', 'SJ', 'TC', 'WF',
60
    'YT',
61
  );
62
  foreach ($countries_with_required_postal_code as $code) {
63
    $address_formats[$code] = array(
64
      'used_fields' => array('locality', 'postal_code'),
65
      'required_fields' => array('locality', 'postal_code'),
66
    );
67
  }
68

  
69
  $address_formats['AE'] = array(
70
    'used_fields' => array('administrative_area'),
71
    'administrative_area_label' => t('Emirate'),
72
  );
73
  $address_formats['AM'] = array(
74
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
75
  );
76
  $address_formats['AR'] = array(
77
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
78
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
79
  );
80
  $address_formats['AS'] = array(
81
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
82
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
83
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
84
    'postal_code_label' => t('ZIP code'),
85
  );
86
  $address_formats['AU'] = array(
87
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
88
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
89
    'locality_label' => t('City/Suburb'),
90
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
91
    'postal_code_label' => t('Postcode'),
92
  );
93
  $address_formats['BR'] = array(
94
    'used_fields' => array('dependent_locality', 'locality', 'administrative_area', 'postal_code'),
95
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
96
    'dependent_locality_label' => t('Neighborhood'),
97
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
98
  );
99
  $address_formats['BS'] = array(
100
    'used_fields' => array('locality', 'administrative_area'),
101
    'administrative_area_label' => t('Island'),
102
  );
103
  $address_formats['BY'] = array(
104
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
105
  );
106
  $address_formats['CA'] = array(
107
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
108
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
109
  );
110
  $address_formats['CC'] = array(
111
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
112
  );
113
  $address_formats['CL'] = array(
114
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
115
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
116
  );
117
  $address_formats['CN'] = array(
118
    'used_fields' => array('dependent_locality', 'locality', 'administrative_area', 'postal_code'),
119
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
120
    'dependent_locality_label' => t('District'),
121
  );
122
  $address_formats['CO'] = array(
123
    'used_fields' => array('locality', 'administrative_area'),
124
    'administrative_area_label' => t('Department', array(), array('context' => 'Territory of a country')),
125
  );
126
  $address_formats['CV'] = array(
127
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
128
    'administrative_area_label' => t('Island'),
129
  );
130
  $address_formats['CX'] = array(
131
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
132
  );
133
  $address_formats['EG'] = array(
134
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
135
    'administrative_area_label' => t('Governorate'),
136
  );
137
  $address_formats['ES'] = array(
138
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
139
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
140
  );
141
  $address_formats['FM'] = array(
142
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
143
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
144
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
145
    'postal_code_label' => t('ZIP code'),
146
  );
147
  $address_formats['GB'] = array(
148
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
149
    'required_fields' => array('locality', 'postal_code'),
150
    'locality_label' => t('Town/City'),
151
    'administrative_area_label' => t('County'),
152
    'postal_code_label' => t('Postcode'),
153
  );
154
  $address_formats['GI'] = array(
155
    'used_fields' => array('postal_code'),
156
  );
157
  $address_formats['GU'] = array(
158
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
159
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
160
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
161
    'postal_code_label' => t('ZIP code'),
162
  );
163
  $address_formats['HK'] = array(
164
    'used_fields' => array('locality', 'administrative_area'),
165
    'required_fields' => array('administrative_area'),
166
    'locality_label' => t('District'),
167
    'administrative_area_label' => t('Area', array(), array('context' => 'Territory of a country')),
168
  );
169
  $address_formats['HN'] = array(
170
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
171
    'required_fields' => array('locality', 'administrative_area'),
172
  );
173
  $address_formats['ID'] = array(
174
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
175
    'locality_label' => t('City/Regency'),
176
  );
177
  $address_formats['IE'] = array(
178
    'used_fields' => array('locality', 'administrative_area'),
179
    'locality_label' => t('Town/City'),
180
    'administrative_area_label' => t('County'),
181
  );
182
  $address_formats['IN'] = array(
183
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
184
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
185
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
186
    'postal_code_label' => t('PIN code'),
187
  );
188
  $address_formats['IQ'] = array(
189
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
190
    'required_fields' => array('locality', 'administrative_area'),
191
  );
192
  $address_formats['IR'] = array(
193
    'used_fields' => array('dependent_locality', 'locality', 'administrative_area', 'postal_code'),
194
    'dependent_locality_label' => t('Neighborhood'),
195
  );
196
  $address_formats['IT'] = array(
197
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
198
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
199
  );
200
  $address_formats['JM'] = array(
201
    'used_fields' => array('locality', 'administrative_area'),
202
    'required_fields' => array('locality', 'administrative_area'),
203
    'administrative_area_label' => t('Parish', array(), array('context' => 'Territory of a country')),
204
  );
205
  $address_formats['JP'] = array(
206
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
207
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
208
    'administrative_area_label' => t('Prefecture'),
209
  );
210
  $address_formats['KI'] = array(
211
    'used_fields' => array('locality', 'administrative_area'),
212
    'administrative_area_label' => t('Island'),
213
  );
214
  $address_formats['KN'] = array(
215
    'used_fields' => array('locality', 'administrative_area'),
216
    'required_fields' => array('locality', 'administrative_area'),
217
    'administrative_area_label' => t('Island'),
218
  );
219
  $address_formats['KR'] = array(
220
    'used_fields' => array('dependent_locality', 'locality', 'administrative_area', 'postal_code'),
221
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
222
    'dependent_locality_label' => t('District'),
223
  );
224
  $address_formats['KY'] = array(
225
    'used_fields' => array('administrative_area', 'postal_code'),
226
    'required_fields' => array('administrative_area'),
227
    'administrative_area_label' => t('Island'),
228
  );
229
  $address_formats['KZ'] = array(
230
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
231
  );
232
  $address_formats['MH'] = array(
233
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
234
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
235
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
236
    'postal_code_label' => t('ZIP code'),
237
  );
238
  $address_formats['MN'] = array(
239
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
240
  );
241
  $address_formats['MP'] = array(
242
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
243
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
244
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
245
    'postal_code_label' => t('ZIP code'),
246
  );
247
  $address_formats['MX'] = array(
248
    'used_fields' => array('dependent_locality', 'locality', 'administrative_area', 'postal_code'),
249
    'required_fields' => array('locality', 'postal_code'),
250
    'dependent_locality_label' => t('Neighborhood'),
251
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
252
  );
253
  $address_formats['MY'] = array(
254
    'used_fields' => array('dependent_locality', 'locality', 'administrative_area', 'postal_code'),
255
    'required_fields' => array('locality', 'postal_code'),
256
    'dependent_locality_label' => t('Village / Township'),
257
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
258
  );
259
  $address_formats['MZ'] = array(
260
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
261
  );
262
  $address_formats['NF'] = array(
263
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
264
  );
265
  $address_formats['NG'] = array(
266
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
267
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
268
  );
269
  $address_formats['NI'] = array(
270
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
271
    'administrative_area_label' => t('Department', array(), array('context' => 'Territory of a country')),
272
  );
273
  $address_formats['NR'] = array(
274
    'used_fields' => array('administrative_area'),
275
    'required_fields' => array('administrative_area'),
276
    'administrative_area_label' => t('District'),
277
  );
278
  $address_formats['NZ'] = array(
279
    'used_fields' => array('dependent_locality', 'locality', 'postal_code'),
280
    'required_fields' => array('locality', 'postal_code'),
281
    'locality_label' => t('Town/City'),
282
    'postal_code_label' => t('Postcode'),
283
  );
284
  $address_formats['PA'] = array(
285
    'used_fields' => array('locality', 'administrative_area'),
286
  );
287
  $address_formats['PE'] = array(
288
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
289
    'locality_label' => t('District'),
290
    'administrative_area_label' => t('Department', array(), array('context' => 'Territory of a country')),
291
  );
292
  $address_formats['PF'] = array(
293
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
294
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
295
    'administrative_area_label' => t('Island'),
296
  );
297
  $address_formats['PG'] = array(
298
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
299
    'required_fields' => array('locality', 'administrative_area'),
300
  );
301
  $address_formats['PH'] = array(
302
    'used_fields' => array('dependent_locality', 'locality', 'administrative_area', 'postal_code'),
303
  );
304
  $address_formats['PR'] = array(
305
    'used_fields' => array('locality', 'postal_code'),
306
    'required_fields' => array('locality', 'postal_code'),
307
    'postal_code_label' => t('ZIP code'),
308
  );
309
  $address_formats['PW'] = array(
310
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
311
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
312
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
313
    'postal_code_label' => t('ZIP code'),
314
  );
315
  $address_formats['RU'] = array(
316
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
317
    'required_fields' => array('locality', 'postal_code'),
318
  );
319
  $address_formats['SC'] = array(
320
    'used_fields' => array('locality', 'administrative_area'),
321
    'administrative_area_label' => t('Island'),
322
  );
323
  $address_formats['SG'] = array(
324
    'used_fields' => array('postal_code'),
325
    'required_fields' => array('postal_code'),
326
  );
327
  $address_formats['SM'] = array(
328
    'used_fields' => array('locality', 'postal_code'),
329
    'required_fields' => array('postal_code'),
330
  );
331
  $address_formats['SO'] = array(
332
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
333
    'required_fields' => array('locality', 'administrative_area'),
334
  );
335
  $address_formats['SR'] = array(
336
    'used_fields' => array('locality', 'administrative_area'),
337
  );
338
  $address_formats['SV'] = array(
339
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
340
    'required_fields' => array('locality', 'administrative_area'),
341
  );
342
  $address_formats['TH'] = array(
343
    'used_fields' => array('dependent_locality', 'locality', 'administrative_area', 'postal_code'),
344
  );
345
  $address_formats['TR'] = array(
346
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
347
    'required_fields' => array('locality', 'postal_code'),
348
    'locality_label' => t('District'),
349
  );
350
  $address_formats['TV'] = array(
351
    'used_fields' => array('locality', 'administrative_area'),
352
    'administrative_area_label' => t('Island'),
353
  );
354
  $address_formats['TW'] = array(
355
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
356
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
357
  );
358
  $address_formats['UA'] = array(
359
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
360
    'required_fields' => array('locality', 'postal_code'),
361
    'administrative_area_label' => t('Region', array(), array('context' => 'Territory of a country')),
362
  );
363
  $address_formats['UM'] = array(
364
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
365
    'required_fields' => array('locality', 'administrative_area'),
366
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
367
    'postal_code_label' => t('ZIP code'),
368
  );
369
  $address_formats['US'] = array(
370
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
371
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
372
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
373
    'postal_code_label' => t('ZIP code'),
374
  );
375
  $address_formats['UY'] = array(
376
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
377
  );
378
  $address_formats['UZ'] = array(
379
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
380
  );
381
  $address_formats['VE'] = array(
382
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
383
    'required_fields' => array('locality', 'administrative_area'),
384
  );
385
  $address_formats['VI'] = array(
386
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
387
    'required_fields' => array('locality', 'administrative_area', 'postal_code'),
388
    'administrative_area_label' => t('State', array(), array('context' => 'Territory of a country')),
389
    'postal_code_label' => t('ZIP code'),
390
  );
391
  $address_formats['VN'] = array(
392
    'used_fields' => array('locality', 'administrative_area', 'postal_code'),
393
  );
394
  $address_formats['ZA'] = array(
395
    'used_fields' => array('dependent_locality', 'locality', 'postal_code'),
396
    'required_fields' => array('locality', 'postal_code'),
397
  );
398

  
399
  // Allow other modules to alter the formats.
400
  drupal_alter('addressfield_address_formats', $address_formats);
401

  
402
  if (isset($address_formats[$country_code])) {
403
    $format = $address_formats[$country_code] + $default_values;
404
  }
405
  else {
406
    // There is no predefined address format for the requested country,
407
    // but the defaults should work fine.
408
    $format = $default_values;
409
  }
410

  
411
  return $format;
412
}
drupal7/sites/all/modules/addressfield/addressfield.administrative_areas.inc
1
<?php
2

  
3
/**
4
 * Returns the predefined administrative areas.
5
 *
6
 * @param $country_code
7
 *   The country code for which administrative areas should be returned.
8
 *
9
 * @return
10
 *   An array of predefined administrative areas for the given country code, or
11
 *   NULL if not found.
12
 */
13
function addressfield_get_administrative_areas($country_code) {
14
  $administrative_areas = array();
15
  $administrative_areas['AE'] = array(
16
    'AZ' => t('Abu Dhabi'),
17
    'AJ' => t('Ajmān'),
18
    'FU' => t('Fujairah'),
19
    'SH' => t('Sharjah'),
20
    'DU' => t('Dubai'),
21
    'RK' => t('Ras al-Khaimah'),
22
    'UQ' => t('Umm al-Quwain'),
23
  );
24
  $administrative_areas['AR'] = array(
25
    'B' => t('Buenos Aires'),
26
    'K' => t('Catamarca'),
27
    'H' => t('Chaco'),
28
    'U' => t('Chubut'),
29
    'C' => t('Ciudad de Buenos Aires'),
30
    'X' => t('Córdoba'),
31
    'W' => t('Corrientes'),
32
    'E' => t('Entre Ríos'),
33
    'P' => t('Formosa'),
34
    'Y' => t('Jujuy'),
35
    'L' => t('La Pampa'),
36
    'F' => t('La Rioja'),
37
    'M' => t('Mendoza'),
38
    'N' => t('Misiones'),
39
    'Q' => t('Neuquén'),
40
    'R' => t('Río Negro'),
41
    'A' => t('Salta'),
42
    'J' => t('San Juan'),
43
    'D' => t('San Luis'),
44
    'Z' => t('Santa Cruz'),
45
    'S' => t('Santa Fe'),
46
    'G' => t('Santiago del Estero'),
47
    'V' => t('Tierra del Fuego'),
48
    'T' => t('Tucumán'),
49
  );
50
  $administrative_areas['AU'] = array(
51
    'ACT' => t('Australian Capital Territory'),
52
    'NSW' => t('New South Wales'),
53
    'NT' => t('Northern Territory'),
54
    'QLD' => t('Queensland'),
55
    'SA' => t('South Australia'),
56
    'TAS' => t('Tasmania'),
57
    'VIC' => t('Victoria'),
58
    'WA' => t('Western Australia'),
59
  );
60
  $administrative_areas['BR'] = array(
61
    'AC' => t('Acre'),
62
    'AL' => t('Alagoas'),
63
    'AM' => t('Amazonas'),
64
    'AP' => t('Amapá'),
65
    'BA' => t('Bahia'),
66
    'CE' => t('Ceará'),
67
    'DF' => t('Distrito Federal'),
68
    'ES' => t('Espírito Santo'),
69
    'GO' => t('Goiás'),
70
    'MA' => t('Maranhão'),
71
    'MG' => t('Minas Gerais'),
72
    'MS' => t('Mato Grosso do Sul'),
73
    'MT' => t('Mato Grosso'),
74
    'PA' => t('Pará'),
75
    'PB' => t('Paraíba'),
76
    'PE' => t('Pernambuco'),
77
    'PI' => t('Piauí'),
78
    'PR' => t('Paraná'),
79
    'RJ' => t('Rio de Janeiro'),
80
    'RN' => t('Rio Grande do Norte'),
81
    'RO' => t('Rondônia'),
82
    'RR' => t('Roraima'),
83
    'RS' => t('Rio Grande do Sul'),
84
    'SC' => t('Santa Catarina'),
85
    'SE' => t('Sergipe'),
86
    'SP' => t('São Paulo'),
87
    'TO' => t('Tocantins'),
88
  );
89
  $administrative_areas['CA'] = array(
90
    'AB' => t('Alberta'),
91
    'BC' => t('British Columbia'),
92
    'MB' => t('Manitoba'),
93
    'NB' => t('New Brunswick'),
94
    'NL' => t('Newfoundland and Labrador'),
95
    'NT' => t('Northwest Territories'),
96
    'NS' => t('Nova Scotia'),
97
    'NU' => t('Nunavut'),
98
    'ON' => t('Ontario'),
99
    'PE' => t('Prince Edward Island'),
100
    'QC' => t('Quebec'),
101
    'SK' => t('Saskatchewan'),
102
    'YT' => t('Yukon Territory'),
103
  );
104
  $administrative_areas['CL'] = array(
105
    'AI' => t('Aysén del General Carlos Ibáñez del Campo'),
106
    'AN' => t('Antofagasta'),
107
    'AR' => t('Araucanía'),
108
    'AP' => t('Arica y Parinacota'),
109
    'AT' => t('Atacama'),
110
    'BI' => t('Biobío'),
111
    'CO' => t('Coquimbo'),
112
    'LI' => t('Libertador General Bernardo O\'Higgins'),
113
    'LL' => t('Los Lagos'),
114
    'LR' => t('Los Ríos'),
115
    'MA' => t('Magallanes y de la Antártica Chilena'),
116
    'ML' => t('Maule'),
117
    'RM' => t('Metropolitana de Santiago'),
118
    'TA' => t('Tarapacá'),
119
    'VS' => t('Valparaíso'),
120
  );
121
  $administrative_areas['CN'] = array(
122
    '34' => t('Anhui Sheng'),
123
    '92' => t('Macau'),
124
    '11' => t('Beijing Shi'),
125
    '50' => t('Chongqing Shi'),
126
    '35' => t('Fujian Sheng'),
127
    '62' => t('Gansu Sheng'),
128
    '44' => t('Guangdong Sheng'),
129
    '45' => t('Guangxi Zhuangzuzizhiqu'),
130
    '52' => t('Guizhou Sheng'),
131
    '46' => t('Hainan Sheng'),
132
    '13' => t('Hebei Sheng'),
133
    '41' => t('Henan Sheng'),
134
    '23' => t('Heilongjiang Sheng'),
135
    '42' => t('Hubei Sheng'),
136
    '43' => t('Hunan Sheng'),
137
    '22' => t('Jilin Sheng'),
138
    '32' => t('Jiangsu Sheng'),
139
    '36' => t('Jiangxi Sheng'),
140
    '21' => t('Liaoning Sheng'),
141
    '15' => t('Neimenggu Zizhiqu'),
142
    '64' => t('Ningxia Huizuzizhiqu'),
143
    '63' => t('Qinghai Sheng'),
144
    '37' => t('Shandong Sheng'),
145
    '14' => t('Shanxi Sheng'),
146
    '61' => t('Shaanxi Sheng'),
147
    '31' => t('Shanghai Shi'),
148
    '51' => t('Sichuan Sheng'),
149
    '71' => t('Taiwan'),
150
    '12' => t('Tianjin Shi'),
151
    '54' => t('Xizang Zizhiqu'),
152
    '91' => t('Hong Kong'),
153
    '65' => t('Xinjiang Weiwuerzizhiqu'),
154
    '53' => t('Yunnan Sheng'),
155
    '33' => t('Zhejiang Sheng'),
156
  );
157
  $administrative_areas['CO'] = array(
158
    'AMA' => t('Amazonas'),
159
    'ANT' => t('Antioquia'),
160
    'ARA' => t('Arauca'),
161
    'ATL' => t('Atlántico'),
162
    'BOL' => t('Bolívar'),
163
    'BOY' => t('Boyacá'),
164
    'CAL' => t('Caldas'),
165
    'CAQ' => t('Caquetá'),
166
    'CAS' => t('Casanare'),
167
    'CAU' => t('Cauca'),
168
    'CES' => t('Cesar'),
169
    'COR' => t('Córdoba'),
170
    'CUN' => t('Cundinamarca'),
171
    'CHO' => t('Chocó'),
172
    'GUA' => t('Guainía'),
173
    'GUV' => t('Guaviare'),
174
    'HUI' => t('Huila'),
175
    'LAG' => t('La Guajira'),
176
    'MAG' => t('Magdalena'),
177
    'MET' => t('Meta'),
178
    'NAR' => t('Nariño'),
179
    'NSA' => t('Norte de Santander'),
180
    'PUT' => t('Putumayo'),
181
    'QUI' => t('Quindío'),
182
    'RIS' => t('Risaralda'),
183
    'SAP' => t('San Andrés, Providencia y Santa Catalina'),
184
    'SAN' => t('Santander'),
185
    'SUC' => t('Sucre'),
186
    'TOL' => t('Tolima'),
187
    'VAC' => t('Valle del Cauca'),
188
    'VAU' => t('Vaupés'),
189
    'VID' => t('Vichada'),
190
  );
191
  $administrative_areas['EG'] = array(
192
    'ALX' => t('Alexandria'),
193
    'ASN' => t('Aswan'),
194
    'AST' => t('Asyut'),
195
    'BH' => t('Beheira'),
196
    'BNS' => t('Beni Suef'),
197
    'C' => t('Cairo'),
198
    'DK' => t('Dakahlia'),
199
    'DT' => t('Damietta'),
200
    'FYM' => t('Faiyum'),
201
    'GH' => t('Gharbia'),
202
    'GZ' => t('Giza'),
203
    'IS' => t('Ismailia'),
204
    'KFS' => t('Kafr el-Sheikh'),
205
    'MT' => t('Matruh'),
206
    'MN' => t('Minya'),
207
    'MNF' => t('Monufia'),
208
    'WAD' => t('New Valley'),
209
    'SIN' => t('North Sinai'),
210
    'PTS' => t('Port Said'),
211
    'KB' => t('Qalyubia'),
212
    'KN' => t('Qena'),
213
    'BA' => t('Red Sea'),
214
    'SHR' => t('Sharqia'),
215
    'SHG' => t('Sohag'),
216
    'JS' => t('South Sinai'),
217
    'SUZ' => t('Suez'),
218
    'LX' => t('Luxor'),
219
  );
220
  $administrative_areas['ES'] = array(
221
    'C' => t("A Coruña"),
222
    'VI' => t('Alava'),
223
    'AB' => t('Albacete'),
224
    'A' => t('Alicante'),
225
    'AL' => t("Almería"),
226
    'O' => t('Asturias'),
227
    'AV' => t("Ávila"),
228
    'BA' => t('Badajoz'),
229
    'PM' => t('Baleares'),
230
    'B' => t('Barcelona'),
231
    'BU' => t('Burgos'),
232
    'CC' => t("Cáceres"),
233
    'CA' => t("Cádiz"),
234
    'S' => t('Cantabria'),
235
    'CS' => t("Castellón"),
236
    'CE' => t('Ceuta'),
237
    'CR' => t('Ciudad Real'),
238
    'CO' => t("Córdoba"),
239
    'CU' => t('Cuenca'),
240
    'GI' => t('Gerona'),
241
    'GR' => t('Granada'),
242
    'GU' => t('Guadalajara'),
243
    'SS' => t("Guipúzcoa"),
244
    'H' => t('Huelva'),
245
    'HU' => t('Huesca'),
246
    'J' => t("Jaén"),
247
    'LO' => t('La Rioja'),
248
    'GC' => t('Las Palmas'),
249
    'LE' => t("León"),
250
    'L' => t("Lérida"),
251
    'LU' => t('Lugo'),
252
    'M' => t('Madrid'),
253
    'MA' => t("Málaga"),
254
    'ML' => t('Melilla'),
255
    'MU' => t('Murcia'),
256
    'NA' => t('Navarra'),
257
    'OR' => t('Ourense'),
258
    'P' => t('Palencia'),
259
    'PO' => t('Pontevedra'),
260
    'SA' => t('Salamanca'),
261
    'TF' => t('Santa Cruz de Tenerife'),
262
    'SG' => t('Segovia'),
263
    'SE' => t('Sevilla'),
264
    'SO' => t('Soria'),
265
    'T' => t('Tarragona'),
266
    'TE' => t('Teruel'),
267
    'TO' => t('Toledo'),
268
    'V' => t('Valencia'),
269
    'VA' => t('Valladolid'),
270
    'BI' => t('Vizcaya'),
271
    'ZA' => t('Zamora'),
272
    'Z' => t('Zaragoza'),
273
  );
274
  $administrative_areas['HK'] = array(
275
    // HK subdivisions have no ISO codes assigned.
276
    'Kowloon' => t('Kowloon'),
277
    'Hong Kong Island' => t('Hong Kong Island'),
278
    'New Territories' => t('New Territories'),
279
  );
280
  $administrative_areas['ID'] = array(
281
    'AC' => t('Aceh'),
282
    'BA' => t('Bali'),
283
    'BB' => t('Bangka Belitung'),
284
    'BT' => t('Banten'),
285
    'BE' => t('Bengkulu'),
286
    'JK' => t('DKI Jakarta'),
287
    'YO' => t('D.I. Yogyakarta'),
288
    'GO' => t('Gorontalo'),
289
    'JA' => t('Jambi'),
290
    'JB' => t('Jawa Barat'),
291
    'JT' => t('Jawa Tengah'),
292
    'JI' => t('Jawa Timur'),
293
    'KB' => t('Kalimantan Barat'),
294
    'KS' => t('Kalimantan Selatan'),
295
    'KT' => t('Kalimantan Tengah'),
296
    'KI' => t('Kalimantan Timur'),
297
    'KR' => t('Kepulauan Riau'),
298
    'LA' => t('Lampung'),
299
    'MA' => t('Maluku'),
300
    'MU' => t('Maluku Utara'),
301
    'NB' => t('Nusa Tenggara Barat'),
302
    'NT' => t('Nusa Tenggara Timur'),
303
    'PA' => t('Papua'),
304
    'PB' => t('Papua Barat'),
305
    'RI' => t('Riau'),
306
    'SR' => t('Sulawesi Barat'),
307
    'SN' => t('Sulawesi Selatan'),
308
    'ST' => t('Sulawesi Tengah'),
309
    'SG' => t('Sulawesi Tenggara'),
310
    'SA' => t('Sulawesi Utara'),
311
    'SB' => t('Sumatera Barat'),
312
    'SS' => t('Sumatera Selatan'),
313
    'SU' => t('Sumatera Utara'),
314
  );
315
  $administrative_areas['IE'] = array(
316
    'CW' => t('Co Carlow'),
317
    'CN' => t('Co Cavan'),
318
    'CE' => t('Co Clare'),
319
    'CO' => t('Co Cork'),
320
    'DL' => t('Co Donegal'),
321
    'D' => t('Co Dublin'),
322
    'D1' => t('Dublin 1'),
323
    'D2' => t('Dublin 2'),
324
    'D3' => t('Dublin 3'),
325
    'D4' => t('Dublin 4'),
326
    'D5' => t('Dublin 5'),
327
    'D6' => t('Dublin 6'),
328
    'D6W' => t('Dublin 6w'),
329
    'D7' => t('Dublin 7'),
330
    'D8' => t('Dublin 8'),
331
    'D9' => t('Dublin 9'),
332
    'D10' => t('Dublin 10'),
333
    'D11' => t('Dublin 11'),
334
    'D12' => t('Dublin 12'),
335
    'D13' => t('Dublin 13'),
336
    'D14' => t('Dublin 14'),
337
    'D15' => t('Dublin 15'),
338
    'D16' => t('Dublin 16'),
339
    'D17' => t('Dublin 17'),
340
    'D18' => t('Dublin 18'),
341
    'D19' => t('Dublin 19'),
342
    'D20' => t('Dublin 20'),
343
    'D21' => t('Dublin 21'),
344
    'D22' => t('Dublin 22'),
345
    'D23' => t('Dublin 23'),
346
    'D24' => t('Dublin 24'),
347
    'G' => t('Co Galway'),
348
    'KY' => t('Co Kerry'),
349
    'KE' => t('Co Kildare'),
350
    'KK' => t('Co Kilkenny'),
351
    'LS' => t('Co Laois'),
352
    'LM' => t('Co Leitrim'),
353
    'LK' => t('Co Limerick'),
354
    'LD' => t('Co Longford'),
355
    'LH' => t('Co Louth'),
356
    'MO' => t('Co Mayo'),
357
    'MH' => t('Co Meath'),
358
    'MN' => t('Co Monaghan'),
359
    'OY' => t('Co Offaly'),
360
    'RN' => t('Co Roscommon'),
361
    'SO' => t('Co Sligo'),
362
    'TA' => t('Co Tipperary'),
363
    'WD' => t('Co Waterford'),
364
    'WH' => t('Co Westmeath'),
365
    'WX' => t('Co Wexford'),
366
    'WW' => t('Co Wicklow'),
367
  );
368
  $administrative_areas['IN'] = array(
369
    'AP' => t('Andhra Pradesh'),
370
    'AR' => t('Arunachal Pradesh'),
371
    'AS' => t('Assam'),
372
    'BR' => t('Bihar'),
373
    'CT' => t('Chhattisgarh'),
374
    'DD' => t('Daman & Diu'),
375
    'DN' => t('Dadra & Nagar Haveli'),
376
    'GA' => t('Goa'),
377
    'GJ' => t('Gujarat'),
378
    'HP' => t('Himachal Pradesh'),
379
    'HR' => t('Haryana'),
380
    'JH' => t('Jharkhand'),
381
    'JK' => t('Jammu & Kashmir'),
382
    'KA' => t('Karnataka'),
383
    'KL' => t('Kerala'),
384
    'MH' => t('Maharashtra'),
385
    'MN' => t('Manipur'),
386
    'ML' => t('Meghalaya'),
387
    'MP' => t('Madhya Pradesh'),
388
    'MZ' => t('Mizoram'),
389
    'NL' => t('Nagaland'),
390
    'OR' => t('Odisha'),
391
    'PB' => t('Punjab'),
392
    'RJ' => t('Rajasthan'),
393
    'SK' => t('Sikkim'),
394
    'TN' => t('Tamil Nadu'),
395
    'TG' => t('Telangana'),
396
    'TR' => t('Tripura'),
397
    'UP' => t('Uttar Pradesh'),
398
    'UT' => t('Uttarakhand'),
399
    'WB' => t('West Bengal'),
400
    ' ' => t('--'),
401
    'AN' => t('Andaman & Nicobar'),
402
    'CH' => t('Chandigarh'),
403
    'DN' => t('Dadra & Nagar Haveli'),
404
    'DD' => t('Daman & Diu'),
405
    'DL' => t('Delhi'),
406
    'LD' => t('Lakshadweep'),
407
    'PY' => t('Puducherry'),
408
  );
409
  $administrative_areas['IT'] = array(
410
    'AG' => t('Agrigento'),
411
    'AL' => t('Alessandria'),
412
    'AN' => t('Ancona'),
413
    'AO' => t('Aosta'),
414
    'AP' => t('Ascoli Piceno'),
415
    'AQ' => t("L'Aquila"),
416
    'AR' => t('Arezzo'),
417
    'AT' => t('Asti'),
418
    'AV' => t('Avellino'),
419
    'BA' => t('Bari'),
420
    'BG' => t('Bergamo'),
421
    'BI' => t('Biella'),
422
    'BL' => t('Belluno'),
423
    'BN' => t('Benevento'),
424
    'BO' => t('Bologna'),
425
    'BR' => t('Brindisi'),
426
    'BS' => t('Brescia'),
427
    'BT' => t('Barletta-Andria-Trani'),
428
    'BZ' => t('Bolzano/Bozen'),
429
    'CA' => t('Cagliari'),
430
    'CB' => t('Campobasso'),
431
    'CE' => t('Caserta'),
432
    'CH' => t('Chieti'),
433
    'CI' => t('Carbonia-Iglesias'),
434
    'CL' => t('Caltanissetta'),
435
    'CN' => t('Cuneo'),
436
    'CO' => t('Como'),
437
    'CR' => t('Cremona'),
438
    'CS' => t('Cosenza'),
439
    'CT' => t('Catania'),
440
    'CZ' => t('Catanzaro'),
441
    'EN' => t('Enna'),
442
    'FC' => t('Forlì-Cesena'),
443
    'FE' => t('Ferrara'),
444
    'FG' => t('Foggia'),
445
    'FI' => t('Firenze'),
446
    'FM' => t('Fermo'),
447
    'FR' => t('Frosinone'),
448
    'GE' => t('Genova'),
449
    'GO' => t('Gorizia'),
450
    'GR' => t('Grosseto'),
451
    'IM' => t('Imperia'),
452
    'IS' => t('Isernia'),
453
    'KR' => t('Crotone'),
454
    'LC' => t('Lecco'),
455
    'LE' => t('Lecce'),
456
    'LI' => t('Livorno'),
457
    'LO' => t('Lodi'),
458
    'LT' => t('Latina'),
459
    'LU' => t('Lucca'),
460
    'MB' => t('Monza e Brianza'),
461
    'MC' => t('Macerata'),
462
    'ME' => t('Messina'),
463
    'MI' => t('Milano'),
464
    'MN' => t('Mantova'),
465
    'MO' => t('Modena'),
466
    'MS' => t('Massa-Carrara'),
467
    'MT' => t('Matera'),
468
    'NA' => t('Napoli'),
469
    'NO' => t('Novara'),
470
    'NU' => t('Nuoro'),
471
    'OG' => t('Ogliastra'),
472
    'OR' => t('Oristano'),
473
    'OT' => t('Olbia-Tempio'),
474
    'PA' => t('Palermo'),
475
    'PC' => t('Piacenza'),
476
    'PD' => t('Padova'),
477
    'PE' => t('Pescara'),
478
    'PG' => t('Perugia'),
479
    'PI' => t('Pisa'),
480
    'PN' => t('Pordenone'),
481
    'PO' => t('Prato'),
482
    'PR' => t('Parma'),
483
    'PT' => t('Pistoia'),
484
    'PU' => t('Pesaro e Urbino'),
485
    'PV' => t('Pavia'),
486
    'PZ' => t('Potenza'),
487
    'RA' => t('Ravenna'),
488
    'RC' => t('Reggio Calabria'),
489
    'RE' => t('Reggio Emilia'),
490
    'RG' => t('Ragusa'),
491
    'RI' => t('Rieti'),
492
    'RM' => t('Roma'),
493
    'RN' => t('Rimini'),
494
    'RO' => t('Rovigo'),
495
    'SA' => t('Salerno'),
496
    'SI' => t('Siena'),
497
    'SO' => t('Sondrio'),
498
    'SP' => t('La Spezia'),
499
    'SR' => t('Siracusa'),
500
    'SS' => t('Sassari'),
501
    'SV' => t('Savona'),
502
    'TA' => t('Taranto'),
503
    'TE' => t('Teramo'),
504
    'TN' => t('Trento'),
505
    'TO' => t('Torino'),
506
    'TP' => t('Trapani'),
507
    'TR' => t('Terni'),
508
    'TS' => t('Trieste'),
509
    'TV' => t('Treviso'),
510
    'UD' => t('Udine'),
511
    'VA' => t('Varese'),
512
    'VB' => t('Verbano-Cusio-Ossola'),
513
    'VC' => t('Vercelli'),
514
    'VE' => t('Venezia'),
515
    'VI' => t('Vicenza'),
516
    'VR' => t('Verona'),
517
    'VS' => t('Medio Campidano'),
518
    'VT' => t('Viterbo'),
519
    'VV' => t('Vibo Valentia'),
520
  );
521
  $administrative_areas['JM'] = array(
522
    '13' => 'Clarendon',
523
    '09' => 'Hanover',
524
    '01' => 'Kingston',
525
    '12' => 'Manchester',
526
    '04' => 'Portland',
527
    '02' => 'St. Andrew',
528
    '06' => 'St. Ann',
529
    '14' => 'St. Catherine',
530
    '11' => 'St. Elizabeth',
531
    '08' => 'St. James',
532
    '05' => 'St. Mary',
533
    '03' => 'St. Thomas',
534
    '07' => 'Trelawny',
535
    '10' => 'Westmoreland',
536
  );
537
  $administrative_areas['JP'] = array(
538
    '01' => t('Hokkaido'),
539
    '02' => t('Aomori'),
540
    '03' => t('Iwate'),
541
    '04' => t('Miyagi'),
542
    '05' => t('Akita'),
543
    '06' => t('Yamagata'),
544
    '07' => t('Fukushima'),
545
    '08' => t('Ibaraki'),
546
    '09' => t('Tochigi'),
547
    '10' => t('Gunma'),
548
    '11' => t('Saitama'),
549
    '12' => t('Chiba'),
550
    '13' => t('Tokyo'),
551
    '14' => t('Kanagawa'),
552
    '15' => t('Niigata'),
553
    '16' => t('Toyama'),
554
    '17' => t('Ishikawa'),
555
    '18' => t('Fukui'),
556
    '19' => t('Yamanashi'),
557
    '20' => t('Nagano'),
558
    '21' => t('Gifu'),
559
    '22' => t('Shizuoka'),
560
    '23' => t('Aichi'),
561
    '24' => t('Mie'),
562
    '25' => t('Shiga'),
563
    '26' => t('Kyoto'),
564
    '27' => t('Osaka'),
565
    '28' => t('Hyogo'),
566
    '29' => t('Nara'),
567
    '30' => t('Wakayama'),
568
    '31' => t('Tottori'),
569
    '32' => t('Shimane'),
570
    '33' => t('Okayama'),
571
    '34' => t('Hiroshima'),
572
    '35' => t('Yamaguchi'),
573
    '36' => t('Tokushima'),
574
    '37' => t('Kagawa'),
575
    '38' => t('Ehime'),
576
    '39' => t('Kochi'),
577
    '40' => t('Fukuoka'),
578
    '41' => t('Saga'),
579
    '42' => t('Nagasaki'),
580
    '43' => t('Kumamoto'),
581
    '44' => t('Oita'),
582
    '45' => t('Miyazaki'),
583
    '46' => t('Kagoshima'),
584
    '47' => t('Okinawa'),
585
  );
586
  $administrative_areas['KR'] = array(
587
    '11' => t('Seoul'),
588
    '26' => t('Busan'),
589
    '27' => t('Daegu'),
590
    '30' => t('Daejeon'),
591
    '29' => t('Gwangju'),
592
    '28' => t('Incheon'),
593
    '31' => t('Ulsan'),
594
    '43' => t('Chungcheongbuk-do'),
595
    '44' => t('Chungcheongnam-do'),
596
    '42' => t('Gangwon-do'),
597
    '41' => t('Gyeonggi-do'),
598
    '47' => t('Gyeongsangbuk-do'),
599
    '48' => t('Gyeongsangnam-do'),
600
    '49' => t('Jeju-do'),
601
    '45' => t('Jeollabuk-do'),
602
    '46' => t('Jeollanam-do'),
603
    '50' => t('Sejong'),
604
  );
605
  $administrative_areas['MX'] = array(
606
    'AGU' => t('Aguascalientes'),
607
    'BCN' => t('Baja California'),
608
    'BCS' => t('Baja California Sur'),
609
    'CAM' => t('Campeche'),
610
    'COA' => t('Coahuila'),
611
    'COL' => t('Colima'),
612
    'CHP' => t('Chiapas'),
613
    'CHH' => t('Chihuahua'),
614
    'DIF' => t('Distrito Federal'),
615
    'DUG' => t('Durango'),
616
    'MEX' => t('Estado de México'),
617
    'GUA' => t('Guanajuato'),
618
    'GRO' => t('Guerrero'),
619
    'HID' => t('Hidalgo'),
620
    'JAL' => t('Jalisco'),
621
    'MIC' => t('Michoacán'),
622
    'MOR' => t('Morelos'),
623
    'NAY' => t('Nayarit'),
624
    'NLE' => t('Nuevo León'),
625
    'OAX' => t('Oaxaca'),
626
    'PUE' => t('Puebla'),
627
    'QUE' => t('Queretaro'),
628
    'ROO' => t('Quintana Roo'),
629
    'SLP' => t('San Luis Potosí'),
630
    'SIN' => t('Sinaloa'),
631
    'SON' => t('Sonora'),
632
    'TAB' => t('Tabasco'),
633
    'TAM' => t('Tamaulipas'),
634
    'TLA' => t('Tlaxcala'),
635
    'VER' => t('Veracruz'),
636
    'YUC' => t('Yucatán'),
637
    'ZAC' => t('Zacatecas'),
638
  );
639
  $administrative_areas['MY'] = array(
640
    '01' => t('Johor'),
641
    '02' => t('Kedah'),
642
    '03' => t('Kelantan'),
643
    '14' => t('Kuala Lumpur'),
644
    '15' => t('Labuan'),
645
    '04' => t('Melaka'),
646
    '05' => t('Negeri Sembilan'),
647
    '06' => t('Pahang'),
648
    '08' => t('Perak'),
649
    '09' => t('Perlis'),
650
    '07' => t('Pulau Pinang'),
651
    '16' => t('Putrajaya'),
652
    '12' => t('Sabah'),
653
    '13' => t('Sarawak'),
654
    '10' => t('Selangor'),
655
    '11' => t('Terengganu'),
656
    );
657
  $administrative_areas['PE'] = array(
658
    'AMA' => t('Amazonas'),
659
    'ANC' => t('Ancash'),
660
    'APU' => t('Apurimac'),
661
    'ARE' => t('Arequipa'),
662
    'AYA' => t('Ayacucho'),
663
    'CAJ' => t('Cajamarca'),
664
    'CAL' => t('Callao'),
665
    'CUS' => t('Cusco'),
666
    'HUV' => t('Huancavelica'),
667
    'HUC' => t('Huanuco'),
668
    'ICA' => t('Ica'),
669
    'JUN' => t('Junin'),
670
    'LAL' => t('La Libertad'),
671
    'LAM' => t('Lambayeque'),
672
    'LIM' => t('Lima'),
673
    'LOR' => t('Loreto'),
674
    'MDD' => t('Madre de Dios'),
675
    'MOQ' => t('Moquegua'),
676
    'PAS' => t('Pasco'),
677
    'PIU' => t('Piura'),
678
    'PUN' => t('Puno'),
679
    'SAM' => t('San Martin'),
680
    'TAC' => t('Tacna'),
681
    'TUM' => t('Tumbes'),
682
    'UCA' => t('Ucayali'),
683
  );
684
  $administrative_areas['RU'] = array(
685
    'MOW' => t('Moskva'),
686
    'SPE' => t('Sankt-Peterburg'),
687
    'AD' => t('Adygeya, Respublika'),
688
    'AL' => t('Altay, Respublika'),
689
    'BA' => t('Bashkortostan, Respublika'),
690
    'BU' => t('Buryatiya, Respublika'),
691
    'CE' => t('Chechenskaya Respublika'),
692
    'CU' => t('Chuvashskaya Respublika'),
693
    'DA' => t('Dagestan, Respublika'),
694
    'IN' => t('Ingushetiya, Respublika'),
695
    'KB' => t('Kabardino-Balkarskaya Respublika'),
696
    'KL' => t('Kalmykiya, Respublika'),
697
    'KC' => t('Karachayevo-Cherkesskaya Respublika'),
698
    'KR' => t('Kareliya, Respublika'),
699
    'KK' => t('Khakasiya, Respublika'),
700
    'KO' => t('Komi, Respublika'),
701
    'ME' => t('Mariy El, Respublika'),
702
    'MO' => t('Mordoviya, Respublika'),
703
    'SA' => t('Sakha, Respublika [Yakutiya]'),
704
    'SE' => t('Severnaya Osetiya-Alaniya, Respublika'),
705
    'TA' => t('Tatarstan, Respublika'),
706
    'TY' => t('Tyva, Respublika [Tuva]'),
707
    'UD' => t('Udmurtskaya Respublika'),
708
    'ALT' => t('Altayskiy kray'),
709
    'KAM' => t('Kamchatskiy kray'),
710
    'KHA' => t('Khabarovskiy kray'),
711
    'KDA' => t('Krasnodarskiy kray'),
712
    'KYA' => t('Krasnoyarskiy kray'),
713
    'PER' => t('Permskiy kray'),
714
    'PRI' => t('Primorskiy kray'),
715
    'STA' => t('Stavropolskiy kray'),
716
    'ZAB' => t('Zabaykalskiy kray'),
717
    'AMU' => t('Amurskaya oblast'),
718
    'ARK' => t('Arkhangelskaya oblast'),
719
    'AST' => t('Astrakhanskaya oblast'),
720
    'BEL' => t('Belgorodskaya oblast'),
721
    'BRY' => t('Bryanskaya oblast'),
722
    'CHE' => t('Chelyabinskaya oblast'),
723
    'IRK' => t('Irkutskaya oblast'),
724
    'IVA' => t('Ivanovskaya oblast'),
725
    'KGD' => t('Kaliningradskaya oblast'),
726
    'KLU' => t('Kaluzhskaya oblast'),
727
    'KEM' => t('Kemerovskaya oblast'),
728
    'KIR' => t('Kirovskaya oblast'),
729
    'KOS' => t('Kostromskaya oblast'),
730
    'KGN' => t('Kurganskaya oblast'),
731
    'KRS' => t('Kurskaya oblast'),
732
    'LEN' => t('Leningradskaya oblast'),
733
    'LIP' => t('Lipetskaya oblast'),
734
    'MAG' => t('Magadanskaya oblast'),
735
    'MOS' => t('Moskovskaya oblast'),
736
    'MUR' => t('Murmanskaya oblast'),
737
    'NIZ' => t('Nizhegorodskaya oblast'),
738
    'NGR' => t('Novgorodskaya oblast'),
739
    'NVS' => t('Novosibirskaya oblast'),
740
    'OMS' => t('Omskaya oblast'),
741
    'ORE' => t('Orenburgskaya oblast'),
742
    'ORL' => t('Orlovskaya oblast'),
743
    'PNZ' => t('Penzenskaya oblast'),
744
    'PSK' => t('Pskovskaya oblast'),
745
    'ROS' => t('Rostovskaya oblast'),
746
    'RYA' => t('Ryazanskaya oblast'),
747
    'SAK' => t('Sakhalinskaya oblast'),
748
    'SAM' => t('Samarskaya oblast'),
749
    'SAR' => t('Saratovskaya oblast'),
750
    'SMO' => t('Smolenskaya oblast'),
751
    'SVE' => t('Sverdlovskaya oblast'),
752
    'TAM' => t('Tambovskaya oblast'),
753
    'TOM' => t('Tomskaya oblast'),
754
    'TUL' => t('Tulskaya oblast'),
755
    'TVE' => t('Tverskaya oblast'),
756
    'TYU' => t('Tyumenskaya oblast'),
757
    'ULY' => t('Ulyanovskaya oblast'),
758
    'VLA' => t('Vladimirskaya oblast'),
759
    'VGG' => t('Volgogradskaya oblast'),
760
    'VLG' => t('Vologodskaya oblast'),
761
    'VOR' => t('Voronezhskaya oblast'),
762
    'YAR' => t('Yaroslavskaya oblast'),
763
    'YEV' => t('Yevreyskaya avtonomnaya oblast'),
764
    'CHU' => t('Chukotskiy avtonomnyy okrug'),
765
    'KHM' => t('Khanty-Mansiyskiy avtonomnyy okrug-Yugra'),
766
    'NEN' => t('Nenetskiy avtonomnyy okrug'),
767
    'YAN' => t('Yamalo-Nenetskiy avtonomnyy okrug'),
768
  );
769
  $administrative_areas['TR'] = array(
770
    '01' => t('Adana'),
771
    '02' => t('Adıyaman'),
772
    '03' => t('Afyon'),
773
    '04' => t('Ağrı'),
774
    '68' => t('Aksaray'),
775
    '05' => t('Amasya'),
776
    '06' => t('Ankara'),
777
    '07' => t('Antalya'),
778
    '75' => t('Ardahan'),
779
    '08' => t('Artvin'),
780
    '09' => t('Aydın'),
781
    '10' => t('Balıkesir'),
782
    '74' => t('Bartın'),
783
    '72' => t('Batman'),
784
    '69' => t('Bayburt'),
785
    '11' => t('Bilecik'),
786
    '12' => t('Bingöl'),
787
    '13' => t('Bitlis'),
788
    '14' => t('Bolu'),
789
    '15' => t('Burdur'),
790
    '16' => t('Bursa'),
791
    '17' => t('Çanakkale'),
792
    '18' => t('Çankırı'),
793
    '19' => t('Çorum'),
794
    '20' => t('Denizli'),
795
    '21' => t('Diyarbakır'),
796
    '81' => t('Düzce'),
797
    '22' => t('Edirne'),
798
    '23' => t('Elazığ'),
799
    '24' => t('Erzincan'),
800
    '25' => t('Erzurum'),
801
    '26' => t('Eskişehir'),
802
    '27' => t('Gaziantep'),
803
    '28' => t('Giresun'),
804
    '29' => t('Gümüşhane'),
805
    '30' => t('Hakkari'),
806
    '31' => t('Hatay'),
807
    '76' => t('Iğdır'),
808
    '32' => t('Isparta'),
809
    '34' => t('İstanbul'),
810
    '35' => t('İzmir'),
811
    '46' => t('Kahramanmaraş'),
812
    '78' => t('Karabük'),
813
    '70' => t('Karaman'),
814
    '36' => t('Kars'),
815
    '37' => t('Kastamonu'),
816
    '38' => t('Kayseri'),
817
    '71' => t('Kırıkkale'),
818
    '39' => t('Kırklareli'),
819
    '40' => t('Kırşehir'),
820
    '79' => t('Kilis'),
821
    '41' => t('Kocaeli'),
822
    '42' => t('Konya'),
823
    '43' => t('Kütahya'),
824
    '44' => t('Malatya'),
825
    '45' => t('Manisa'),
826
    '47' => t('Mardin'),
827
    '33' => t('Mersin'),
828
    '48' => t('Muğla'),
829
    '49' => t('Muş'),
830
    '50' => t('Nevşehir'),
831
    '51' => t('Niğde'),
832
    '52' => t('Ordu'),
833
    '80' => t('Osmaniye'),
834
    '53' => t('Rize'),
835
    '54' => t('Sakarya'),
836
    '55' => t('Samsun'),
837
    '56' => t('Siirt'),
838
    '57' => t('Sinop'),
839
    '58' => t('Sivas'),
840
    '63' => t('Şanlıurfa'),
841
    '73' => t('Şırnak'),
842
    '59' => t('Tekirdağ'),
843
    '60' => t('Tokat'),
844
    '61' => t('Trabzon'),
845
    '62' => t('Tunceli'),
846
    '64' => t('Uşak'),
847
    '65' => t('Van'),
848
    '77' => t('Yalova'),
849
    '66' => t('Yozgat'),
850
    '67' => t('Zonguldak'),
851
  );
852
  $administrative_areas['US'] = array(
853
    'AL' => t('Alabama'),
854
    'AK' => t('Alaska'),
855
    'AZ' => t('Arizona'),
856
    'AR' => t('Arkansas'),
857
    'CA' => t('California'),
858
    'CO' => t('Colorado'),
859
    'CT' => t('Connecticut'),
860
    'DE' => t('Delaware'),
861
    'DC' => t('District of Columbia'),
862
    'FL' => t('Florida'),
863
    'GA' => t('Georgia'),
864
    'HI' => t('Hawaii'),
865
    'ID' => t('Idaho'),
866
    'IL' => t('Illinois'),
867
    'IN' => t('Indiana'),
868
    'IA' => t('Iowa'),
869
    'KS' => t('Kansas'),
870
    'KY' => t('Kentucky'),
871
    'LA' => t('Louisiana'),
872
    'ME' => t('Maine'),
873
    'MD' => t('Maryland'),
874
    'MA' => t('Massachusetts'),
875
    'MI' => t('Michigan'),
876
    'MN' => t('Minnesota'),
877
    'MS' => t('Mississippi'),
878
    'MO' => t('Missouri'),
879
    'MT' => t('Montana'),
880
    'NE' => t('Nebraska'),
881
    'NV' => t('Nevada'),
882
    'NH' => t('New Hampshire'),
883
    'NJ' => t('New Jersey'),
884
    'NM' => t('New Mexico'),
885
    'NY' => t('New York'),
886
    'NC' => t('North Carolina'),
887
    'ND' => t('North Dakota'),
888
    'OH' => t('Ohio'),
889
    'OK' => t('Oklahoma'),
890
    'OR' => t('Oregon'),
891
    'PA' => t('Pennsylvania'),
892
    'RI' => t('Rhode Island'),
893
    'SC' => t('South Carolina'),
894
    'SD' => t('South Dakota'),
895
    'TN' => t('Tennessee'),
896
    'TX' => t('Texas'),
897
    'UT' => t('Utah'),
898
    'VT' => t('Vermont'),
899
    'VA' => t('Virginia'),
900
    'WA' => t('Washington'),
901
    'WV' => t('West Virginia'),
902
    'WI' => t('Wisconsin'),
903
    'WY' => t('Wyoming'),
904
    ' ' => t('--'),
905
    'AA' => t('Armed Forces (Americas)'),
906
    'AE' => t('Armed Forces (Europe, Canada, Middle East, Africa)'),
907
    'AP' => t('Armed Forces (Pacific)'),
908
    'AS' => t('American Samoa'),
909
    'FM' => t('Federated States of Micronesia'),
910
    'GU' => t('Guam'),
911
    'MH' => t('Marshall Islands'),
912
    'MP' => t('Northern Mariana Islands'),
913
    'PW' => t('Palau'),
914
    'PR' => t('Puerto Rico'),
915
    'VI' => t('Virgin Islands'),
916
  );
917
  $administrative_areas['VE'] = array(
918
    'Z' => t('Amazonas'),
919
    'B' => t('Anzoátegui'),
920
    'C' => t('Apure'),
921
    'D' => t('Aragua'),
922
    'E' => t('Barinas'),
923
    'F' => t('Bolívar'),
924
    'G' => t('Carabobo'),
925
    'H' => t('Cojedes'),
926
    'Y' => t('Delta Amacuro'),
927
    'W' => t('Dependencias Federales'),
928
    'A' => t('Distrito Federal'),
929
    'I' => t('Falcón'),
930
    'J' => t('Guárico'),
931
    'K' => t('Lara'),
932
    'L' => t('Mérida'),
933
    'M' => t('Miranda'),
934
    'N' => t('Monagas'),
935
    'O' => t('Nueva Esparta'),
936
    'P' => t('Portuguesa'),
937
    'R' => t('Sucre'),
938
    'S' => t('Táchira'),
939
    'T' => t('Trujillo'),
940
    'X' => t('Vargas'),
941
    'U' => t('Yaracuy'),
942
    'V' => t('Zulia'),
943
  );
944

  
945
  // Allow other modules to alter the administrative areas.
946
  drupal_alter('addressfield_administrative_areas', $administrative_areas);
947

  
948
  return isset($administrative_areas[$country_code]) ? $administrative_areas[$country_code] : null;
949
}
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.
drupal7/sites/all/modules/addressfield/addressfield.css
8 8
  margin-right: auto; /* LTR */
9 9
}
10 10

  
11
div.addressfield-container-inline.country-BR > div.form-item:first-child,
12
div.addressfield-container-inline.country-BR > div.form-item:last-child {
13
  clear: both;
14
  float: none;
15
  margin-right: auto; /* LTR */
16
}
17

  
18 11
/* Clear-fix markup for the inline container */
19 12
div.addressfield-container-inline:after {
20 13
  content: ".";
drupal7/sites/all/modules/addressfield/addressfield.devel_generate.inc
45 45
      if (is_resource($handle)) {
46 46
        $addresses = array();
47 47
        while (($buffer = fgets($handle)) !== false) {
48
          list($country, $administrative_area, $sub_administrative_area, $locality, $dependent_locality, $postal_code, $thoroughfare, $premise) = explode("\t", $buffer);
48
          list($country, $administrative_area, $sub_administrative_area, $locality, $dependent_locality, $postal_code, $thoroughfare, $premise, $sub_premise) = explode("\t", $buffer);
49 49
          $fields[] = array(
50 50
            'country' => ($country == 'NULL') ? NULL : trim($country),
51 51
            'administrative_area' => ($administrative_area == 'NULL') ? NULL : trim($administrative_area),
......
55 55
            'postal_code' => ($postal_code == 'NULL') ? NULL : trim($postal_code),
56 56
            'thoroughfare' => ($thoroughfare == 'NULL') ? NULL : trim($thoroughfare),
57 57
            'premise' => ($premise == 'NULL') ? NULL : trim($premise),
58
            'sub_premise' => ($sub_premise == 'NULL') ? NULL : trim($sub_premise),
58 59
          );
59 60
        }
60 61
      }
drupal7/sites/all/modules/addressfield/addressfield.info
9 9
files[] = views/addressfield_views_handler_field_country.inc
10 10
files[] = views/addressfield_views_handler_filter_country.inc
11 11

  
12
; Information added by Drupal.org packaging script on 2013-12-06
13
version = "7.x-1.0-beta5"
12
; Information added by Drupal.org packaging script on 2014-12-15
13
version = "7.x-1.0-rc1"
14 14
core = "7.x"
15 15
project = "addressfield"
16
datestamp = "1386309505"
16
datestamp = "1418653688"
17 17

  
drupal7/sites/all/modules/addressfield/addressfield.module
42 42
 */
43 43
function addressfield_module_implements_alter(&$implementations, $hook) {
44 44
  if ($hook == 'token_info_alter') {
45
    $group = $implementations['addressfield'];
46
    unset($implementations['addressfield']);
47
    $implementations['addressfield'] = $group;
45
    // Make sure that the $implementations list is populated before altering it,
46
    // to work around a crash experienced by some people (#2181001).
47
    if (isset($implementations['addressfield'])) {
48
      $group = $implementations['addressfield'];
49
      unset($implementations['addressfield']);
50
      $implementations['addressfield'] = $group;
51
    }
48 52
  }
49 53
}
50 54

  
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff