Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide

      1. Clear all caches.
      2. Add some File resources using different file types, one with pdf, one with Word etc. You can drag and drop these into the course if you like.
      2. Verify that the icons shown on the course page for these is correct (pdf, word, etc) and that the icon does not look "blocky" or scaled-up from a lower resolution. The icons shown should be natively 24x24 pixels.

      Show
      1. Clear all caches. 2. Add some File resources using different file types, one with pdf, one with Word etc. You can drag and drop these into the course if you like. 2. Verify that the icons shown on the course page for these is correct (pdf, word, etc) and that the icon does not look "blocky" or scaled-up from a lower resolution. The icons shown should be natively 24x24 pixels.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE

      Description

      We need to explicitly declare the icon file size rather then depending on the default of 16px.

        Gliffy Diagrams

          Activity

          Hide
          dougiamas Martin Dougiamas added a comment -

          diff --git a/mod/resource/lib.php b/mod/resource/lib.php
          index b500784..0f2395a 100644
          --- a/mod/resource/lib.php
          +++ b/mod/resource/lib.php
          @@ -256,7 +256,7 @@ function resource_get_coursemodule_info($coursemodule) {
               $files = $fs->get_area_files($context->id, 'mod_resource', 'content', 0, 'sortorder DESC, id ASC', false); // TODO: this is not very efficient!!
               if (count($files) >= 1) {
                   $mainfile = reset($files);
          -        $info->icon = file_file_icon($mainfile);
          +        $info->icon = file_file_icon($mainfile, 24);
                   $resource->mainfile = $mainfile->get_filename();
               }

          Show
          dougiamas Martin Dougiamas added a comment - diff --git a/mod/resource/lib.php b/mod/resource/lib.php index b500784..0f2395a 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -256,7 +256,7 @@ function resource_get_coursemodule_info($coursemodule) { $files = $fs->get_area_files($context->id, 'mod_resource', 'content', 0, 'sortorder DESC, id ASC', false); // TODO: this is not very efficient!! if (count($files) >= 1) { $mainfile = reset($files); - $info->icon = file_file_icon($mainfile); + $info->icon = file_file_icon($mainfile, 24); $resource->mainfile = $mainfile->get_filename(); }
          Hide
          poltawski Dan Poltawski added a comment -

          I've pushed that patch for you, please could you upate testing instructions

          Show
          poltawski Dan Poltawski added a comment - I've pushed that patch for you, please could you upate testing instructions
          Hide
          markn Mark Nelson added a comment -

          Works as expected. Checked image dimensions as well, all were 24*24.

          Show
          markn Mark Nelson added a comment - Works as expected. Checked image dimensions as well, all were 24*24.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Amazed. Inspired. Grateful. That’s how your generosity makes me feel.

          (not really)

          Closing, thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Amazed. Inspired. Grateful. That’s how your generosity makes me feel. (not really) Closing, thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                3/Dec/12