123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- /**
- * Implements hook_install() using the name of the country as the base of
- * the function name.
- */
- function bhutan_install() {
- // Make the entry in the country table.
- // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
- db_insert('uc_countries')
- ->fields(array(
- 'country_id' => 64,
- 'country_name' => 'Bhutan',
- 'country_iso_code_2' => 'BT',
- 'country_iso_code_3' => 'BTN',
- 'version' => 1,
- ))
- ->execute();
- // Make the entries in the zones table.
- $zones = array(
- array(64, 'GA', 'Gasa'),
- array(64, 'TY', 'Tashi Yangtse'),
- array(64, '11', 'Paro'),
- array(64, '12', 'Chhukha'),
- array(64, '13', 'Ha'),
- array(64, '14', 'Samchi'),
- array(64, '15', 'Thimphu'),
- array(64, '21', 'Chirang'),
- array(64, '22', 'Daga'),
- array(64, '23', 'Punakha'),
- array(64, '24', 'Wangdi Phodrang'),
- array(64, '31', 'Geylegphug'),
- array(64, '32', 'Tongsa'),
- array(64, '33', 'Bumthang'),
- array(64, '34', 'Shemgang'),
- array(64, '41', 'Tashigang'),
- array(64, '42', 'Mongar'),
- array(64, '43', 'Pemagatsel'),
- array(64, '44', 'Lhuntshi'),
- array(64, '45', 'Samdrup Jongkhar'),
- );
- $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
- foreach ($zones as $zone) {
- $query->values($zone);
- }
- $query->execute();
- // Set address format
- uc_set_address_format(
- 64,
- "!company\r\n" .
- "!first_name !last_name\r\n" .
- "!street1\r\n" .
- "!street2\r\n" .
- "!city, !zone_code !postal_code\r\n" .
- "!country_name_if"
- );
- }
|