|
@@ -644,80 +644,30 @@ class PDF
|
|
|
$this->pdf->defaultheaderfontstyle = 'BI';
|
|
|
$this->pdf->defaultheaderline = 1;
|
|
|
|
|
|
+ $userId = api_get_user_id();
|
|
|
+
|
|
|
if (!empty($course_data['code'])) {
|
|
|
$teacher_list = CourseManager::get_teacher_list_from_course_code($course_data['code']);
|
|
|
|
|
|
$teachers = '';
|
|
|
if (!empty($teacher_list)) {
|
|
|
foreach ($teacher_list as $teacher) {
|
|
|
- $teachers[] = $teacher['firstname'].' '.$teacher['lastname'];
|
|
|
- }
|
|
|
- if (count($teachers) > 1) {
|
|
|
- $teachers = get_lang('Teachers').': '.implode(', ', $teachers);
|
|
|
- } else {
|
|
|
- $teachers = get_lang('Teacher').': '.implode('', $teachers);
|
|
|
- }
|
|
|
+ if ($teacher['user_id'] != $userId) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- $user_info = api_get_user_info();
|
|
|
- $teachers = $user_info['complete_name'];
|
|
|
+
|
|
|
+ $teachers = api_get_person_name($teacher['firstname'], $teacher['lastname']);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- $left_content = '';
|
|
|
- $center_content = '';
|
|
|
- $right_content = $teachers;
|
|
|
-
|
|
|
- $header = 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,
|
|
|
- ),
|
|
|
- );
|
|
|
- $this->pdf->SetHeader($header);
|
|
|
+ $view = new Template('', false, false, false, true, false, false);
|
|
|
+ $view->assign('teacher_name', $teachers);
|
|
|
+ $template = $view->get_template('export/pdf_header.tpl');
|
|
|
+ $headerHTML = $view->fetch($template);
|
|
|
+
|
|
|
+ $this->pdf->SetHTMLHeader($headerHTML, 'E');
|
|
|
+ $this->pdf->SetHTMLHeader($headerHTML, 'O');
|
|
|
}
|
|
|
}
|
|
|
|