togo_768_1.cif 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function togo_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' => 768,
  12. 'country_name' => 'Togo',
  13. 'country_iso_code_2' => 'TG',
  14. 'country_iso_code_3' => 'TGO',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(768, 'TG-C', 'Centre'),
  21. array(768, 'TG-K', 'Kara'),
  22. array(768, 'TG-M', 'Maritime (Région)'),
  23. array(768, 'TG-P', 'Plateaux'),
  24. array(768, 'TG-S', 'Savannes'),
  25. );
  26. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  27. foreach ($zones as $zone) {
  28. $query->values($zone);
  29. }
  30. $query->execute();
  31. // Set address format
  32. uc_set_address_format(
  33. 768,
  34. "!company\r\n" .
  35. "!first_name !last_name\r\n" .
  36. "!street1\r\n" .
  37. "!street2\r\n" .
  38. "!city, !zone_name !postal_code\r\n" .
  39. "!country_name_if"
  40. );
  41. }