12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- /**
- * Implements hook_install() using the name of the country as the base of
- * the function name.
- */
- function netherlands_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' => 528,
- 'country_name' => 'Netherlands',
- 'country_iso_code_2' => 'NL',
- 'country_iso_code_3' => 'NLD',
- 'version' => 1,
- ))
- ->execute();
- // Make the entries in the zones table.
- $zones = array(
- array(528, 'ZHL', 'Zuid-Holland'),
- array(528, 'NHL', 'Noord-Holland'),
- array(528, 'NBR', 'Noord-Brabant'),
- array(528, 'GLD', 'Gelderland'),
- array(528, 'UTR', 'Utrecht'),
- array(528, 'LIM', 'Limburg'),
- array(528, 'OVE', 'Overijssel'),
- array(528, 'FRL', 'Friesland'),
- array(528, 'GRO', 'Groningen'),
- array(528, 'DRE', 'Drenthe'),
- array(528, 'ZLD', 'Zeeland'),
- array(528, 'FLD', 'Flevoland'),
- );
- $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(
- 528,
- "!company\r\n" .
- "!first_name !last_name\r\n" .
- "!street1\r\n" .
- "!street2\r\n" .
- "!postal_code !city\r\n" .
- "!country_name_if"
- );
- }
|