diff --git a/app/Resources/public/css/print.css b/app/Resources/public/css/print.css index 34f753e8c7..8c8c616495 100644 --- a/app/Resources/public/css/print.css +++ b/app/Resources/public/css/print.css @@ -691,3 +691,21 @@ table.border-thin td { .text-center { text-align: center; } +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} + +table.page-footer { + font-family: serif; + font-size: 10pt; +} +table.page-footer td{ + padding: 0; +} + +.border-top { + border-top: 1px solid #000; +} diff --git a/main/exercise/question.class.php b/main/exercise/question.class.php index 838cb343eb..f822f32c65 100755 --- a/main/exercise/question.class.php +++ b/main/exercise/question.class.php @@ -1572,13 +1572,21 @@ abstract class Question // Categories $tabCat = TestCategory::getCategoriesIdAndName(); $form->addElement('select', 'questionCategory', get_lang('Category'), $tabCat); - + + global $text; + switch ($this->type) { case UNIQUE_ANSWER: - $form->addButton('convertAnswer', get_lang('ConvertToMultipleAnswer'), 'dot-circle-o', 'info'); + $buttonGroup = array(); + $buttonGroup[] = $form->addButton('convertAnswer', get_lang('ConvertToMultipleAnswer'), 'dot-circle-o', 'default', null, null, null, true); + $buttonGroup[] = $form->addButtonSave($text, 'submitQuestion', true); + $form->addGroup($buttonGroup); break; case MULTIPLE_ANSWER: - $form->addButton('convertAnswer', get_lang('ConvertToUniqueAnswer'), 'check-square-o', 'info'); + $buttonGroup = array(); + $buttonGroup[] = $form->addButton('convertAnswer', get_lang('ConvertToUniqueAnswer'), 'check-square-o', 'default'); + $buttonGroup[] = $form->addButtonSave($text, 'submitQuestion', true); + $form->addGroup($buttonGroup); break; } diff --git a/main/inc/lib/javascript/ckeditor/config_js.php b/main/inc/lib/javascript/ckeditor/config_js.php index fd5cd4cf47..33db432ca8 100644 --- a/main/inc/lib/javascript/ckeditor/config_js.php +++ b/main/inc/lib/javascript/ckeditor/config_js.php @@ -14,5 +14,5 @@ $template->assign('moreButtonsInMaximizedMode', $moreButtonsInMaximizedMode); $template->assign('course_condition', api_get_cidreq()); header('Content-type: application/x-javascript'); -$template->display('default/javascript/editor/ckeditor/config_js.tpl'); +$template->display($template->get_template('javascript/editor/ckeditor/config_js.tpl')); diff --git a/main/inc/lib/pdf.lib.php b/main/inc/lib/pdf.lib.php index ca7172f1e1..7b9c3de64f 100755 --- a/main/inc/lib/pdf.lib.php +++ b/main/inc/lib/pdf.lib.php @@ -622,67 +622,16 @@ class PDF */ public function set_footer() { - $this->pdf->defaultfooterfontsize = 12; // in pts - $this->pdf->defaultfooterfontstyle = 'B'; // blank, B, I, or BI - $this->pdf->defaultfooterline = 1; // 1 to include line below header/above footer - $platform_name = api_get_setting('Institution'); - $left_content = $platform_name; - $center_content = ''; - $right_content = '{PAGENO} / {nb}'; - - //@todo remove this and use a simpler way - $footer = array( - 'odd' => array( - 'L' => array( - 'content' => $left_content, - 'font-size' => 10, - 'font-style' => 'B', - 'font-family' => 'serif', - 'color' => '#000000' - ), - 'C' => array( - 'content' => $center_content, - 'font-size' => 10, - 'font-style' => 'B', - 'font-family' => 'serif', - 'color' => '#000000' - ), - 'R' => array( - 'content' => $right_content, - 'font-size' => 10, - 'font-style' => 'B', - 'font-family' => 'serif', - 'color' => '#000000' - ), - 'line' => 1, - ), - 'even' => array( - 'L' => array( - 'content' => $left_content, - 'font-size' => 10, - 'font-style' => 'B', - 'font-family' => 'serif', - 'color' => '#000000' - ), - 'C' => array( - 'content' => $center_content, - 'font-size' => 10, - 'font-style' => 'B', - 'font-family' => 'serif', - 'color' => '#000000' - ), - 'R' => array( - 'content' => $right_content, - 'font-size' => 10, - 'font-style' => 'B', - 'font-family' => 'serif', - 'color' => '#000000' - ), - 'line' => 1, - ), - ); - // defines footer for Odd and Even Pages - placed at Outer margin see http://mpdf1.com/manual/index.php?tid=151&searchstring=setfooter - $this->pdf->SetFooter($footer); + $this->pdf->defaultfooterfontsize = 12; // in pts + $this->pdf->defaultfooterfontstyle = 'B'; // blank, B, I, or BI + $this->pdf->defaultfooterline = 1; // 1 to include line below header/above footer + + $view = new Template('', false, false, false, true, false, false); + $template = $view->get_template('export/pdf_footer.tpl'); + $footerHTML = $view->fetch($template); + + $this->pdf->SetHTMLFooter($footerHTML, 'E'); //Even pages + $this->pdf->SetHTMLFooter($footerHTML, 'O'); //Odd pages } /** diff --git a/main/template/default/export/pdf_footer.tpl b/main/template/default/export/pdf_footer.tpl new file mode 100644 index 0000000000..0703fa0389 --- /dev/null +++ b/main/template/default/export/pdf_footer.tpl @@ -0,0 +1,10 @@ + + + + + +