Fix printing html because of media=screen see BT#13808

pull/2458/head
jmontoyaa 8 years ago
parent 0b4238c170
commit 19536a78b0
  1. 8
      main/document/document.php
  2. 7
      main/inc/lib/certificate.lib.php

@ -714,12 +714,20 @@ if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates' &&
$path_image_in_default_course,
$new_content_html
);
$new_content_html = str_replace(
SYS_CODE_PATH.'img/',
api_get_path(WEB_IMG_PATH),
$new_content_html
);
// Remove media=screen to be available when printing a document
$new_content_html = str_replace(
api_get_path(WEB_CSS_PATH).'editor.css" media="screen"',
api_get_path(WEB_CSS_PATH).'editor.css" ',
$new_content_html
);
Display::display_reduced_header();
echo '<style>body {background:none;}</style>

@ -623,6 +623,13 @@ class Certificate extends Model
if (file_exists($user_certificate)) {
$certificateContent = (string) file_get_contents($user_certificate);
// Remove media=screen to be available when printing a document
$certificateContent = str_replace(
api_get_path(WEB_CSS_PATH).'editor.css" media="screen"',
api_get_path(WEB_CSS_PATH).'editor.css" ',
$certificateContent
);
if ($this->user_id == api_get_user_id() && !empty($this->certificate_data)) {
$certificateId = $this->certificate_data['id'];
$extraFieldValue = new ExtraFieldValue('user_certificate');

Loading…
Cancel
Save