moodle-an-hochschulen / moodle-theme_boost_union

Theme Boost Union is an enhanced child theme of Boost which is intended, on the one hand, to make Boost simply more configurable and, on the other hand, to provide helpful additional features for the daily Moodle operation of admins, teachers and students.
GNU General Public License v3.0
66 stars 58 forks source link

Feature: Show default course image in my courses overview #171

Open NinaHerrmann opened 1 year ago

NinaHerrmann commented 1 year ago

Follow up issue from #77 -> Pull Request #170:

170 adds a setting to Look->Page to enable showing background images in the course header and to define a default image which is displayed in case the course does not have an image.

The default image is not displayed in the My Courses overview page, which might be confusing.

dbnschools commented 1 year ago

This code will display the course image on the My Courses Page.
// Use default image on both dashboard/mycourses and in course pages. public function get_generated_image_for_id($id) { // See if user uploaded a custom header background to the theme. $headerbg = $this->page->theme->setting_file_url('courseheaderimagefallback', 'courseheaderimagefallback'); $hasheaderbg = $this->page->theme->settings->courseheaderimageenabled == THEME_BOOST_UNION_SETTING_SELECT_YES; if (isset($headerbg) && $hasheaderbg) { return $headerbg; } elseif ($hasheaderbg) { // Usefallback image for mycourse regardless. return $this->page->theme->image_url('noimg', 'theme')->out(); } else { $color = $this->get_generated_color_for_id($id); $pattern = new \core_geopattern(); $pattern->setColor($color); $pattern->patternbyid($id); return $pattern->datauri(); } }

https://github.com/dbnschools/moodle-theme_boost_union/blob/master/classes/output/core_renderer.php#L713

We've done a bunch of work on making the Boost Union theme a bit more capable for our needs but I am afraid my coding standards are not on the level of your team. We've added a specialized course dashboard panel, huge styling changes, and a bunch of hacks to better integrate some of our plugins. One such enhancement was matching course header images on both the course and dashboard pages. It's something we've been doing since Fordson theme.

wiebkemueller-hsh commented 8 months ago

Identified as a good partner issue or extension for the realisation of #298