You are here

function word_link_exchange_write_file in Word Link 7

Same name and namespace in other branches
  1. 8 modules/word_link_exchange/word_link_exchange.module \word_link_exchange_write_file()
  2. 7.2 modules/word_link_exchange/word_link_exchange.module \word_link_exchange_write_file()

Write data to csv file.

1 string reference to 'word_link_exchange_write_file'
word_link_exchange_export_form_submit in modules/word_link_exchange/word_link_exchange.module
Submit for export form.

File

modules/word_link_exchange/word_link_exchange.module, line 573
Code for the Word link exchange module.

Code

function word_link_exchange_write_file($string, $file, &$context) {
  if (empty($context['results']['file'])) {
    $context['results']['file'] = $file;
  }

  // Write string to file.
  if (file_put_contents($file->filepath, $string, FILE_APPEND) === FALSE) {
    drupal_set_message(t('The file could not be created.'), 'error');
  }

  // It will be used to count total strings.
  $context['results']['total'][] = '';
}