/[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.2.1, Wed Mar 18 04:12:49 2009 UTC revision 1.1.2.2, Sat Jun 27 19:27:20 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id$  // $Id: countries_api.module,v 1.1.2.1 2009/03/18 04:12:49 ngmaloney Exp $
3    
4  /**  /**
5   * Implementation of hook_help()   * Implementation of hook_help()
# Line 232  function countries_api_validate_format($ Line 232  function countries_api_validate_format($
232  }  }
233    
234  /**  /**
235  * Function to import regions from CSV file  * Function to import countries from CSV file
236  * TODO: provide arguments for specifying csv files  * TODO: provide arguments for specifying csv files
237  * @param $offset  * @param $offset
238  *   Int value for csv row offset.  *   Int value for csv row offset.
239  * @return void  * @return void
240  **/  **/
241  function countries_api_csv_import_countries($offset = 1) {  function countries_api_csv_import_countries($offset = 1) {
242          //Prepopulate regions table          //Prepopulate countries table
243    $handle = fopen(dirname(__FILE__) .'/data/countries.csv', 'r');    $handle = fopen(dirname(__FILE__) .'/data/countries.csv', 'r');
244    $index = 1;    $index = 1;
245    while (($row = fgetcsv($handle, 1024, ',')) !== FALSE) {    while (($row = fgetcsv($handle, 1024, ',')) !== FALSE) {
# Line 273  function countries_api_simpletest() { Line 273  function countries_api_simpletest() {
273  }  }
274    
275  /**  /**
276  * Function to flush (empty) the countries and regions database  * Function to flush (empty) the countries database
277  **/  **/
278  function _countries_api_flush() {  function _countries_api_flush() {
279      db_query("DELETE FROM {countries_api_countries}");      db_query("DELETE FROM {countries_api_countries}");
     db_query("DELETE FROM {countries_api_regions}");  
280  }  }

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

  ViewVC Help
Powered by ViewVC 1.1.2