Madamadam
Madamadam

Reputation: 938

How to get path for jQuery in Moodle?

What's the code to programmatically get the path to jQuery in Moodle (Version 3.4)? On my recent moodle it's '/theme/jquery.php/core/jquery-1.11.3.min.js' but I need to get it dynamically in case of updates etc.

Upvotes: 0

Views: 852

Answers (1)

Mitxel
Mitxel

Reputation: 453

The method where the URL of each jquery plugin (and the jquery library itself) is programatically build is jquery_plugin at lib/outputrequirementslib.php (with params jquery and core).

Ultimately that method builds it approximately like so:

$CFG->wwwroot . '/theme/jquery.php/core/' . $file

where $file value is taken from required file lib/jquery/plugins.php, where the current jquery version-file is declared.

Upvotes: 1

Related Questions