Advertisement
Guest User

Untitled

a guest
Oct 20th, 2021
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. class course_renderer extends \core_course_renderer {
  2.  
  3. public function coursecat_coursebox(coursecat_helper $chelper, $course, $additionalclasses = '') {
  4. if (!isset($this->strings->summary)) {
  5. $this->strings->summary = get_string('summary');
  6. }
  7. if ($chelper->get_show_courses() <= self::COURSECAT_SHOW_COURSES_COUNT) {
  8. return '';
  9. }
  10. if ($course instanceof stdClass) {
  11. $course = new core_course_list_element($course);
  12. }
  13. $content = '';
  14. $classes = trim('coursebox clearfix '. $additionalclasses);
  15. if ($chelper->get_show_courses() < self::COURSECAT_SHOW_COURSES_EXPANDED) {
  16. $classes .= ' collapsed';
  17. }
  18.  
  19. // .coursebox
  20. $content .= html_writer::start_tag('div', array(
  21. 'class' => $classes,
  22. 'data-courseid' => $course->id,
  23. 'data-type' => self::COURSECAT_TYPE_COURSE,
  24. ));
  25.  
  26. $content .= html_writer::start_tag('div', array('class' => 'info'));
  27. $content .= $this->course_name($chelper, $course);
  28. $content .= $this->course_enrolment_icons($course);
  29. $content .= html_writer::end_tag('div');
  30.  
  31. $content .= html_writer::start_tag('div', array('class' => 'content'));
  32. $content .= $this->coursecat_coursebox_content($chelper, $course);
  33. $content .= html_writer::end_tag('div');
  34.  
  35. $content .= html_writer::end_tag('div'); // .coursebox
  36. return $content.'xxxxxxxxxx';
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement