montenegro_499_1.cif 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function montenegro_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' => 499,
  12. 'country_name' => 'Montenegro',
  13. 'country_iso_code_2' => 'ME',
  14. 'country_iso_code_3' => 'MNE',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(499, '01', 'Andrijevica'),
  21. array(499, '02', 'Bar'),
  22. array(499, '03', 'Berane'),
  23. array(499, '04', 'Bijelo Polje'),
  24. array(499, '05', 'Budva'),
  25. array(499, '06', 'Cetinje'),
  26. array(499, '07', 'Danilovgrad'),
  27. array(499, '08', 'Herceq-Novi'),
  28. array(499, '09', 'Kolasin'),
  29. array(499, '10', 'Kotor'),
  30. array(499, '11', 'Mojkovac'),
  31. array(499, '12', 'Niksic'),
  32. array(499, '13', 'Plav'),
  33. array(499, '14', 'Pljevlja'),
  34. array(499, '15', 'Pluzine'),
  35. array(499, '16', 'Podgorica'),
  36. array(499, '17', 'Rozaje'),
  37. array(499, '18', 'Savnik'),
  38. array(499, '19', 'Tivat'),
  39. array(499, '20', 'Ulcinj'),
  40. array(499, '21', 'Zabljak'),
  41. );
  42. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  43. foreach ($zones as $zone) {
  44. $query->values($zone);
  45. }
  46. $query->execute();
  47. // Set address format
  48. uc_set_address_format(
  49. 499,
  50. "!company\r\n".
  51. "!first_name !last_name\r\n".
  52. "!street1\r\n".
  53. "!street2\r\n".
  54. "!city !zone_code !postal_code\r\n".
  55. "!country_name_if"
  56. );
  57. }