MDL-36334 JS: Deprecate YUI galleryversion in enrol

This commit is contained in:
Andrew Nicols 2014-01-07 16:12:49 +11:00
parent 4e2c2c64bb
commit 6fc9488862

View File

@ -1260,15 +1260,18 @@ class enrol_user_button extends single_button {
* @param string|array $modules One or more modules to require
* @param string $function The JS function to call
* @param array $arguments An array of arguments to pass to the function
* @param string $galleryversion The YUI gallery version of any modules required
* @param string $galleryversion Deprecated: The gallery version to use
* @param bool $ondomready If true the call is postponed until the DOM is finished loading
*/
public function require_yui_module($modules, $function, array $arguments = null, $galleryversion = '2010.04.08-12-35', $ondomready = false) {
public function require_yui_module($modules, $function, array $arguments = null, $galleryversion = null, $ondomready = false) {
if ($galleryversion != null) {
debugging('The galleryversion parameter to yui_module has been deprecated since Moodle 2.3.');
}
$js = new stdClass;
$js->modules = (array)$modules;
$js->function = $function;
$js->arguments = $arguments;
$js->galleryversion = $galleryversion;
$js->ondomready = $ondomready;
$this->jsyuimodules[] = $js;
}
@ -1312,7 +1315,7 @@ class enrol_user_button extends single_button {
*/
public function initialise_js(moodle_page $page) {
foreach ($this->jsyuimodules as $js) {
$page->requires->yui_module($js->modules, $js->function, $js->arguments, $js->galleryversion, $js->ondomready);
$page->requires->yui_module($js->modules, $js->function, $js->arguments, null, $js->ondomready);
}
foreach ($this->jsinitcalls as $js) {
$page->requires->js_init_call($js->function, $js->extraarguments, $js->ondomready, $js->module);