From 90ba112f087befbac35687577bf096b70cd69f92 Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Mon, 24 Aug 2009 19:06:45 -0500 Subject: [PATCH] Fixing bug when teacher is no set --- main/inc/footer.inc.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/main/inc/footer.inc.php b/main/inc/footer.inc.php index f935795199..9b3113e270 100644 --- a/main/inc/footer.inc.php +++ b/main/inc/footer.inc.php @@ -88,17 +88,19 @@ if (get_setting('show_teacher_data')=='true') { $id_course=api_get_course_id(); if (isset($id_course) && $id_course!=-1) { echo ''; - $mail=CourseManager::get_emails_of_tutors_to_course($id_course); - if (count($mail)>1){ - $bar=' | '; - echo ' '.get_lang('Teachers').' : '; + $mail=CourseManager::get_emails_of_tutors_to_course($id_course); + if (!empty($mail)) { + if (count($mail)>1){ + $bar=' | '; + echo ' '.get_lang('Teachers').' : '; } else { - $bar=''; - echo ' '.get_lang('Teacher').' : '; - } - foreach ($mail as $value=>$key) { - foreach ($key as $email=>$name){ - echo Display::encrypted_mailto_link($email,$name).$bar; + $bar=''; + echo ' '.get_lang('Teacher').' : '; + } + foreach ($mail as $value=>$key) { + foreach ($key as $email=>$name){ + echo Display::encrypted_mailto_link($email,$name).$bar; + } } } echo '';