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

Allow themes to set User menu avatar size

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.9.1
    • 3.0
    • Themes
    • MOODLE_29_STABLE
    • MOODLE_30_STABLE
    • MDL-50839-master
    • Hide
      1. Modify a theme to override user_menu() from core_renderer; add an avatarsize option in the user_get_user_navigation_info call, e.g.
        $opts = user_get_user_navigation_info($user, $this->page, array('avatarsize' => 100));
      2. Verify that the user menu avatar picture is 100px wide and high on the page.
      3. Go to a user's profile and click "log in as". Check that your avatar is still 100px wide and high

      NB: The size on the web page is set by CSS, and may be different to the image's intrinsic size - ref MDL-50420.

      Show
      Modify a theme to override user_menu() from core_renderer; add an avatarsize option in the user_get_user_navigation_info call, e.g. $opts = user_get_user_navigation_info($user, $this->page, array('avatarsize' => 100)); Verify that the user menu avatar picture is 100px wide and high on the page. Go to a user's profile and click "log in as". Check that your avatar is still 100px wide and high NB: The size on the web page is set by CSS, and may be different to the image's intrinsic size - ref MDL-50420 .

    Description

      Currently the User menu's avatar is created via user_get_user_navigation_info() in user/lib.php (via $OUTPUT->user_picture()) - but this doesn't provide any way to set the avatar size.

      We should allow themes to pass options to user_get_user_navigation_info() - e.g. by overriding theme_{themename}_core_renderer::user_menu()

      Attachments

        Activity

          People

            balchd Dave Balch
            balchd Dave Balch
            Jetha Chan Jetha Chan
            David Monllaó David Monllaó
            John Okely John Okely
            Huong Nguyen, Bas Brands, Mathew May
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              16/Nov/15