|
@@ -30,7 +30,7 @@
|
-  |
+  |
@@ -73,19 +73,19 @@
-
+
|
-
+
|
-
+
|
-
+
|
-
+
|
((certificate_barcode))
diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php
index ad71914a73..9558325df3 100755
--- a/main/inc/lib/document.lib.php
+++ b/main/inc/lib/document.lib.php
@@ -4455,6 +4455,7 @@ class DocumentManager
public static function generateDefaultCertificate($courseData)
{
global $css, $img_dir, $default_course_dir, $js;
+ $codePath = api_get_path(REL_CODE_PATH);
$dir = '/certificates';
$title = get_lang('DefaultCertificate');
@@ -4467,8 +4468,8 @@ class DocumentManager
$fileType = 'file';
$templateContent = file_get_contents(api_get_path(SYS_CODE_PATH) . 'gradebook/certificate_template/template.html');
- $search = array('{CSS}', '{IMG_DIR}', '{REL_PATH}', '{COURSE_DIR}', '{WEB_CODE_PATH}');
- $replace = array($css.$js, $img_dir, api_get_path(REL_PATH), $default_course_dir, api_get_path(WEB_CODE_PATH));
+ $search = array('{CSS}', '{IMG_DIR}', '{REL_CODE_PATH}', '{COURSE_DIR}');
+ $replace = array($css.$js, $img_dir, $codePath, $default_course_dir);
$fileContent = str_replace($search, $replace, $templateContent);
diff --git a/main/inc/lib/pdf.lib.php b/main/inc/lib/pdf.lib.php
index 375d2b4704..3a2b76b6df 100755
--- a/main/inc/lib/pdf.lib.php
+++ b/main/inc/lib/pdf.lib.php
@@ -242,12 +242,19 @@ class PDF
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_fixed = str_replace(api_get_path(REL_PATH).'courses/'.$course_data['path'].'/document/', '', $old_src);
+
+ if (strpos($old_src, '/main/img') === false) {
+ if (api_get_path(REL_PATH) != '/') {
+ $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);
+ }
+
+ $new_path = $document_path.$old_src_fixed;
} else {
- $old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src);
+ $new_path = $old_src;
}
- $new_path = $document_path.$old_src_fixed;
+
$document_html= str_replace($old_src, $new_path, $document_html);
}
} else {
| | |