YUI2 Replacement Method

YUI2 Replacement Method

by Syed Nayab Bukhari -
Number of replies: 3
Picture of Core developers

Dear Seniors

We recently update Moodle from 2.3 to 2.8

We used below code in 2.3 and it works fine
$arrVocParams        = array("questioncategoryurl"=>$CFG->wwwroot.'/question/category.php?courseid='.$COURSE->id,"wwwrooturl"=>$CFG->wwwroot,"courseid"=>$COURSE->id);

        //$PAGE->requires->js_init_call('voc_edit_init', array( $arrVocParams), false, $module);
         $PAGE->requires->yui2_lib('container');
         $PAGE->requires->yui2_lib('connection');
         $PAGE->requires->yui2_lib('dragdrop');
         $PAGE->requires->js('/mod/voc/edit.js');
         $PAGE->requires->js_init_call('voc_edit_init', array( $arrVocParams));

Can any one share replacement code of above lines.

In Checklist Plugin ... Locallib.php
Below code is working fine in Moodle 2.8.   Y same code is not working for our developed plugin.
if (!$viewother) {
                    // Load the Javascript required to send changes back to the server (without clicking 'save')
                    if ($CFG->version < 2012120300) { // < Moodle 2.4
                        $jsmodule = array(
                            'name' => 'mod_checklist',
                            'fullpath' => new moodle_url('/mod/checklist/updatechecks.js')
                        );
                        $PAGE->requires->yui2_lib('dom');
                        $PAGE->requires->yui2_lib('event');
                        $PAGE->requires->yui2_lib('connection');
                        $PAGE->requires->yui2_lib('animation');
                    } else {
                        $jsmodule = array(
                            'name' => 'mod_checklist',
                            'fullpath' => new moodle_url('/mod/checklist/updatechecks24.js')
                        );
                    }
                    $updatechecksurl = new moodle_url('/mod/checklist/updatechecks.php');
                    $updateprogress = $showteachermark ? 0 : 1; // Progress bars should only be updated with 'student only' checklists
                    $PAGE->requires->js_init_call('M.mod_checklist.init', array($updatechecksurl->out(), sesskey(), $this->cm->id, $updateprogress), true, $jsmodule);
                }

Average of ratings: -
In reply to Syed Nayab Bukhari

Re: YUI2 Replacement Method

by Syed Nayab Bukhari -
Picture of Core developers

Any one in the world

pls share any clue

thanks

In reply to Syed Nayab Bukhari

Re: YUI2 Replacement Method

by Just H -

This is pretty advanced stuff. Might be worth posting in the developers forum (just a quick plea for help pointing to this thread, not a duplicate).

Good luck smile