sierra_leone_694_1.cif 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function sierra_leone_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' => 694,
  12. 'country_name' => 'Sierra Leone',
  13. 'country_iso_code_2' => 'SL',
  14. 'country_iso_code_3' => 'SLE',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(694, 'SL-W', 'Western Area (Freetown)'),
  21. array(694, 'SL-E', 'Eastern'),
  22. array(694, 'SL-N', 'Northern'),
  23. array(694, 'SL-S', 'Southern'),
  24. );
  25. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  26. foreach ($zones as $zone) {
  27. $query->values($zone);
  28. }
  29. $query->execute();
  30. // Set address format
  31. uc_set_address_format(
  32. 694,
  33. "!company\r\n" .
  34. "!first_name !last_name\r\n" .
  35. "!street1\r\n" .
  36. "!street2\r\n" .
  37. "!city, !zone_name !postal_code\r\n" .
  38. "!country_name_if"
  39. );
  40. }