function word_link_exchange_write_file in Word Link 8
Same name and namespace in other branches
- 7.2 modules/word_link_exchange/word_link_exchange.module \word_link_exchange_write_file()
- 7 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 - Export for word_link_exchange_export_form.
File
- modules/
word_link_exchange/ word_link_exchange.module, line 526 - 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'][] = '';
}