You are here

function _filebrowser_save_description_file in Filebrowser 8

Same name and namespace in other branches
  1. 6.2 includes/metadata.inc \_filebrowser_save_description_file()
  2. 7.4 filebrowser.common.inc \_filebrowser_save_description_file()
  3. 7.2 filebrowser.common.inc \_filebrowser_save_description_file()
  4. 7.3 filebrowser.common.inc \_filebrowser_save_description_file()
1 call to _filebrowser_save_description_file()
filebrowser_filebrowser_metadata_set in ./filebrowser.module

File

./filebrowser.common.inc, line 510
Misc filebrowser common functions.

Code

function _filebrowser_save_description_file($data) {
  $output = array();
  foreach ($data['data'] as $key => $value) {
    $value = str_replace(array(
      "\r\n",
      "\n",
    ), array(
      '\\n',
      '\\n',
    ), $value);
    $output[] = "\"{$key}\"\t{$value}";
  }
  file_put_contents($data['file'], implode("\n", $output));
}