Closed Julian-Tovar closed 6 months ago
Thanks for proposing a solution but I do not think it's a great idea to hardcode 'bgimage' outside of the customcert bgimage code. A proper solution would require a new method in element/image/classes/element.php
that elements can override to return false if multiple instances are not allowed. You would then call this function in the main customcert code and if it's false check before allowing it to be added.
Sorry, will reopen to allow for a new patch to be submitted.
I found a method I had forgotten about called public static function can_add()
in the base class - you could probably override this in the background element.
Hi! Thank you so much @mdjnelson I really like the idea of using a base method that elements can override to return false if multiple instances are not allowed
Closing, see https://github.com/mdjnelson/moodle-mod_customcert/issues/550 for reason why.
This PR creates a new variable
$skipbackground
to skip adding the background image to the element dropdown, when there is already one background image in a template