central_african_republic_140_1.cif 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function central_african_republic_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' => 140,
  12. 'country_name' => 'Central African Republic',
  13. 'country_iso_code_2' => 'CF',
  14. 'country_iso_code_3' => 'CAF',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(140, 'BB', 'Bamingui-Bangoran'),
  21. array(140, 'BGF', 'Bangui'),
  22. array(140, 'BK', 'Basse-Kotto'),
  23. array(140, 'HK', 'Haute-Kotto'),
  24. array(140, 'HM', 'Haut-Mbomou'),
  25. array(140, 'KG', 'Kemo'),
  26. array(140, 'LB', 'Lobaye'),
  27. array(140, 'HS', 'Mambere-Kadei'),
  28. array(140, 'MB', 'Mbomou'),
  29. array(140, 'KB', 'Nana-Grebizi'),
  30. array(140, 'NM', 'Nana-Mambere'),
  31. array(140, 'MP', "Ombella-M'Poko"),
  32. array(140, 'UK', 'Ouaka'),
  33. array(140, 'AC', 'Ouham'),
  34. array(140, 'OP', 'Ouham-Pende'),
  35. array(140, 'SE', 'Sangha-Mbaere'),
  36. array(140, 'VK', 'Vakaga'),
  37. );
  38. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  39. foreach ($zones as $zone) {
  40. $query->values($zone);
  41. }
  42. $query->execute();
  43. // Set address format
  44. uc_set_address_format(
  45. 140,
  46. "!company\r\n" .
  47. "!first_name !last_name\r\n" .
  48. "!street1\r\n" .
  49. "!street2\r\n" .
  50. "!city, !zone_name !postal_code\r\n" .
  51. "!country_name_if"
  52. );
  53. }