| 1 |
|
<?php |
| 2 |
|
// $Id: bahrain__1.cif,v 1.3.2.5 2009/10/20 148:51:20 fpcreator2000 Exp $ |
| 3 |
|
|
| 4 |
|
/** |
| 5 |
|
* First implement hook_install() using the name of the country as the base of |
| 6 |
|
* the function name. |
| 7 |
|
*/ |
| 8 |
|
function bahrain_install() { |
| 9 |
|
// Make the entry in the country table. |
| 10 |
|
// VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version |
| 11 |
|
db_query("INSERT INTO {uc_countries} VALUES ('48', 'Bahrain', 'DZ', 'DZA', 2)"); |
| 12 |
|
|
| 13 |
|
// Make the entries in the zones table. Use %d for the zone_id and the |
| 14 |
|
// VALUES = Parent Country ID, Zone Abbreviation, Zone Name |
| 15 |
|
$zones = array( |
| 16 |
|
array(48, 'AHD', 'Al Hidd'), |
| 17 |
|
array(48, 'AMQ', 'Al Muharraq'), |
| 18 |
|
array(48, 'AMH', 'Al Manamah'), |
| 19 |
|
array(48, 'JHA', 'Jidd Hafs'), |
| 20 |
|
array(48, 'AMS', 'Al Mintaqah Ash Shamaliyah'), |
| 21 |
|
array(48, 'STH', 'Sitrah'), |
| 22 |
|
array(48, 'AMW', 'Al Mintaqah al Wusta'), |
| 23 |
|
array(48, 'MAT', 'Madinatisa'), |
| 24 |
|
array(48, 'ARR', 'Ar Rifae'), |
| 25 |
|
array(48, 'AMG', 'Al Mintaqah al Gharbiyah'), |
| 26 |
|
array(48, 'AMJ', 'Al Mintaqah Juzur Hawar'), |
| 27 |
|
array(48, 'MAH', 'Madinat Hamad'), |
| 28 |
|
); |
| 29 |
|
|
| 30 |
|
foreach ($zones as $zone) { |
| 31 |
|
db_query("INSERT INTO {uc_zones} (zone_country_id, zone_code, zone_name) VALUES (%d, '%s', '%s')", $zone); |
| 32 |
|
} |
| 33 |
|
|
| 34 |
|
// Use uc_set_address_format() with the country ID as the first argument and |
| 35 |
|
// an address format string as the second. Documentation on address formats |
| 36 |
|
// is available at: |
| 37 |
|
// http://www.ubercart.org/ubercart_users_guide/country_settings#address_format_docs |
| 38 |
|
uc_set_address_format(48, "!company\r\n!first_name !last_name\r\n!street1 !street2\r\n!zone_name !postal_code\r\n\r\n!country_name_if"); |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
/** |
| 42 |
|
* If necessary, implement hook_update() with $version being the only argument. |
| 43 |
|
* Add a new case for each version update, and be sure to always include the |
| 44 |
|
* latest changes in the install function. |
| 45 |
|
*/ |
| 46 |
|
function bahrain_update($version) { |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
/** |
| 50 |
|
* If necessary, implement hook_uninstall(). This requires no argument. The |
| 51 |
|
* store module automatically removes rows from the country and zones tables |
| 52 |
|
* related to the country, and it unsets the address format. This function is |
| 53 |
|
* only necessary for other things you may have included in your country's |
| 54 |
|
* installation process. |
| 55 |
|
*/ |
| 56 |
|
function bahrain_uninstall() { |
| 57 |
|
} |