/[drupal]/contributions/modules/countries_api/countries_api.module
ViewVC logotype

Diff of /contributions/modules/countries_api/countries_api.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.4.3, Sat Jun 27 19:22:13 2009 UTC revision 1.1.4.4, Sat Jun 27 19:26:38 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: countries_api.module,v 1.1.4.2 2009/05/17 10:51:05 mrfelton Exp $  // $Id: countries_api.module,v 1.1.4.3 2009/06/27 19:22:13 mrfelton Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 239  function countries_api_validate_format($ Line 239  function countries_api_validate_format($
239  }  }
240    
241  /**  /**
242  * Function to import regions from CSV file  * Function to import countries from CSV file
243  * TODO: provide arguments for specifying csv files  * TODO: provide arguments for specifying csv files
244  * TODO: setup permissions  * TODO: setup permissions
245  * @param $offset  * @param $offset
# Line 247  function countries_api_validate_format($ Line 247  function countries_api_validate_format($
247  * @return void  * @return void
248  **/  **/
249  function countries_api_csv_import_countries($offset=1) {  function countries_api_csv_import_countries($offset=1) {
250    //Prepopulate regions table    //Prepopulate countries table
251    $handle = fopen(dirname(__FILE__) ."/data/countries.csv", "r");    $handle = fopen(dirname(__FILE__) ."/data/countries.csv", "r");
252    $index = 1;    $index = 1;
253    while (($row = fgetcsv($handle, 1024, ",")) !== FALSE) {    while (($row = fgetcsv($handle, 1024, ",")) !== FALSE) {
# Line 271  function countries_api_csv_import_countr Line 271  function countries_api_csv_import_countr
271  }  }
272    
273  /**  /**
274  * Function to flush (empty) the countries and regions database  * Function to flush (empty) the countries database
275  **/  **/
276  function _countries_api_flush() {  function _countries_api_flush() {
277      db_query("DELETE FROM {countries_api_countries}");      db_query("DELETE FROM {countries_api_countries}");

Legend:
Removed from v.1.1.4.3  
changed lines
  Added in v.1.1.4.4

  ViewVC Help
Powered by ViewVC 1.1.2