|
|
| Participants: |
Sam Hemelryk and Tim Hunt
|
| Security Level: |
None
|
| Resolved date: |
07/Jul/09
|
| Affected Branches: |
MOODLE_20_STABLE
|
| Fixed Branches: |
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.)
|
|
Description
|
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.) |
Show » |
committed 1 file to 'Moodle CVS' - 07/Jul/09 11:56 AM
lib-filelib MDL-19707 Added file_extension_icon() and file_mimetype_icon()
After talking with Tim we decided that this would be a better solution than adding more methods to $OUTPUT
|
|
|
committed 1 file to 'Moodle CVS' - 07/Jul/09 12:03 PM
lib-filelib MDL-19707 Modified file_extension_icon() to accept full filename
|
|
|
committed 23 files to 'Moodle CVS' - 07/Jul/09 02:16 PM
filelib MDL-19707 Converted existing ...str_replace('png','gif')... to use file_extension_icon and file_mimetype_icon
|
|
|
committed 2 files to 'Moodle CVS' - 08/Jul/09 09:52 AM
filelib MDL-19707 Modified file_extension_icon to use extisting function mimeinfo and reverted
two uses of file_extension_icon in course-lib that were incorrect
|
|
|
|