somalia_706_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 somalia_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' => 706,
  12. 'country_name' => 'Somalia',
  13. 'country_iso_code_2' => 'SO',
  14. 'country_iso_code_3' => 'SOM',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(706, 'SO-AW', 'Awdal'),
  21. array(706, 'SO-BK', 'Bakool'),
  22. array(706, 'SO-BN', 'Banaadir'),
  23. array(706, 'SO-BR', 'Bari'),
  24. array(706, 'SO-BY', 'Bay'),
  25. array(706, 'SO-GA', 'Galguduud'),
  26. array(706, 'SO-GE', 'Gedo'),
  27. array(706, 'SO-HI', 'Hiiraan'),
  28. array(706, 'SO-JD', 'Jubbada Dhexe'),
  29. array(706, 'SO-JH', 'Jubbada Hoose'),
  30. array(706, 'SO-MU', 'Mudug'),
  31. array(706, 'SO-NU', 'Nugaal'),
  32. array(706, 'SO-SA', 'Sanaag'),
  33. array(706, 'SO-SD', 'Shabeellaha Dhexe'),
  34. array(706, 'SO-SH', 'Shabeellaha Hoose'),
  35. array(706, 'SO-SO', 'Sool'),
  36. array(706, 'SO-TO', 'Togdheer'),
  37. array(706, 'SO-WO', 'Woqooyi Galbeed'),
  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. 706,
  47. "!company\r\n" .
  48. "!first_name !last_name\r\n" .
  49. "!street1\r\n" .
  50. "!street2\r\n" .
  51. "!city, !zone_name !postal_code\r\n" .
  52. "!country_name_if"
  53. );
  54. }