belize_84_1.cif 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function belize_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' => 84,
  12. 'country_name' => 'Belize',
  13. 'country_iso_code_2' => 'BZ',
  14. 'country_iso_code_3' => 'BLZ',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(84, 'BZ', 'Belize'),
  21. array(84, 'CY', 'Cayo'),
  22. array(84, 'CZL', 'Corozal'),
  23. array(84, 'OW', 'Orange Walk'),
  24. array(84, 'SC', 'Stann Creek'),
  25. array(84, 'TOL', 'Toledo'),
  26. );
  27. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  28. foreach ($zones as $zone) {
  29. $query->values($zone);
  30. }
  31. $query->execute();
  32. // Set address format
  33. uc_set_address_format(
  34. 84,
  35. "!company\r\n".
  36. "!first_name !last_name\r\n".
  37. "!street1\r\n".
  38. "!street2\r\n".
  39. "!city !zone_code !postal_code\r\n".
  40. "!country_name_if"
  41. );
  42. }