Skip to content

Commit

Permalink
Merge branch 'MOODLE39'
Browse files Browse the repository at this point in the history
  • Loading branch information
luukverhoeven committed Apr 15, 2021
2 parents a618fcb + 5ebf36a commit 9585e2c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
9 changes: 4 additions & 5 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -650,12 +649,12 @@ private function enrolment_duration($course) {
$days = $dtF->diff($dtT)->format('%a');

if ($days >= 30) {
return '<span class="badge badge-default"> ' . get_string('enrolmentsends', 'block_lw_courses')
return '<span class="badge badge-secondary"> ' . get_string('enrolmentsends', 'block_lw_courses')
. ' ' . (($days > 1) ? $days . ' ' . get_string('days') : $days . ' ' . get_string('day')) . '</span>';
}

if ($days < 30) {
return '<span class="badge badge-red"> ' . get_string('enrolmentsends', 'block_lw_courses')
return '<span class="badge badge-danger"> ' . get_string('enrolmentsends', 'block_lw_courses')
. ' ' . (($days > 1) ? $days . ' ' . get_string('days') : $days . ' ' . get_string('day')) . '</span>';
}

Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit 9585e2c

Please sign in to comment.