Skip to content

Commit

Permalink
Allow export all thematics to pdf with thematic_pdf_orientation - ref…
Browse files Browse the repository at this point in the history
…s BT#12665
  • Loading branch information
AngelFQC committed May 5, 2017
1 parent 8e7ef78 commit 8c0d723
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main/course_progress/thematic_controller.php
Expand Up @@ -199,6 +199,8 @@ public function thematic($action)
// Don't continue building a normal page.
return;
case 'thematic_export_pdf':
$pdfOrientation = api_get_configuration_value('thematic_pdf_orientation');

$list = $thematic->get_thematic_list();
$table = array();
$table[] = array(
Expand Down Expand Up @@ -231,8 +233,8 @@ public function thematic($action)
'filename' => get_lang('Thematic').'-'.api_get_local_time(),
'pdf_title' => get_lang('Thematic'),
'add_signatures' => ['Drh', 'Teacher', 'Date'],
'format' => 'A4-L',
'orientation' => 'L'
'format' => $pdfOrientation !== 'portrait' ? 'A4-L' : 'A4-P',
'orientation' => $pdfOrientation !== 'portrait' ? 'L' : 'P'
);
Export::export_table_pdf($table, $params);
break;
Expand All @@ -248,7 +250,7 @@ public function thematic($action)

$template = $view->get_template('course_progress/pdf_single_thematic.tpl');

$pdfOrientation = api_get_configuration_value('single_thematic_pdf_orientation');
$pdfOrientation = api_get_configuration_value('thematic_pdf_orientation');

Export::export_html_to_pdf(
$view->fetch($template),
Expand Down

0 comments on commit 8c0d723

Please sign in to comment.