
| Key: |
MDL-16695
|
| Type: |
Sub-task
|
| Status: |
Resolved
|
| Resolution: |
Fixed
|
| Priority: |
Minor
|
| Assignee: |
Tim Hunt
|
| Reporter: |
Tim Hunt
|
| Votes: |
0
|
| Watchers: |
2
|
|
|
| Participants: |
Penny Leach and Tim Hunt
|
| Security Level: |
None
|
| Resolved date: |
12/Jun/09
|
| Affected Branches: |
MOODLE_20_STABLE
|
| Fixed Branches: |
MOODLE_20_STABLE
|
|
This will help with storing lists of scripts, etc. and allow us to get the output without nasty hacks like the current $extracthtml argument to require_js.
|
|
Description
|
This will help with storing lists of scripts, etc. and allow us to get the output without nasty hacks like the current $extracthtml argument to require_js. |
Show » |
|
I have not yet rewritten require_js and friends to use it, and then deprecated them. Nor have I changed print_header and friends to get the data from the class. I first want to know that the way I have made this class and its API is sensible.
Draft commit comment:
ajaxlib:
MDL-16695New page_requirements_manager class, soon to replace require_jsThis new class does the work that require_js used to do, and more.
It can track a number of different things that may be required to
be output somewhere on the page, including:
The new API looks like
$PAGE->requires->css('mod/mymod/styles.css');
$PAGE->requires->js('mod/mymod/script.js');
$PAGE->requires->js('mod/mymod/small_but_urgent.js')->in_head();
$PAGE->requires->js_function_call('init_mymod', array($data))->on_dom_ready();
$PAGE->requires is the canonical instances of this new class.
The commit also includes unit tests.