hungary_348_1.cif 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function hungary_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' => 348,
  12. 'country_name' => 'Hungary',
  13. 'country_iso_code_2' => 'HU',
  14. 'country_iso_code_3' => 'HUN',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(348, 'BUD', 'Budapest'),
  21. array(348, 'BAR', 'Baranya'),
  22. array(348, 'BKK', 'Bács-Kiskun'),
  23. array(348, 'BÉK', 'Békés'),
  24. array(348, 'BAZ', 'Borsod-Abaúj-Zemplén'),
  25. array(348, 'CSO', 'Csongrád'),
  26. array(348, 'FEJ', 'Fejér'),
  27. array(348, 'GYS', 'Gyõr-Sopron'),
  28. array(348, 'HAB', 'Hajdú-Bihar'),
  29. array(348, 'HEV', 'Heves'),
  30. array(348, 'JNS', 'Jász-Nagykun-Szolnok'),
  31. array(348, 'KOE', 'Komárom-Esztergom'),
  32. array(348, 'NOG', 'Nógrád'),
  33. array(348, 'PES', 'Pest'),
  34. array(348, 'SOM', 'Somogy'),
  35. array(348, 'SSB', 'Szabolcs-Szatmár-Bereg'),
  36. array(348, 'TOL', 'Tolna'),
  37. array(348, 'VAS', 'Vas'),
  38. array(348, 'VES', 'Veszprém'),
  39. array(348, 'ZAL', 'Zala'),
  40. );
  41. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  42. foreach ($zones as $zone) {
  43. $query->values($zone);
  44. }
  45. $query->execute();
  46. // Set address format
  47. uc_set_address_format(
  48. 348,
  49. "!company\r\n".
  50. "!first_name !last_name\r\n".
  51. "!street1\r\n".
  52. "!street2\r\n".
  53. "!city !zone_code !postal_code\r\n".
  54. "!country_name_if"
  55. );
  56. }