1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- /**
- * Implements hook_install() using the name of the country as the base of
- * the function name.
- */
- function malaysia_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' => 458,
- 'country_name' => 'Malaysia',
- 'country_iso_code_2' => 'MY',
- 'country_iso_code_3' => 'MYS',
- 'version' => 1,
- ))
- ->execute();
- // Make the entries in the zones table.
- $zones = array(
- array(458, 'JHR', 'Johor'),
- array(458, 'KDH', 'Kedah'),
- array(458, 'KTN', 'Kelantan'),
- array(458, 'MLK', 'Melaka'),
- array(458, 'NSN', 'Negeri Sembilan'),
- array(458, 'PHG', 'Pahang'),
- array(458, 'PNG', 'Pulau Pinang'),
- array(458, 'PRK', 'Perak'),
- array(458, 'PLS', 'Perlis'),
- array(458, 'SGR', 'Selangor'),
- array(458, 'TRG', 'Terengganu'),
- array(458, 'SBH', 'Sabah'),
- array(458, 'SRW', 'Sarawak'),
- array(458, 'KUL', 'Kuala Lumpur'),
- array(458, 'LBN', 'Labuan'),
- array(458, 'PJY', 'Putrajaya'),
- );
- $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(
- 458,
- "!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"
- );
- }
|