skala
Yannick Warnier 12 years ago
commit 4e3c506162
  1. 3
      main/coursecopy/classes/CourseArchiver.class.php
  2. 6
      main/inc/lib/pdf.lib.php

@ -46,7 +46,8 @@ class CourseArchiver {
$course_info_file = $backup_dir . 'course_info.dat';
$zip_dir = api_get_path(SYS_ARCHIVE_PATH);
$user = api_get_user_info();
$zip_file = $user['user_id'] . '_' . $course->code . '_' . date("Ymd-His") . '.zip';
$date = new DateTime(api_get_local_time());
$zip_file = $user['user_id'] . '_' . $course->code . '_' . $date->format('Ymd-His') . '.zip';
$php_errormsg = '';
$res = @mkdir($backup_dir, $perm_dirs);
if ($res === false) {

@ -213,10 +213,12 @@ if($complete_style === false) { error_log(__FUNCTION__.' with no style'); }
$old_src = $item->getAttribute('src');
if (strpos($old_src, 'http') === false) {
if (strpos($old_src, '/main/default_course_document') === false) {
$old_src_fixed = '';
if (api_get_path(REL_PATH) != '/') {
$old_src = str_replace(api_get_path(REL_PATH), '', $old_src);
$old_src_fixed = str_replace(api_get_path(REL_PATH).'courses/'.$course_data['path'].'/document/', '', $old_src);
} else {
$old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src);
}
$old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src);
$new_path = $document_path.$old_src_fixed;
$document_html= str_replace($old_src, $new_path, $document_html);
}

Loading…
Cancel
Save