samoa_882_1.cif 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. function samoa_install() {
  3. // Make the entry in the country table.
  4. // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  5. db_insert('uc_countries')
  6. ->fields(array(
  7. 'country_id' => 882,
  8. 'country_name' => 'Samoa',
  9. 'country_iso_code_2' => 'WS',
  10. 'country_iso_code_3' => 'WSM',
  11. 'version' => 1,
  12. ))
  13. ->execute();
  14. // Make the entries in the zones table.
  15. $zones = array(
  16. array(882, 'WS-AA', "A'ana"),
  17. array(882, 'WS-AL', 'Aiga-i-le-Tai'),
  18. array(882, 'WS-AT', 'Atua'),
  19. array(882, 'WS-FA', "Fa'asaleleaga"),
  20. array(882, 'WS-GE', "Gaga'emauga"),
  21. array(882, 'WS-GI', 'Gagaifomauga'),
  22. array(882, 'WS-PA', 'Palauli'),
  23. array(882, 'WS-SA', "Satupa'itea"),
  24. array(882, 'WS-TU', 'Tuamasaga'),
  25. array(882, 'WS-VF', "Va'a-o-Fonoti"),
  26. array(882, 'WS-VS', 'Vaisigano'),
  27. );
  28. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  29. foreach ($zones as $zone) {
  30. $query->values($zone);
  31. }
  32. $query->execute();
  33. // Set address format
  34. uc_set_address_format(
  35. 882,
  36. "!company\r\n".
  37. "!first_name !last_name\r\n".
  38. "!street1\r\n".
  39. "!street2\r\n".
  40. "!city, !zone_name !postal_code\r\n".
  41. "!country_name_if"
  42. );
  43. }