tonga_776_1.cif 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. function tonga_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' => 776,
  8. 'country_name' => 'Tonga',
  9. 'country_iso_code_2' => 'TO',
  10. 'country_iso_code_3' => 'TON',
  11. 'version' => 1,
  12. ))
  13. ->execute();
  14. // Make the entries in the zones table.
  15. $zones = array(
  16. array(776, 'TO-01', "'Eua"),
  17. array(776, 'TO-02', "Ha'apai"),
  18. array(776, 'TO-03', 'Niuas'),
  19. array(776, 'TO-04', 'Tongatapu'),
  20. array(776, 'TO-05', "Vava'u"),
  21. );
  22. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  23. foreach ($zones as $zone) {
  24. $query->values($zone);
  25. }
  26. $query->execute();
  27. // Set address format
  28. uc_set_address_format(
  29. 776,
  30. "!company\r\n".
  31. "!first_name !last_name\r\n".
  32. "!street1\r\n".
  33. "!street2\r\n".
  34. "!city, !zone_name !postal_code\r\n".
  35. "!country_name_if"
  36. );
  37. }