Issue Details (XML | Word | Printable)

Key: MDL-14542
Type: Sub-task Sub-task
Status: Open Open
Priority: Major Major
Assignee: Tim Hunt
Reporter: guy thomas
Votes: 8
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-16583

Modification to improve javascript and css header insertion for blocks, modules and filters

Created: 24/Apr/08 08:09 PM   Updated: 20/Jul/09 11:15 AM
Return to search
Component/s: Blocks, Filters
Affects Version/s: 2.0
Fix Version/s: 2.0

File Attachments: 1. Zip Archive js_css_head_insert_proposal.zip (136 kB)


URL: http://ossett.schools.wakefield.gov.uk/web/media/video/moodle_mod_screencast_hq
Participants: Alan Trick, allan morris, Anthony Borrow, guy thomas, Petr Skoda and Tim Hunt
Security Level: None
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
Currently Moodle does not provide blocks, filters or modules with an effective way of inserting javascript or css into the html header.

It is possible to insert javascript by adding javascript.php to the root folder of a block,filter or module. However, the file is included as raw text - it is not parsed PHP.

I have developed a modification to moodle which enables blocks, filters and modules to insert javascript / css into the html header whilst taking account of user permissions, browser version and edit mode. This has the following advantages:

1) Standards compliance - all linked css and scripts should be in the head of the document, not the body

2) Because css and javascript are included in the head according to user permissions, there is no wasted bandwidth for users who should not 'see' such css or javascript (way better than the current lib/javascript-mod.php which simply includes everything)

3) Security - users should not be aware of javascript that is not relevant to them based on their permissions. This is not a major security risk but every little helps!

Please visit the following screen cast for more info (I recommend the high quality link)

High quality link:

http://ossett.schools.wakefield.gov.uk/web/media/video/moodle_mod_screencast_hq

Low quality link:

http://ossett.schools.wakefield.gov.uk/web/media/video/moodle_mod_screencast

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
No commits have yet been performed on this issue.