Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 3.6, 3.7, 3.8, 3.9.2
-
Fix Version/s: None
-
Component/s: Forum, HTML and CSS, Messages, Themes
-
Labels:
-
Affected Branches:MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
Description
Most code that displays a user image goes through the render_user_picture renderer, which allows themes to override it.
Some other bits of code, do their own thing to get the url, such as messaging which creates a user object, creates a user_picture object from that, then calls get_url on it and builds the HTML for the user image in the template.
This means that the user icons in messaging differ from the others in ways that might be small or big depending on what the theme does.
e.g. someone might set the border radius on .userpicture and expect it to affect all .userpictures, but the user picture in the message interface will have rounded-circle forced on it. Or might use the defaultuserpic class to style default user pics, which user pics in the message interface won't be affected by. Or a security minded theme might want to only display uploaded images to certain types of user.
Possibly a render_user_picture_url() function that accepts a user_picture object might work (not sure how that fits with the magic naming scheme, might need a different name) and that could be used within the render_user_picture() function as well as elsewhere.
Or the messaging interface could calle render_user_picture and then use the standard HTML that is returned.