June 2017
Beginner to intermediate
368 pages
8h 31m
English
Luckily, the Page API provides a simple method for loading YUI-wrapped JavaScript into pages. For details, take a look at the Moodle documentation here: https://docs.moodle.org/dev/YUI/Modules
When Moodle displays a course using the specified format, it will attempt to load the plugin's format.php file, so it is in here that we will need to load our JavaScript:
$PAGE->requires->yui_module('moodle-format_location-geo', 'M.format_location.init_geo', null, null, true);
Note the format of the module name: moodle-format_location-geo. The naming convention is called Frankenstyle (a term coined by Martin Dougiamas--see https://docs.moodle.org/dev/Frankenstyle). This is a moodle script that belongs to a format plugin called ...
Read now
Unlock full access