luxembourg_442_1.cif 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function luxembourg_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' => 442,
  12. 'country_name' => 'Luxembourg',
  13. 'country_iso_code_2' => 'LU',
  14. 'country_iso_code_3' => 'LUX',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(442, 'L', 'Letzebuerg'),
  21. array(442, 'L', 'Luxembourg'),
  22. array(442, 'L', 'Luxemburg'),
  23. );
  24. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  25. foreach ($zones as $zone) {
  26. $query->values($zone);
  27. }
  28. $query->execute();
  29. // Set address format
  30. uc_set_address_format(
  31. 442,
  32. "!company\r\n" .
  33. "!first_name !last_name\r\n" .
  34. "!street1\r\n" .
  35. "!street2\r\n" .
  36. "!city !zone_code !postal_code\r\n" .
  37. "!country_name_if"
  38. );
  39. }