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