marshall_islands_584_1.cif 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function marshall_islands_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' => 584,
  12. 'country_name' => 'Marshall Islands',
  13. 'country_iso_code_2' => 'MH',
  14. 'country_iso_code_3' => 'MHL',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(584, 'MH-ALL', 'Ailinglaplap'),
  21. array(584, 'MH-ALK', 'Ailuk'),
  22. array(584, 'MH-ARN', 'Arno'),
  23. array(584, 'MH-AUR', 'Aur'),
  24. array(584, 'MH-EBO', 'Ebon'),
  25. array(584, 'MH-ENI', 'Enewetak'),
  26. array(584, 'MH-JAB', 'Jabat'),
  27. array(584, 'MH-JAL', 'Jaluit'),
  28. array(584, 'MH-KIL', 'Kili'),
  29. array(584, 'MH-KWA', 'Kwajalein'),
  30. array(584, 'MH-LAE', 'Lae'),
  31. array(584, 'MH-LIB', 'Lib'),
  32. array(584, 'MH-LIK', 'Likiep'),
  33. array(584, 'MH-MAJ', 'Majuro'),
  34. array(584, 'MH-MAL', 'Maloelap'),
  35. array(584, 'MH-MEJ', 'Mejit'),
  36. array(584, 'MH-MIL', 'Mili'),
  37. array(584, 'MH-NMK', 'Namdrik'),
  38. array(584, 'MH-NMU', 'Namu'),
  39. array(584, 'MH-RON', 'Rongelap'),
  40. array(584, 'MH-UJA', 'Ujae'),
  41. array(584, 'MH-UTI', 'Utirik'),
  42. array(584, 'MH-WTH', 'Wotho'),
  43. array(584, 'MH-WTJ', 'Wotje'),
  44. );
  45. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  46. foreach ($zones as $zone) {
  47. $query->values($zone);
  48. }
  49. $query->execute();
  50. // Set address format
  51. uc_set_address_format(
  52. 584,
  53. "!company\r\n" .
  54. "!first_name !last_name\r\n" .
  55. "!street1\r\n" .
  56. "!street2\r\n" .
  57. "!city, !zone_name !postal_code\r\n" .
  58. "!country_name_if"
  59. );
  60. }