angola_24_1.cif 1.5 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 angola_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' => 24,
  12. 'country_name' => 'Angola',
  13. 'country_iso_code_2' => 'AO',
  14. 'country_iso_code_3' => 'AGO',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(24, 'BGO', 'Bengo'),
  21. array(24, 'BGU', 'Benguela'),
  22. array(24, 'BIE', 'Bie'),
  23. array(24, 'CAB', 'Cabinda'),
  24. array(24, 'CCU', 'Cuando Cubango'),
  25. array(24, 'CNO', 'Cuanza Norte'),
  26. array(24, 'CUS', 'Cuanza Sul'),
  27. array(24, 'CNN', 'Cunene'),
  28. array(24, 'HUA', 'Huambo'),
  29. array(24, 'HUI', 'Huila'),
  30. array(24, 'LUA', 'Luanda'),
  31. array(24, 'LNO', 'Lunda Norte'),
  32. array(24, 'LSU', 'Lunda Sul'),
  33. array(24, 'MAL', 'Malanje'),
  34. array(24, 'MOX', 'Moxico'),
  35. array(24, 'NAM', 'Namibe'),
  36. array(24, 'UIG', 'Uige'),
  37. array(24, 'ZAI', 'Zaire'),
  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. 24,
  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. }