Fixing export to PDF in the LP list

skala
Julio Montoya 15 years ago
parent e1afbc520a
commit cf5ac4041e
  1. 7
      main/inc/lib/pdf.lib.php

@ -55,6 +55,7 @@ class PDF {
$course_data = api_get_course_info($course_code);
}
//clean styles and javascript document
$clean_search = array (
'@<script[^>]*?>.*?</script>@si',
@ -70,7 +71,7 @@ class PDF {
// then print the title in the PDF
if (is_array($html_file) && isset($html_file['title'])) {
$html_title = $html_file['title'];
$html_file = $html_file['path'];
$html_file = $html_file['path'];
} else {
//we suppose we've only been sent a file path
$html_title = basename($html_file);
@ -82,10 +83,12 @@ class PDF {
}
continue;
}
if (!file_exists($html_file)) {
//the file doesn't exist, skip
continue;
}
//it's not a chapter but the file exists, print its title
if ($print_title) {
$this->pdf->WriteHTML('<html><body><h2>'.$html_title.'</h2></body></html>',2);
@ -97,7 +100,7 @@ class PDF {
$filename =str_replace('_',' ',$filename);
$extension = $file_info['extension'];
if (!($extension == 'html' || $extension == 'htm')) {
return false;
continue;
}
if ($extension == 'html') {
$filename =basename($filename,'.html');

Loading…
Cancel
Save