There is a new implementation of require_js in lib/deprecatedlib.php,
based on $PAGE->requires.
There were a few other recently introduced functions in lib/weblib.php,
namely print_js_call, print_delayed_js_call, print_js_config and
standard_js_config. These have been removed, since they were never in
a stable branch, and all the places that used them have been changed
to use the newer $PAGE->requires->... methods.
get_require_js_code is also gone, and the evil places that were calling
it, even though it is an internal function, have been fixed.
Also, I made some minor improvements to the code I committed yesterday
for MDL-16695.
All that remains is to update all the places in core code that are
still using require_js.
(This commit also fixes the problem where the admin tree would not
start with the right categories expanded.)
Can't find it documented anywhere, but applicable_formats() is only
ever called as a class method, so it cannot say $this. Instead, say
block_admin_tree::has_admin_caps().
Dan Poltawski said:
> Previously users with different permissions could have granular
> access to the admin menu for the items they have access to, so
> limiting to only users with moodle/site:config would break that.
> Although I agree that that menu is slowww to render and needs
> fixing. Perhaps permissions for the various elements could be
> gathered and checked first
This commit addresses the problem checking for all the caps that are
mentioned by code in /admin (according to grep, at least). Some light
testing with the "moodle/user:create" seems to work properly.
This burdens us with maintaining the list in has_admin_caps() -- less
than ideal, but easier than rewriting /admin.
Saves >10DBq and 18 includes at the homepage for all nonadmin users.
For non admin users, this makes the homepage _much_ more lightweight.
Before: inc 101 DBq 51 time 1.2s
After: inc 76 DBq 36 time 0.2s
So this commit shaves 1 full second for the non-logged-in homepage.
Still pretty bad on the includes, but shaved a good 25 files and 15 DBqs.