Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-19077 Implement the theme engines proposal
  3. MDL-19707

Need a better way to print the appropriate icon for files

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0
    • 2.0
    • Libraries
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

      In the change to $CFG->pixpath to $OUTPUT->old_icon_url I had to do a nasty hack for file icons.

      There is now a couple of dozen instances of code like

      str_replace(array('.gif', '.png'), '', mimeinfo_from_type('icon', $mimetype));

      I think what we need is:

      1. a new method $OUTPUT->file_icon_url($mimetype); the does the same as $OUTPUT->old_icon_url(... above search and replace ...);

      2. a new method $OUTPUT->link_to_file($file); that does the half-a-dozen lines of code we have duplicated around the place that is a link to a file, with the appropriate icon next to it. (For example, look at where it outputs forum attachements, or uploaded files in assignment.)

            samhemelryk Sam Hemelryk
            timhunt Tim Hunt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.