You are here

function globallink_view_log_submit in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink_settings.inc \globallink_view_log_submit()
  2. 7.6 globallink_settings.inc \globallink_view_log_submit()

Exports log.

File

./globallink_settings.inc, line 353

Code

function globallink_view_log_submit($form, &$form_state) {
  $from_date = $form_state['input']['log_view_date'];
  $from_date = globallink_convert_date_to_timestamp($from_date) / 1000;
  $destination = 'temporary://' . 'globallink_log.html';
  $my_file_obj = file_unmanaged_save_data(globallink_get_log_data($from_date), $destination, FILE_EXISTS_REPLACE);
  file_transfer($my_file_obj, array(
    'Content-Type' => 'application/htm',
    'Content-Disposition' => 'inline; filename="' . 'globallink_log.html' . '"',
    'Content-Length' => filesize($my_file_obj),
  ));
}