<th>Description</th> <th nowrap style="width: auto;"> </th> </tr> </thead> <tbody> <?php foreach ($ctlg_courses_list as $course_list) { $mdl_course = $course_list->getObject(); $course_list_item = new GcrCourseListItem($course_list); $eschool = $course_list->getApp(); $id = 'gcr_course_' . $eschool->getShortName() . '_' . $mdl_course->id; $img_src = $course_list_item->getCourseIconUrl(); $mdl_user = $course_list_item->getInstructor(); $summary = $course_list_item->getSummary(); $enrol_count = $course_list_item->getActiveUserCount(); $shortsummary = GcrInstitutionTable::formatStringSize($summary, 250, 21); if ($mdl_user) { $teacher_text = GcrEschoolTable::getInstructorProfileHtml($mdl_user); } else { $teacher_text = 'None'; } $fullname = $mdl_course->fullname; $cost = $course_list->getCost(); $cost_text = ''; //if ($cost) { //$cost_text = 'Price: ' . GcrPurchaseTable::gc_format_money($cost); $cost_text = GcrPurchaseTable::gc_format_money($cost); //} $enrollment_status = false; $current_user = $CFG->current_app->getCurrentUser(); if ($current_user->getRoleManager()->hasPrivilege('Student')) {
foreach ($ctlg_courses_list as $course_list) { $mdl_course = $course_list->getObject(); $course_list_item = new GcrCourseListItem($course_list); $eschool = $course_list->getApp(); $id = 'gcr_course_' . $eschool->getShortName() . '_' . $mdl_course->id; $img_src = $course_list_item->getCourseIconUrl(); $mdl_user = $course_list_item->getInstructor(); $summary = $course_list_item->getSummary(); $enrol_count = $course_list_item->getActiveUserCount(); $shortsummary = GcrInstitutionTable::formatStringSize($summary, 250, 21); if ($mdl_user) { $teacher_text = GcrEschoolTable::getInstructorProfileHtml($mdl_user); } else { $teacher_text = 'None'; } $fullname = GcrInstitutionTable::formatStringSize($mdl_course->fullname, 60, 30); $cost = $course_list->getCost(); $cost_text = ''; //if ($cost) { //$cost_text = 'Price: ' . GcrPurchaseTable::gc_format_money($cost); $cost_text = GcrPurchaseTable::gc_format_money($cost); //} $enrollment_status = false; $current_user = $CFG->current_app->getCurrentUser(); if ($current_user->getRoleManager()->hasPrivilege('Student')) { $mdl_roles = $course_list->getRoleAssignments($current_user); $enrollment_status = $mdl_roles && count($mdl_roles > 0); } ?> <tr> <td width="20%"><?php
public static function getInstructorProfileHtml(GcrMdlUser $mdl_user) { global $CFG; $html = '<span class="gc_user_profile">'; $img = '<img class="gc_user_profile_img" src="' . $mdl_user->getProfileIcon() . '" />'; $mhr_user = $mdl_user->getUserOnInstitution(); if ($mhr_user && $mhr_user->getApp()->getShortName() == $CFG->current_app->getShortName()) { $html .= '<a class="gc_user_profile_link" href="' . $mhr_user->getHyperlinkToProfile() . '">' . $img . ' <span class="gc_user_profile_fullname">' . GcrInstitutionTable::formatStringSize($mhr_user->getFullnameString(), 22) . '</span></a>'; } else { $html .= $img . ' ' . $mdl_user->getFullnameString(); } $html .= '</span>'; return $html; }