mediamosa_batch_jobs_log

Versions
mediamosa-21
mediamosa_batch_jobs_log()

Callback function to display the contents of a log.

Return value

<string>

Code

sites/all/modules/mediamosa/modules/batch_jobs/mediamosa_batch_jobs.callbacks.inc, line 144

<?php
function mediamosa_batch_jobs_log() {
  $filename = check_plain(urldecode(arg(5)));
  $usr = check_plain(urldecode(arg(6)));
  $path = mediamosa_configuration_storage::get_full_history_path() . DIRECTORY_SEPARATOR . basename($filename, '.'. mediamosa_settings::FTP_HISTORY_EXTENTION) .'.log';
  if (!file_exists($path)) {
    $path = mediamosa_configuration_storage::get_full_history_path() . DIRECTORY_SEPARATOR . $usr . '_' . basename($filename, '.'. mediamosa_settings::FTP_QUEUE_EXTENTION) .'.log';
  }

  drupal_set_title(t('Log ') . $filename);

  $body = nl2br(htmlentities(file_get_contents($path)));
  $body .= l(t('Return to batch job queue'), 'admin/mediamosa/browse/ftp_batch/queue');

  return $body;
}
?>