Fixing pdf name for lps

skala
Julio Montoya 14 years ago
parent be9da0afed
commit bcf1d6571e
  1. 11
      main/inc/lib/pdf.lib.php
  2. 51
      main/newscorm/learnpath.class.php

@ -14,20 +14,17 @@ class PDF {
/**
* Creates the mPDF object
* @params string orientation "P" = Portrait "L" = Landscape
* @param string format A4 A4-L see http://mpdf1.com/manual/index.php?tid=184&searchstring=format
* @param string orientation "P" = Portrait "L" = Landscape
*/
public function __construct($page_format ='A4', $orientation = 'P') {
/* More info @ http://mpdf1.com/manual/index.php?tid=184&searchstring=mPDF
* mPDF ([ string $mode [, mixed $format [, float $default_font_size [, string $default_font [, float $margin_left , float $margin_right , float $margin_top , float $margin_bottom , float $margin_header , float $margin_footer [, string $orientation ]]]]]])
*/
*/
if(!in_array($orientation,array('P','L'))) {
$orientation = 'P';
}
$this->pdf = $pdf = new mPDF('UTF-8', $page_format, '', '', 30, 20, 27, 25, 16, 13, $orientation);
//$mpdf->mirrorMargins = 0; // Use different Odd/Even headers and footers and mirror margins
$this->pdf = $pdf = new mPDF('UTF-8', $page_format, '', '', 30, 20, 27, 25, 16, 13, $orientation);
}
/**

@ -8361,32 +8361,33 @@ EOD;
$lp_id = intval($lp_id);
$files_to_export = array();
$course_data = api_get_course_info($this->cc);
$scorm_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/scorm/'.$this->path;
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
foreach($this->items as $item) {
//Getting documents from a LP with chamilo documents
switch ($item->type) {
case 'document':
$file_data = DocumentManager::get_document_data_by_id($item->path, $this->cc);
$file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$file_data['path'];
if (file_exists($file_path)) {
$files_to_export[] = $file_path;
}
break;
case 'sco':
$file_path = $scorm_path.'/'.$item->path;
if (file_exists($file_path)) {
$files_to_export[] = $file_path;
}
break;
}
if (!empty($course_data)) {
$scorm_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/scorm/'.$this->path;
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
foreach($this->items as $item) {
//Getting documents from a LP with chamilo documents
switch ($item->type) {
case 'document':
$file_data = DocumentManager::get_document_data_by_id($item->path, $this->cc);
$file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$file_data['path'];
if (file_exists($file_path)) {
$files_to_export[] = $file_path;
}
break;
case 'sco':
$file_path = $scorm_path.'/'.$item->path;
if (file_exists($file_path)) {
$files_to_export[] = $file_path;
}
break;
}
}
require_once api_get_path(LIBRARY_PATH).'pdf.lib.php';
$pdf = new PDF();
$result = $pdf->html_to_pdf($files_to_export, $this->name, $this->cc);
return $result;
}
require_once api_get_path(LIBRARY_PATH).'pdf.lib.php';
$pdf = new PDF();
$result = $pdf->html_to_pdf($files_to_export, '', $this->cc);
return $result;
return false;
}
/**

Loading…
Cancel
Save