diff --git a/locallib.php b/locallib.php index 77935ce..775d691 100644 --- a/locallib.php +++ b/locallib.php @@ -301,7 +301,8 @@ function block_lw_courses_get_sorted_courses($showallcourses = false) { global $USER , $DB; $courses = block_lw_courses_get_my_courses($USER->id); - $mapping = $DB->get_records_menu('block_webshop_product' , [] ,'', 'course_id as id, locale_display_flag'); + $mapping = $DB->get_records_menu('block_webshop_product' , [] ,'', + 'course_id as id, locale_display_flag'); $site = get_site(); if (array_key_exists($site->id, $courses)) { diff --git a/renderer.php b/renderer.php index b900f4c..46b11d5 100644 --- a/renderer.php +++ b/renderer.php @@ -490,8 +490,7 @@ public function welcome_area($msgcount) { public function course_image($courserecord) { global $CFG; - require_once($CFG->libdir . '/coursecatlib.php'); - $course = new course_in_list($courserecord); + $course = new core_course_list_element($courserecord); // Check to see if a file has been set on the course level. if ($course->id > 0 && $course->get_course_overviewfiles()) { foreach ($course->get_course_overviewfiles() as $file) { @@ -579,7 +578,7 @@ public function course_image_defaults() { * @throws moodle_exception */ public function course_description($course) { - $course = new course_in_list($course); + $course = new core_course_list_element($course); $context = \context_course::instance($course->id); $summary = external_format_string($course->summary, $context, @@ -650,12 +649,12 @@ private function enrolment_duration($course) { $days = $dtF->diff($dtT)->format('%a'); if ($days >= 30) { - return ' ' . get_string('enrolmentsends', 'block_lw_courses') + return ' ' . get_string('enrolmentsends', 'block_lw_courses') . ' ' . (($days > 1) ? $days . ' ' . get_string('days') : $days . ' ' . get_string('day')) . ''; } if ($days < 30) { - return ' ' . get_string('enrolmentsends', 'block_lw_courses') + return ' ' . get_string('enrolmentsends', 'block_lw_courses') . ' ' . (($days > 1) ? $days . ' ' . get_string('days') : $days . ' ' . get_string('day')) . ''; } diff --git a/version.php b/version.php index 456ab2f..372c580 100644 --- a/version.php +++ b/version.php @@ -27,8 +27,8 @@ // Make sure they don't update this plugin, custom changes // https://github.com/MFreakNL/moodle-block_lw_courses // Works in Moodle 3.5 -$plugin->version = 2022041203; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2022091701; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2018050800; // Requires this Moodle version. $plugin->component = 'block_lw_courses'; // Full name of the plugin (used for diagnostics). $plugin->maturity = MATURITY_STABLE; -$plugin->release = 'v1.6.0'; +$plugin->release = 'v1.6.0'; \ No newline at end of file