Beispiel #1
0
 public static function get_coachs_from_course_to_string($session_id = 0, $courseId = null, $separator = self::USER_SEPARATOR, $add_link_to_profile = false)
 {
     $coachs_course = self::get_coachs_from_course($session_id, $courseId);
     $course_coachs = array();
     if (is_array($coachs_course)) {
         foreach ($coachs_course as $coach_course) {
             $coach_name = api_get_person_name($coach_course['firstname'], $coach_course['lastname']);
             if ($add_link_to_profile) {
                 $url = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&resizable=0&height=300&user_id=' . $coach_course['user_id'];
                 $coach_name = Display::url($coach_name, $url, array('class' => 'ajax'));
             }
             $course_coachs[] = $coach_name;
         }
     }
     $coaches_to_string = null;
     if (is_array($course_coachs) && count($course_coachs) > 0) {
         $coaches_to_string = ArrayClass::array_to_string($course_coachs, $separator);
     }
     return $coaches_to_string;
 }
Beispiel #2
0
 /**
  * @param int $session_id
  * @param int $courseId
  * @param string $separator
  * @param bool $add_link_to_profile
  * @return null|string
  */
 public static function get_coachs_from_course_to_string($session_id = 0, $courseId = null, $separator = self::USER_SEPARATOR, $add_link_to_profile = false, $orderList = false)
 {
     $coachs_course = self::get_coachs_from_course($session_id, $courseId);
     $course_coachs = array();
     $html = '';
     if (is_array($coachs_course)) {
         foreach ($coachs_course as $coach_course) {
             $coach_name = api_get_person_name($coach_course['firstname'], $coach_course['lastname']);
             if ($add_link_to_profile) {
                 $url = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $coach_course['user_id'];
                 $coach_name = Display::url($coach_name, $url, ['class' => 'ajax', 'data-title' => $coach_name]);
             }
             $course_coachs[] = $coach_name;
         }
     }
     $coaches_to_string = null;
     if (!empty($course_coachs)) {
         if ($orderList === true) {
             $html .= '<ul class="user-coachs">';
             foreach ($course_coachs as $coachs) {
                 $html .= Display::tag('li', Display::return_icon('teacher.png', $coachs, null, ICON_SIZE_TINY) . ' ' . $coachs);
             }
             $html .= '</ul>';
         } else {
             $coaches_to_string = ArrayClass::array_to_string($course_coachs, $separator);
         }
     }
     return $html;
 }
Beispiel #3
0
 /**
  * Set footer parameters
  */
 private function setFooterParameters()
 {
     //Show admin data
     //$this->assign('show_administrator_data', api_get_setting('show_administrator_data'));
     if (api_get_setting('show_administrator_data') == 'true') {
         //Administrator name
         $administrator_data = get_lang('Manager') . ' : ' . Display::encrypted_mailto_link(api_get_setting('admin.administrator_email'), api_get_person_name(api_get_setting('admin.administrator_name'), api_get_setting('admin.administrator_surname')));
         $this->assign('administrator_name', $administrator_data);
     }
     //Loading footer extra content
     if (!api_is_platform_admin()) {
         //$extra_footer = trim(api_get_setting('footer_extra_content'));
         if (!empty($extra_footer)) {
             $this->assign('footer_extra_content', $extra_footer);
         }
     }
     $courseId = api_get_course_int_id();
     //Tutor name
     if (api_get_setting('show_tutor_data') == 'true') {
         // Course manager
         $id_session = api_get_session_id();
         if (isset($courseId) && $courseId != -1 && !empty($courseId)) {
             $tutor_data = '';
             if ($id_session != 0) {
                 $coachs_email = CourseManager::get_email_of_tutor_to_session($id_session, $courseId);
                 $email_link = array();
                 foreach ($coachs_email as $coach) {
                     $email_link[] = Display::encrypted_mailto_link($coach['email'], $coach['complete_name']);
                 }
                 if (count($coachs_email) > 1) {
                     $tutor_data .= get_lang('Coachs') . ' : ';
                     $tutor_data .= ArrayClass::array_to_string($email_link, CourseManager::USER_SEPARATOR);
                 } elseif (count($coachs_email) == 1) {
                     $tutor_data .= get_lang('Coach') . ' : ';
                     $tutor_data .= ArrayClass::array_to_string($email_link, CourseManager::USER_SEPARATOR);
                 } elseif (count($coachs_email) == 0) {
                     $tutor_data .= '';
                 }
             }
             $this->assign('session_teachers', $tutor_data);
         }
     }
     if (api_get_setting('show_teacher_data') == 'true') {
         // course manager
         if (isset($courseId) && $courseId != -1 && !empty($courseId)) {
             $courseInfo = api_get_course_info();
             $teacher_data = null;
             $label = get_lang('Teacher');
             if (count($courseInfo['teacher_list']) > 1) {
                 $label = get_lang('Teachers');
             }
             $teacher_data .= $label . ' : ' . $courseInfo['teacher_list_formatted'];
             $this->assign('teachers', $teacher_data);
         }
     }
 }