sao_tome_principe_678_1.cif 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function sao_tome_principe_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' => 678,
  12. 'country_name' => 'Sao Tome and Principe',
  13. 'country_iso_code_2' => 'ST',
  14. 'country_iso_code_3' => 'STP',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(678, 'ST-P', 'Príncipe'),
  21. array(678, 'ST-S', 'São Tomé'),
  22. );
  23. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  24. foreach ($zones as $zone) {
  25. $query->values($zone);
  26. }
  27. $query->execute();
  28. // Set address format
  29. uc_set_address_format(
  30. 678,
  31. "!company\r\n" .
  32. "!first_name !last_name\r\n" .
  33. "!street1\r\n" .
  34. "!street2\r\n" .
  35. "!city, !zone_name !postal_code\r\n" .
  36. "!country_name_if"
  37. );
  38. }