germany_276_1.cif 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function germany_install() {
  7. // Make the entry in the country table.
  8. // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  9. db_insert('uc_countries')
  10. ->fields(array(
  11. 'country_id' => 276,
  12. 'country_name' => 'Germany',
  13. 'country_iso_code_2' => 'DE',
  14. 'country_iso_code_3' => 'DEU',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(276, 'BAW', 'Baden-Württemberg'),
  21. array(276, 'BAY', 'Bayern'),
  22. array(276, 'BER', 'Berlin'),
  23. array(276, 'BRG', 'Brandenburg'),
  24. array(276, 'BRE', 'Bremen'),
  25. array(276, 'HAM', 'Hamburg'),
  26. array(276, 'HES', 'Hessen'),
  27. array(276, 'MEC', 'Mecklenburg-Vorpommern'),
  28. array(276, 'NDS', 'Niedersachsen'),
  29. array(276, 'NRW', 'Nordrhein-Westfalen'),
  30. array(276, 'RHE', 'Rheinland-Pfalz'),
  31. array(276, 'SAR', 'Saarland'),
  32. array(276, 'SAS', 'Sachsen'),
  33. array(276, 'SAC', 'Sachsen-Anhalt'),
  34. array(276, 'SCN', 'Schleswig-Holstein'),
  35. array(276, 'THE', 'Thüringen'),
  36. );
  37. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  38. foreach ($zones as $zone) {
  39. $query->values($zone);
  40. }
  41. $query->execute();
  42. // Set address format
  43. uc_set_address_format(
  44. 276,
  45. "!company\r\n" .
  46. "!first_name !last_name\r\n" .
  47. "!street1\r\n" .
  48. "!street2\r\n" .
  49. "!postal_code !city\r\n" .
  50. "!country_name_if"
  51. );
  52. }