Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-66027

No standard, theme-overridable, way to get user profile image url

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6, 3.7, 3.8
    • Fix Version/s: None
    • Component/s: HTML and CSS, Messages, Themes
    • Labels:
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_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.

       

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bawjaws David Scotson
              Participants:
              Component watchers:
              Amy Groshek, David Scotson, Amaia Anabitarte, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón, Jake Dallimore, Jun Pataleta, Ryan Wyllie, Bas Brands, Amaia Anabitarte, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: