Browse Source

Allow set the orientation when exporting thematic to pdf - refs BT#12665

Angel Fernando Quiroz Campos 7 years ago
parent
commit
8af6ed9d4e

+ 4 - 2
main/course_progress/thematic_controller.php

@@ -248,14 +248,16 @@ class ThematicController
 
                     $template = $view->get_template('course_progress/pdf_single_thematic.tpl');
 
+                    $pdfOrientation = api_get_configuration_value('single_thematic_pdf_orientation');
+
                     Export::export_html_to_pdf(
                         $view->fetch($template),
                         [
                             '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'
                         ]
                     );
                     break;

+ 3 - 1
main/install/configuration.dist.php

@@ -362,6 +362,8 @@ $_configuration['agenda_legend'] = [
     '#f0f' => 'another caption'
 ];*/
 // Save question titles with HTML
-$_configuration['question_title_html'] = false;
+// $_configuration['question_title_html'] = false;
 // Show the full toolbar set to all CKEditor
 //$_configuration['full_ckeditor_toolbar_set'] = false;
+// Allow change the orientation when export a single (course progress) thematic to pdf. Portrait or landscape
+//$_configuration['single_thematic_pdf_orientation'] = 'landscape';