From 144449aebf887e8dcb2f1569af36526506954eab Mon Sep 17 00:00:00 2001 From: Gareth Barnard <1058419+gjb2048@users.noreply.github.com> Date: Sat, 7 Sep 2024 13:15:08 +0100 Subject: [PATCH] Adjust for crop. --- classes/output/courseformat/content.php | 3 +++ templates/grid.mustache | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/output/courseformat/content.php b/classes/output/courseformat/content.php index f4ad5431..3f928905 100644 --- a/classes/output/courseformat/content.php +++ b/classes/output/courseformat/content.php @@ -154,6 +154,9 @@ public function export_for_template(\renderer_base $output) { // Justification. $data->gridjustification = $coursesettings['gridjustification']; + // Image resize is crop. + $data->imageresizemethodcrop = ($coursesettings['imageresizemethod'] == 2); + // Popup. if (!$editing) { $data->popup = false; diff --git a/templates/grid.mustache b/templates/grid.mustache index b26e260d..7797352a 100644 --- a/templates/grid.mustache +++ b/templates/grid.mustache @@ -26,6 +26,7 @@ * sectionbreak - There is a section break for this section. * sectionbreakheading - Section break heading. * number - Section number. + * imageresizemethodcrop - Image resize method is crop. * iscurrent - Current section? * sectionurl - Section URL. * sectionname - Section name. @@ -61,6 +62,7 @@ "sectioncompletionmarkup": "" } ], + "imageresizemethodcrop": true, "showcompletion": true } }} @@ -96,7 +98,7 @@
{{imageerror}}
{{#sectioncompletionmarkup}}{{{sectioncompletionmarkup}}}{{/sectioncompletionmarkup}}