palau_585_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 palau_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' => 585,
  12. 'country_name' => 'Palau',
  13. 'country_iso_code_2' => 'PW',
  14. 'country_iso_code_3' => 'PLW',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(585, 'PW-002', 'Aimeliik'),
  21. array(585, 'PW-004', 'Airai'),
  22. array(585, 'PW-010', 'Angaur'),
  23. array(585, 'PW-050', 'Hatobohei'),
  24. array(585, 'PW-100', 'Kayangel'),
  25. array(585, 'PW-150', 'Koror'),
  26. array(585, 'PW-212', 'Melekeok'),
  27. array(585, 'PW-214', 'Ngaraard'),
  28. array(585, 'PW-218', 'Ngarchelong'),
  29. array(585, 'PW-222', 'Ngardmau'),
  30. array(585, 'PW-224', 'Ngatpang'),
  31. array(585, 'PW-226', 'Ngchesar'),
  32. array(585, 'PW-227', 'Ngeremlengui'),
  33. array(585, 'PW-228', 'Ngiwal'),
  34. array(585, 'PW-350', 'Peleliu'),
  35. array(585, 'PW-370', 'Sonsorol'),
  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. 585,
  45. "!company\r\n" .
  46. "!first_name !last_name\r\n" .
  47. "!street1\r\n" .
  48. "!street2\r\n" .
  49. "!city, !zone_name !postal_code\r\n" .
  50. "!country_name_if"
  51. );
  52. }