bermuda_60_1.cif 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function bermuda_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' => 60,
  12. 'country_name' => 'Bermuda',
  13. 'country_iso_code_2' => 'BM',
  14. 'country_iso_code_3' => 'BMU',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. // VALUES = %d for ID, Parent Country ID, Zone Abbreviation, Zone Name
  20. $zones = array(
  21. array(60, 'DEV', 'Devonshire'),
  22. array(60, 'HAM', 'Hamilton'),
  23. array(60, 'HA', 'Hamilton Municipality'),
  24. array(60, 'PAG', 'Paget'),
  25. array(60, 'PEM', 'Pembroke'),
  26. array(60, 'SG', 'Saint George Municipality'),
  27. array(60, 'SGE', 'Saint Georges'),
  28. array(60, 'SAN', 'Sandys'),
  29. array(60, 'SMI', 'Smiths'),
  30. array(60, 'SOU', 'Southampton'),
  31. array(60, 'WAR', 'Warwick'),
  32. );
  33. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  34. foreach ($zones as $zone) {
  35. $query->values($zone);
  36. }
  37. $query->execute();
  38. // Set address format
  39. uc_set_address_format(
  40. 60,
  41. "!company\r\n".
  42. "!first_name !last_name\r\n".
  43. "!street1\r\n".
  44. "!street2\r\n".
  45. "!city - !postal_code\r\n".
  46. "!zone_code\r\n".
  47. "!country_name_if"
  48. );
  49. }