mauritius_480_1.cif 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function mauritius_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' => 480,
  12. 'country_name' => 'Mauritius',
  13. 'country_iso_code_2' => 'MU',
  14. 'country_iso_code_3' => 'MUS',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(480, 'AG', 'Agalega Islands'),
  21. array(480, 'BR', 'Beau Bassin-Rose'),
  22. array(480, 'BL', 'Black River'),
  23. array(480, 'CC', 'Cargados Carajos'),
  24. array(480, 'CU', 'Curepipe'),
  25. array(480, 'FL', 'Flacq'),
  26. array(480, 'GP', 'Grand Port'),
  27. array(480, 'MO', 'Moka'),
  28. array(480, 'PA', 'Pamplemousses'),
  29. array(480, 'PW', 'Plaines Wilhems'),
  30. array(480, 'PL', 'Port Louis'),
  31. array(480, 'PU', 'Port Louis'),
  32. array(480, 'QB', 'Quatre Bornes'),
  33. array(480, 'RR', 'Riviere du Rempart'),
  34. array(480, 'RO', 'Rodrigues Island'),
  35. array(480, 'CC', 'Saint Brandon Islands'),
  36. array(480, 'SA', 'Savanne'),
  37. array(480, 'VP', 'Vacoas-Phoenix'),
  38. );
  39. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  40. foreach ($zones as $zone) {
  41. $query->values($zone);
  42. }
  43. $query->execute();
  44. // Set address format
  45. uc_set_address_format(
  46. 480,
  47. "!company\r\n" .
  48. "!first_name !last_name\r\n" .
  49. "!street1\r\n" .
  50. "!street2\r\n" .
  51. "!city !zone_code !postal_code\r\n" .
  52. "!country_name_if"
  53. );
  54. }