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

Allow themes to set User menu avatar size

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.1
    • Fix Version/s: 3.0
    • Component/s: Themes
    • Testing Instructions:
      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 .
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50839-master

      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

            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                16/Nov/15