12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- /**
- * Implements hook_install() using the name of the country as the base of
- * the function name.
- */
- function tunisia_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' => 788,
- 'country_name' => 'Tunisia',
- 'country_iso_code_2' => 'TN',
- 'country_iso_code_3' => 'TUN',
- 'version' => 1,
- ))
- ->execute();
- // Make the entries in the zones table.
- $zones = array(
- array(788, '31', 'Beja'),
- array(788, '13', 'Ben Arous'),
- array(788, '23', 'Bizerte'),
- array(788, '81', 'Gabes'),
- array(788, '71', 'Gafsa'),
- array(788, '32', 'Jendouba'),
- array(788, '41', 'Kairouan'),
- array(788, '42', 'Kasserine'),
- array(788, '73', 'Kebili'),
- array(788, '14', 'La Manouba'),
- array(788, '12', "L'Ariana"),
- array(788, '33', 'Le Kef'),
- array(788, '53', 'Mahdia'),
- array(788, '82', 'Medenine'),
- array(788, '52', 'Monastir'),
- array(788, '21', 'Nabeul'),
- array(788, '61', 'Sfax'),
- array(788, '43', 'Sidi Bouzid'),
- array(788, '34', 'Siliana'),
- array(788, '51', 'Sousse'),
- array(788, '83', 'Tataouine'),
- array(788, '72', 'Tozeur'),
- array(788, '11', 'Tunis'),
- array(788, '22', 'Zaghouan'),
- );
- $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(
- 788,
- "!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"
- );
- }
|