<?php
// $Id: norway_578_1.cif,v 1.3.2.1 2010-11-02 06:42:17 tr Exp $

/**
* First implement hook_install() using the name of the country as the base of
* the function name.
*/
function norway_install() {
  // Make the entry in the country table.
  // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  db_query("INSERT INTO {uc_countries} VALUES (578, 'Norway', 'NO', 'NOR', 1)");

  // Make the entries in the zones table.  Use %d for the zone_id and the
  // function uc_get_zone_ids($num) as the second argument for db_query() where
  // $num is the number of zones in the INSERT query.
  // VALUES = %d for ID, Parent Country ID, Zone Abbreviation, Zone Name
  db_query("INSERT INTO {uc_zones} VALUES "
          ."(%d, 578, 'AK', 'Akershus'),"
          ."(%d, 578, 'AA', 'Aust-Agder'),"
          ."(%d, 578, 'BU', 'Buskerud'),"
          ."(%d, 578, 'FM', 'Finnmark'),"
          ."(%d, 578, 'HM', 'Hedmark'),"
          ."(%d, 578, 'HL', 'Hordaland'),"
          ."(%d, 578, 'MR', 'More og Romdal'),"
          ."(%d, 578, 'NT', 'Nord-Trondelag'),"
          ."(%d, 578, 'NL', 'Nordland'),"
          ."(%d, 578, 'OF', 'Ostfold'),"
          ."(%d, 578, 'OP', 'Oppland'),"
          ."(%d, 578, 'OL', 'Oslo'),"
          ."(%d, 578, 'RL', 'Rogaland'),"
          ."(%d, 578, 'ST', 'Sor-Trondelag'),"
          ."(%d, 578, 'SJ', 'Sogn og Fjordane'),"
          ."(%d, 578, 'SV', 'Svalbard'),"
          ."(%d, 578, 'TM', 'Telemark'),"
          ."(%d, 578, 'TR', 'Troms'),"
          ."(%d, 578, 'VA', 'Vest-Agder'),"
          ."(%d, 578, 'VF', 'Vestfold')",
        uc_get_zone_ids(20));

  // Use uc_set_address_format() with the country ID as the first argument and
  // an address format string as the second.  Documentation on address formats
  // is available at:
  // http://www.ubercart.org/ubercart_users_guide/country_settings#address_format_docs
  uc_set_address_format(578,
    "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
   ."\r\n!postal_code !city\r\n!country_name_if");
}
