The YUI loading looks like:
<?php require_once($CFG->libdir.'/ajax/ajaxlib.php'); echo require_js(array('yui_yahoo','yui_dom','yui_event','yui_animation')); ?>
with the libraries you need listed.
Detecting is not jet done - will be neccessary when more developers use YUI. Library detection or central library loading should be in 1.8 I suppose.
You may look at MDL-7682. Andy do you have an idea how to solve central YUI loading?
Yep, it looks like require_js is the future Although, I'm in the same situation - I'd like to use it to get at the YUI files without necessarily wanting to the drag and drop course format enabled.
I added a new Subtask MDL-8374 in the Moodle tracker. You may add your patches or suggestions there to help Vy solve the issue.
You may also vote for the issue.
Used without arguments, require_js() will return the html needed to load the JS files. print_header() in weblib now calls require_js().
If we don't respect the $CFG->enableajax and $USER->ajax settings, we'll end up with two issues:
1) Inconsistency. For example, an admin turns off AJAX - some parts of Moodle respects this, while other parts don't.