Merge branch '7322' of https://github.com/AngelFQC/chamilo-lms into AngelFQC-7322

1.9.x
Yannick Warnier 11 years ago
commit a9800e438c
  1. 22
      main/gradebook/certificate_template/template.html
  2. 5
      main/inc/lib/document.lib.php
  3. 7
      main/inc/lib/pdf.lib.php

@ -4,23 +4,23 @@
</head> </head>
<body style="background-color: #fff;"> <body style="background-color: #fff;">
<div style="width: 1072px;margin-left: auto;margin-right: auto;"> <div style="width: 1072px;margin-left: auto;margin-right: auto;">
<div style="background: url('{WEB_CODE_PATH}img/paper.png') repeat;padding: 10px;"> <div style="background: url('{REL_CODE_PATH}img/paper.png') repeat;padding: 10px;">
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td> <td>
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
<td> <td>
<img src="{WEB_CODE_PATH}img/side-bar.png" alt="Side bar"> <img src="{REL_CODE_PATH}img/side-bar.png" alt="Side bar">
</td> </td>
<td> <td>
<img src="{WEB_CODE_PATH}img/side-top-a.png" alt="Side top element a"> <img src="{REL_CODE_PATH}img/side-top-a.png" alt="Side top element a">
</td> </td>
<td> <td>
<img src="{WEB_CODE_PATH}img/certificate-logo.png" alt="Certificate logo"> <img src="{REL_CODE_PATH}img/certificate-logo.png" alt="Certificate logo">
</td> </td>
<td> <td>
<img src="{WEB_CODE_PATH}img/side-top-b.png" alt="Side top element b"> <img src="{REL_CODE_PATH}img/side-top-b.png" alt="Side top element b">
</td> </td>
</tr> </tr>
</table> </table>
@ -30,7 +30,7 @@
<td> <td>
<table width="100%" cellpadding="0" cellspacing="0"> <table width="100%" cellpadding="0" cellspacing="0">
<tr> <tr>
<td><img src="{WEB_CODE_PATH}img/side-bar-button.png" alt="Side bar button"></td> <td><img src="{REL_CODE_PATH}img/side-bar-button.png" alt="Side bar button"></td>
<td> <td>
<table cellpadding="0" cellspacing="0" width="100%"> <table cellpadding="0" cellspacing="0" width="100%">
<tr> <tr>
@ -73,19 +73,19 @@
<table cellpadding="0" cellspacing="0" align="center"> <table cellpadding="0" cellspacing="0" align="center">
<tr> <tr>
<td> <td>
<img src="{WEB_CODE_PATH}img/signature1.png" alt="Signature 1"> <img src="{REL_CODE_PATH}img/signature1.png" alt="Signature 1">
</td> </td>
<td> <td>
<img src="{WEB_CODE_PATH}img/blank.png" alt="blank"> <img src="{REL_CODE_PATH}img/blank.png" alt="blank">
</td> </td>
<td> <td>
<img src="{WEB_CODE_PATH}img/signature2.png" alt="firm02"> <img src="{REL_CODE_PATH}img/signature2.png" alt="firm02">
</td> </td>
<td> <td>
<img src="{WEB_CODE_PATH}img/certified.png" alt="certified"> <img src="{REL_CODE_PATH}img/certified.png" alt="certified">
</td> </td>
<td> <td>
<img src="{WEB_CODE_PATH}img/blank.png" alt="blank"> <img src="{REL_CODE_PATH}img/blank.png" alt="blank">
</td> </td>
<td> <td>
((certificate_barcode)) ((certificate_barcode))

@ -4455,6 +4455,7 @@ class DocumentManager
public static function generateDefaultCertificate($courseData) public static function generateDefaultCertificate($courseData)
{ {
global $css, $img_dir, $default_course_dir, $js; global $css, $img_dir, $default_course_dir, $js;
$codePath = api_get_path(REL_CODE_PATH);
$dir = '/certificates'; $dir = '/certificates';
$title = get_lang('DefaultCertificate'); $title = get_lang('DefaultCertificate');
@ -4467,8 +4468,8 @@ class DocumentManager
$fileType = 'file'; $fileType = 'file';
$templateContent = file_get_contents(api_get_path(SYS_CODE_PATH) . 'gradebook/certificate_template/template.html'); $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}'); $search = array('{CSS}', '{IMG_DIR}', '{REL_CODE_PATH}', '{COURSE_DIR}');
$replace = array($css.$js, $img_dir, api_get_path(REL_PATH), $default_course_dir, api_get_path(WEB_CODE_PATH)); $replace = array($css.$js, $img_dir, $codePath, $default_course_dir);
$fileContent = str_replace($search, $replace, $templateContent); $fileContent = str_replace($search, $replace, $templateContent);

@ -242,12 +242,19 @@ class PDF
if (strpos($old_src, 'http') === false) { if (strpos($old_src, 'http') === false) {
if (strpos($old_src, '/main/default_course_document') === false) { if (strpos($old_src, '/main/default_course_document') === false) {
$old_src_fixed = ''; $old_src_fixed = '';
if (strpos($old_src, '/main/img') === false) {
if (api_get_path(REL_PATH) != '/') { if (api_get_path(REL_PATH) != '/') {
$old_src_fixed = str_replace(api_get_path(REL_PATH).'courses/'.$course_data['path'].'/document/', '', $old_src); $old_src_fixed = str_replace(api_get_path(REL_PATH).'courses/'.$course_data['path'].'/document/', '', $old_src);
} else { } 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; $new_path = $document_path.$old_src_fixed;
} else {
$new_path = $old_src;
}
$document_html= str_replace($old_src, $new_path, $document_html); $document_html= str_replace($old_src, $new_path, $document_html);
} }
} else { } else {

Loading…
Cancel
Save