MDL-21139 replace all yui functions/methods with yui2 to make room for yui3
authorPetr Skoda <skodak@moodle.org>
Wed, 16 Dec 2009 20:25:14 +0000 (20:25 +0000)
committerPetr Skoda <skodak@moodle.org>
Wed, 16 Dec 2009 20:25:14 +0000 (20:25 +0000)
48 files changed:
admin/report/capability/index.php
admin/report/security/lib.php
admin/report/spamcleaner/index.php
admin/roles/assign.php
admin/roles/lib.php
blocks/admin_tree/block_admin_tree.php
blocks/global_navigation_tree/block_global_navigation_tree.php
blocks/settings_navigation_tree/block_settings_navigation_tree.php
calendar/event.php
calendar/lib.php
calendar/view.php
comment/index.php
course/report/progress/index.php
course/view.php
grade/edit/tree/index.php
grade/report/grader/index.php
group/index.php
iplookup/index.php
lib/ajax/ajaxlib.php
lib/commentlib.php
lib/deprecatedlib.php
lib/form/filemanager.php
lib/form/searchableselector.php
lib/formslib.php
lib/moodlelib.php
lib/outputrenderers.php
lib/questionlib.php
lib/resourcelib.php
lib/weblib.php
mod/chat/gui_ajax/index.php
mod/folder/view.php
mod/forum/discuss.php
mod/forum/view.php
mod/imscp/view.php
mod/lesson/lib.php
mod/quiz/attemptlib.php
mod/quiz/edit.php
mod/quiz/mod_form.php
mod/quiz/view.php
mod/resource/locallib.php
mod/url/locallib.php
mod/wiki/view.php
portfolio/download/file.php
question/editlib.php
repository/lib.php
tag/edit.php
theme/lines/meta.php
user/selector/lib.php

index a237691..41220d2 100644 (file)
@@ -38,7 +38,7 @@ if (empty($cleanedroleids)) {
 }
 
 // Include the required JavaScript.
-$PAGE->requires->yui_lib('event');
+$PAGE->requires->yui2_lib('event');
 $PAGE->requires->js('admin/report/capability/script.js');
 $PAGE->requires->js_function_call('capability_report.cap_filter_init', array(get_string('search')));
 
index 042933f..e17ee8a 100644 (file)
@@ -34,7 +34,7 @@ define('REPORT_SECURITY_CRITICAL', 'critical');
 
 function report_security_hide_timearning() {
      global $PAGE;
-     $PAGE->requires->yui_lib('dom');
+     $PAGE->requires->yui2_lib('dom');
      $PAGE->requires->js_function_call('YAHOO.util.Dom.addClass', Array('timewarning', 'timewarninghidden'));
 }
 
index 478a56d..88278c2 100755 (executable)
@@ -41,8 +41,8 @@ $id = optional_param('id', '', PARAM_INT);
 
 require_login();
 admin_externalpage_setup('reportspamcleaner');
-$PAGE->requires->yui_lib('json');
-$PAGE->requires->yui_lib('connection');
+$PAGE->requires->yui2_lib('json');
+$PAGE->requires->yui2_lib('connection');
 
 // Implement some AJAX calls
 
index 744cee1..a5e4850 100755 (executable)
     }
 
 /// Print the header and tabs
-    $PAGE->requires->yui_lib('dom-event');
+    $PAGE->requires->yui2_lib('dom-event');
     $PAGE->requires->js($CFG->admin . '/roles/roles.js');
     if ($context->contextlevel == CONTEXT_USER) {
         $user = $DB->get_record('user', array('id'=>$userid));
index 226e08e..76fd7af 100644 (file)
@@ -122,7 +122,7 @@ abstract class capability_table_base {
             echo "</tbody>\n</table>\n";
             if (count($this->capabilities) > capability_table_base::NUM_CAPS_FOR_SEARCH) {
                 global $CFG, $PAGE;
-                $PAGE->requires->yui_lib('dom-event');
+                $PAGE->requires->yui2_lib('dom-event');
                 $PAGE->requires->js($CFG->admin . '/roles/roles.js');
                 $PAGE->requires->js_function_call('cap_table_filter.init',
                         array($this->id, get_string('filter'), get_string('clear')));
index be6f3fc..a0d9ed7 100644 (file)
@@ -137,7 +137,7 @@ class block_admin_tree extends block_base {
         }
 
         if ($this->tempcontent !== '') {
-            $this->page->requires->yui_lib('event');
+            $this->page->requires->yui2_lib('event');
             $this->page->requires->js('blocks/admin_tree/admintree.js');
             $this->page->requires->js_function_call('admin_tree.init',
                     array($this->divcounter - 1, $this->expandnodes,
index 9586b8e..175d9bc 100644 (file)
@@ -88,7 +88,7 @@ class block_global_navigation_tree extends block_tree {
         if ($this->contentgenerated === true) {
             return true;
         }
-        $this->page->requires->yui_lib('dom');
+        $this->page->requires->yui2_lib('dom');
         $this->page->requires->js('lib/javascript-navigation.js');
         // Navcount is used to allow us to have multiple trees although I dont' know why
         // you would want to trees the same
index 881f54e..6ceb6e9 100644 (file)
@@ -87,7 +87,7 @@ class block_settings_navigation_tree extends block_tree {
         if ($this->contentgenerated === true) {
             return true;
         }
-        $this->page->requires->yui_lib('dom');
+        $this->page->requires->yui2_lib('dom');
         $this->page->requires->js('lib/javascript-navigation.js');
         block_settings_navigation_tree::$navcount++;
 
index 7c2fda7..405a959 100644 (file)
@@ -200,7 +200,7 @@ if ($data) {
     redirect($eventurl);
                 }
 
-$PAGE->requires->yui_lib('animation');
+$PAGE->requires->yui2_lib('animation');
 $PAGE->requires->js('calendar/calendar.js');
 
 $PAGE->navbar->add($strcalendar, $link);
index e40a87b..118e190 100644 (file)
@@ -379,7 +379,7 @@ function calendar_get_popup($is_today, $event_timestart, $popupcontent='') {
         $popupcaption .= get_string('eventsfor', 'calendar', userdate($event_timestart, get_string('strftimedayshort')));
     }
     $id = 'calendar_tooltip_'.$popupcount;
-    $PAGE->requires->yui_lib('container');
+    $PAGE->requires->yui2_lib('container');
     $PAGE->requires->js_function_call('YAHOO.moodle.calendar.attach_calendar_panel', Array(Array('id'=>$id,'title'=>$popupcaption, 'content'=>$popupcontent)));
     $popupcount++;
     return 'id="'.$id.'"';
index 8b4cbc6..18ed3b5 100644 (file)
@@ -155,7 +155,7 @@ $PAGE->set_heading($strcalendar);
 $PAGE->set_headingmenu(user_login_string($site));
 $PAGE->set_button($prefsbutton);
 
-$PAGE->requires->yui_lib('animation');
+$PAGE->requires->yui2_lib('animation');
 $PAGE->requires->js('calendar/calendar.js');
 
 echo $OUTPUT->header();
index fcf4e86..9b7f2f6 100644 (file)
@@ -28,12 +28,12 @@ admin_externalpage_setup('comments');
 $context = get_context_instance(CONTEXT_SYSTEM);
 require_capability('moodle/comment:delete', $context);
 
-$PAGE->requires->yui_lib('yahoo')->in_head();
-$PAGE->requires->yui_lib('dom')->in_head();
-$PAGE->requires->yui_lib('event')->in_head();
-$PAGE->requires->yui_lib('animation')->in_head();
-$PAGE->requires->yui_lib('json')->in_head();
-$PAGE->requires->yui_lib('connection')->in_head();
+$PAGE->requires->yui2_lib('yahoo')->in_head();
+$PAGE->requires->yui2_lib('dom')->in_head();
+$PAGE->requires->yui2_lib('event')->in_head();
+$PAGE->requires->yui2_lib('animation')->in_head();
+$PAGE->requires->yui2_lib('json')->in_head();
+$PAGE->requires->yui2_lib('connection')->in_head();
 $PAGE->requires->js('comment/admin.js')->in_head();
 
 $action     = optional_param('action', '', PARAM_ALPHA);
index 8c9bc94..0dde053 100644 (file)
@@ -104,7 +104,7 @@ if($csv) {
     echo $OUTPUT->header();
 
     if($svgcleverness) {
-        $PAGE->requires->yui_lib('event');
+        $PAGE->requires->yui2_lib('event');
         $PAGE->requires->js('course/report/progress/textrotate.js');
     }
 
index 6bae6db..2e3a1ad 100644 (file)
                                                              // Course-based switches
 
             if (ajaxenabled($CFG->ajaxtestedbrowsers)) {     // Browser, user and site-based switches
-                $PAGE->requires->yui_lib('dragdrop')->asap();
-                $PAGE->requires->yui_lib('connection')->asap();
-                $PAGE->requires->yui_lib('selector')->asap();
+                $PAGE->requires->yui2_lib('dragdrop')->asap();
+                $PAGE->requires->yui2_lib('connection')->asap();
+                $PAGE->requires->yui2_lib('selector')->asap();
                 $PAGE->requires->js('lib/ajax/block_classes.js')->asap();
                 $PAGE->requires->js('lib/ajax/section_classes.js')->asap();
 
 
     $completion = new completion_info($course);
     if ($completion->is_enabled() && ajaxenabled()) {
-        $PAGE->requires->yui_lib('connection')->asap();
+        $PAGE->requires->yui2_lib('connection')->asap();
         $PAGE->requires->js('course/completion.js')->asap();
         $PAGE->requires->js_function_call('completion_init')->on_dom_ready();
         $PAGE->requires->data_for_js('completion_strsaved', get_string('saved', 'completion'));
index b850596..90b6701 100644 (file)
@@ -28,13 +28,13 @@ require_once $CFG->dirroot.'/grade/lib.php';
 require_once $CFG->dirroot.'/grade/report/lib.php'; // for preferences
 require_once $CFG->dirroot.'/grade/edit/tree/lib.php';
 
-$PAGE->requires->yui_lib('event');
-$PAGE->requires->yui_lib('json');
-$PAGE->requires->yui_lib('connection');
-$PAGE->requires->yui_lib('dragdrop');
-$PAGE->requires->yui_lib('element');
-$PAGE->requires->yui_lib('container');
-$PAGE->requires->yui_lib('animation');
+$PAGE->requires->yui2_lib('event');
+$PAGE->requires->yui2_lib('json');
+$PAGE->requires->yui2_lib('connection');
+$PAGE->requires->yui2_lib('dragdrop');
+$PAGE->requires->yui2_lib('element');
+$PAGE->requires->yui2_lib('container');
+$PAGE->requires->yui2_lib('animation');
 $PAGE->requires->js('grade/edit/tree/functions.js');
 
 $courseid        = required_param('id', PARAM_INT);
index 3a4213e..b5225f4 100644 (file)
@@ -110,12 +110,12 @@ $reportname = get_string('modulename', 'gradereport_grader');
 // Initialise the grader report object
 $report = new grade_report_grader($courseid, $gpr, $context, $page, $sortitemid);
 
-$PAGE->requires->yui_lib('event');
-$PAGE->requires->yui_lib('json');
-$PAGE->requires->yui_lib('connection');
-$PAGE->requires->yui_lib('dragdrop');
-$PAGE->requires->yui_lib('element');
-$PAGE->requires->yui_lib('container');
+$PAGE->requires->yui2_lib('event');
+$PAGE->requires->yui2_lib('json');
+$PAGE->requires->yui2_lib('connection');
+$PAGE->requires->yui2_lib('dragdrop');
+$PAGE->requires->yui2_lib('element');
+$PAGE->requires->yui2_lib('container');
 $PAGE->requires->js('grade/report/grader/functions.js');
 $PAGE->requires->js('grade/report/grader/grader.js');
 $PAGE->requires->js('lib/overlib/overlib.js')->in_head();
index 7c33cf8..4f76f72 100644 (file)
@@ -13,7 +13,7 @@ require_once('lib.php');
 
 ini_set('include_path', $CFG->libdir.'/pear'.PATH_SEPARATOR.ini_get('include_path'));
 
-$PAGE->requires->yui_lib('connection');
+$PAGE->requires->yui2_lib('connection');
 $PAGE->requires->js('group/clientlib.js');
 
 $courseid = required_param('id', PARAM_INT);
index 5db39ae..57b5b75 100644 (file)
@@ -155,7 +155,7 @@ if (empty($CFG->googlemapkey)) {
 
     $PAGE->requires->js("http://maps.google.com/maps?file=api&amp;v=2&amp;key=$CFG->googlemapkey", true)->in_head();
     $PAGE->requires->js('/iplookup/functions.js')->in_head();
-    $PAGE->requires->yui_lib('event');
+    $PAGE->requires->yui2_lib('event');
     $PAGE->requires->js_function_call('iplookup_load', array($latitude, $longitude));
 
     $PAGE->set_title(get_string('iplookup', 'admin').': '.$info);
index d6a0913..efd25a3 100644 (file)
@@ -51,7 +51,7 @@ function setup_core_javascript(page_requirements_manager $requires) {
     $requires->data_for_js('moodle_cfg', $config)->in_head();
 
     if (debugging('', DEBUG_DEVELOPER)) {
-        $requires->yui_lib('logger');
+        $requires->yui2_lib('logger');
     }
 
     $requires->skip_link_to('maincontent', get_string('tocontent', 'access'));
@@ -59,8 +59,8 @@ function setup_core_javascript(page_requirements_manager $requires) {
     // Note that, as a short-cut, the code
     // $js = "document.body.className += ' jsenabled';\n";
     // is hard-coded in {@link page_requirements_manager::get_top_of_body_code)
-    $requires->yui_lib('container');
-    $requires->yui_lib('connection');
+    $requires->yui2_lib('container');
+    $requires->yui2_lib('connection');
     $requires->string_for_js('confirmation', 'admin');
     $requires->string_for_js('cancel', 'moodle');
     $requires->string_for_js('yes', 'moodle');
@@ -154,14 +154,14 @@ class page_requirements_manager {
      * of other libraries) it will only be linked to once.
      *
      * @param $libname the name of the YUI library you require. For example 'autocomplete'.
-     * @return required_yui_lib A requried_yui_lib object. This allows you to control when the
-     *      link to the script is output by calling methods like {@link required_yui_lib::asap()} or
-     *      {@link required_yui_lib::in_head()}.
+     * @return required_yui2_lib A required_yui2_lib object. This allows you to control when the
+     *      link to the script is output by calling methods like {@link required_yui2_lib::asap()} or
+     *      {@link required_yui2_lib::in_head()}.
      */
-    public function yui_lib($libname) {
+    public function yui2_lib($libname) {
         $key = 'yui:' . $libname;
         if (!isset($this->linkedrequirements[$key])) {
-            $this->linkedrequirements[$key] = new required_yui_lib($this, $libname);
+            $this->linkedrequirements[$key] = new required_yui2_lib($this, $libname);
         }
         return $this->linkedrequirements[$key];
     }
@@ -370,7 +370,7 @@ class page_requirements_manager {
     public function event_handler($id, $event, $function, $arguments=array()) {
         $requirement = new required_event_handler($this, $id, $event, $function, $arguments);
         $this->requiredjscode[] = $requirement;
-        $this->linkedrequirements[] = new required_yui_lib($this, 'event');
+        $this->linkedrequirements[] = new required_yui2_lib($this, 'event');
         return $requirement;
     }
 
@@ -689,7 +689,7 @@ class required_js extends linked_requirement {
  *
  * The methods {@link asap()}, {@link in_head()} and {@link at_top_of_body()}
  * are indented to be used as a fluid API, so you can say things like
- *     $PAGE->requires->yui_lib('autocomplete')->in_head();
+ *     $PAGE->requires->yui2_lib('autocomplete')->in_head();
  *
  * This class (with the help of {@link ajax_resolve_yui2_lib()}) knows about the
  * dependancies between the different YUI libraries, and will include all the
@@ -704,13 +704,13 @@ class required_js extends linked_requirement {
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  * @since Moodle 2.0
  */
-class required_yui_lib extends linked_requirement {
+class required_yui2_lib extends linked_requirement {
     protected $jss = array();
 
     /**
      * Constructor. Normally instances of this class should not be created
      * directly. Client code should create them via the page_requirements_manager
-     * method {@link page_requirements_manager::yui_lib()}.
+     * method {@link page_requirements_manager::yui2_lib()}.
      *
      * @param page_requirements_manager $manager the page_requirements_manager we are associated with.
      * @param string $libname The name of the YUI library you want. See the array
@@ -739,7 +739,7 @@ class required_yui_lib extends linked_requirement {
      * is responsible for outputting this HTML promptly. For example, a good way to
      * call this method is like
      * <pre>
-     *     echo $PAGE->requires->yui_lib(...)->asap();
+     *     echo $PAGE->requires->yui2_lib(...)->asap();
      * </pre>
      */
     public function asap() {
@@ -848,7 +848,7 @@ class required_skip_link extends linked_requirement {
     /**
      * Constructor. Normally instances of this class should not be created directly.
      * Client code should create them via the page_requirements_manager
-     * method {@link page_requirements_manager::yui_lib()}.
+     * method {@link page_requirements_manager::yui2_lib()}.
      *
      * @param page_requirements_manager $manager the page_requirements_manager we are associated with.
      * @param string $target the name of the anchor in the page we are linking to.
@@ -1015,7 +1015,7 @@ class required_js_function_call extends required_js_code {
         if ($this->is_done() || $this->when < page_requirements_manager::WHEN_AT_END) {
             return;
         }
-        $this->manager->yui_lib('event');
+        $this->manager->yui2_lib('event');
         $this->when = page_requirements_manager::WHEN_ON_DOM_READY;
     }
 
index 7aceb95..deafc23 100644 (file)
@@ -178,12 +178,12 @@ EOD;
         self::$comment_context = optional_param('comment_context', '', PARAM_INT);
         self::$comment_area    = optional_param('comment_area',    '', PARAM_ALPHAEXT);
 
-        $PAGE->requires->yui_lib('yahoo')->in_head();
-        $PAGE->requires->yui_lib('dom')->in_head();
-        $PAGE->requires->yui_lib('event')->in_head();
-        $PAGE->requires->yui_lib('animation')->in_head();
-        $PAGE->requires->yui_lib('json')->in_head();
-        $PAGE->requires->yui_lib('connection')->in_head();
+        $PAGE->requires->yui2_lib('yahoo')->in_head();
+        $PAGE->requires->yui2_lib('dom')->in_head();
+        $PAGE->requires->yui2_lib('event')->in_head();
+        $PAGE->requires->yui2_lib('animation')->in_head();
+        $PAGE->requires->yui2_lib('json')->in_head();
+        $PAGE->requires->yui2_lib('connection')->in_head();
         $PAGE->requires->js('comment/comment.js')->in_head();
         $PAGE->requires->string_for_js('addcomment', 'moodle');
         $PAGE->requires->string_for_js('deletecomment', 'moodle');
index 3be437d..b19f26f 100644 (file)
@@ -1672,11 +1672,11 @@ function use_html_editor($name='', $editorhidebuttons='', $id='') {
 
 /**
  * The old method that was used to include JavaScript libraries.
- * Please use $PAGE->requires->js() or $PAGE->requires->yui_lib() instead.
+ * Please use $PAGE->requires->js() or $PAGE->requires->yui2_lib() instead.
  *
  * @param mixed $lib The library or libraries to load (a string or array of strings)
  *      There are three way to specify the library:
- *      1. a shorname like 'yui_yahoo'. This translates into a call to $PAGE->requires->yui_lib('yahoo')->asap();
+ *      1. a shorname like 'yui_yahoo'. This translates into a call to $PAGE->requires->yui2_lib('yahoo')->asap();
  *      2. the path to the library relative to wwwroot, for example 'lib/javascript-static.js'
  *      3. (legacy) a full URL like $CFG->wwwroot . '/lib/javascript-static.js'.
  *      2. and 3. lead to a call $PAGE->requires->js('/lib/javascript-static.js').
@@ -1694,10 +1694,10 @@ function require_js($lib) {
 
     // TODO uncomment this once we have eliminated the remaining calls to require_js from core.
     //debugging('Call to deprecated function require_js. Please use $PAGE->requires->js() ' .
-    //        'or $PAGE->requires->yui_lib() instead.', DEBUG_DEVELOPER);
+    //        'or $PAGE->requires->yui2_lib() instead.', DEBUG_DEVELOPER);
 
     if (strpos($lib, 'yui_') === 0) {
-        echo $PAGE->requires->yui_lib(substr($lib, 4))->asap();
+        echo $PAGE->requires->yui2_lib(substr($lib, 4))->asap();
     } else if (preg_match('/^https?:/', $lib)) {
         echo $PAGE->requires->js(str_replace($CFG->wwwroot, '', $lib))->asap();
     } else {
index 9a8522f..d56be50 100644 (file)
@@ -37,9 +37,9 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element {
         require_once("$CFG->dirroot/repository/lib.php");
 
         // has to require these js files before head
-        $PAGE->requires->yui_lib('menu');
-        $PAGE->requires->yui_lib('connection');
-        $PAGE->requires->yui_lib('json');
+        $PAGE->requires->yui2_lib('menu');
+        $PAGE->requires->yui2_lib('connection');
+        $PAGE->requires->yui2_lib('json');
 
         $options = (array)$options;
         foreach ($options as $name=>$value) {
index 8b8762c..0d2d6ee 100644 (file)
@@ -54,7 +54,7 @@ class MoodleQuickForm_searchableselector extends MoodleQuickForm_select{
         } else {
             // Javascript for the search/selection fields
             global $PAGE;
-            $PAGE->requires->yui_lib('event');
+            $PAGE->requires->yui2_lib('event');
             $PAGE->requires->js('lib/form/searchableselector.js');
             $PAGE->requires->js_function_call('selector.filter_init', array(get_string('search'),$this->getAttribute('id')));
 
index 5697154..dfdb9bd 100644 (file)
@@ -69,8 +69,8 @@ function form_init_date_js() {
     global $PAGE;
     static $done = false;
     if (!$done) {
-        $PAGE->requires->yui_lib('calendar');
-        $PAGE->requires->yui_lib('container');
+        $PAGE->requires->yui2_lib('calendar');
+        $PAGE->requires->yui2_lib('container');
         $PAGE->requires->js_function_call('init_date_selectors',
                 array(get_string('firstdayofweek')));
         $done = true;
@@ -2158,7 +2158,7 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
         }
 
         if (isset($this->_advancedElements[$name])){
-            $PAGE->requires->yui_lib('event');
+            $PAGE->requires->yui2_lib('event');
             // this is tricky - the first submit button on form is "clicked" if user presses enter
             // we do not want to "submit" using advanced button if javascript active
             $button_nojs = '<input name="'.$elementName.'" id="'.$elementName.(string)$advformcount.'" class="showadvancedbtn" value="'.$buttonlabel.'" type="submit" />';
index 44e7a3b..f1ef768 100644 (file)
@@ -1293,7 +1293,7 @@ function user_preference_allow_ajax_update($name, $paramtype) {
     global $USER, $PAGE;
 
     // Make sure that the required JavaScript libraries are loaded.
-    $PAGE->requires->yui_lib('connection');
+    $PAGE->requires->yui2_lib('connection');
 
     // Record in the session that this user_preference is allowed to updated remotely.
     $USER->ajax_updatable_user_prefs[$name] = $paramtype;
index cf0c9b6..3d75105 100644 (file)
@@ -330,8 +330,8 @@ class core_renderer extends renderer_base {
 
         // Perform a browser environment check for the flash version.  Should only run once per login session.
         if (isloggedin() && !empty($CFG->excludeoldflashclients) && empty($SESSION->flashversion)) {
-            $this->page->requires->yui_lib('event')->in_head();
-            $this->page->requires->yui_lib('connection')->in_head();
+            $this->page->requires->yui2_lib('event')->in_head();
+            $this->page->requires->yui2_lib('connection')->in_head();
             $this->page->requires->js('lib/swfobject/swfobject.js')->in_head();
             $this->page->requires->js('lib/flashdetect/flashdetect.js')->in_head();
             $this->page->requires->js_function_call('setflashversiontosession', array($CFG->wwwroot, sesskey()));
@@ -688,8 +688,8 @@ class core_renderer extends renderer_base {
         if ($bc->collapsible != block_contents::NOT_HIDEABLE) {
             $userpref = 'block' . $bc->blockinstanceid . 'hidden';
             user_preference_allow_ajax_update($userpref, PARAM_BOOL);
-            $this->page->requires->yui_lib('dom');
-            $this->page->requires->yui_lib('event');
+            $this->page->requires->yui2_lib('dom');
+            $this->page->requires->yui2_lib('event');
             $plaintitle = strip_tags($bc->title);
             $this->page->requires->js_function_call('new block_hider', array($bc->id, $userpref,
                     get_string('hideblocka', 'access', $plaintitle), get_string('showblocka', 'access', $plaintitle),
@@ -1905,7 +1905,7 @@ class core_renderer extends renderer_base {
         $output .= $this->output_end_tag('table') . "\n";
 
         if ($table->rotateheaders && can_use_rotated_text()) {
-            $this->page->requires->yui_lib('event');
+            $this->page->requires->yui2_lib('event');
             $this->page->requires->js('course/report/progress/textrotate.js');
         }
 
index 60d3734..fdeaaab 100644 (file)
@@ -2127,7 +2127,7 @@ function get_html_head_contributions($questionlist, &$questions, &$states) {
     global $CFG, $PAGE, $QTYPES;
 
     // The question engine's own JavaScript.
-    $PAGE->requires->yui_lib('connection');
+    $PAGE->requires->yui2_lib('connection');
     $PAGE->requires->js('question/qengine.js');
     question_init_qengine_js();
 
index 23e5d9f..1b3d0d0 100644 (file)
@@ -172,7 +172,7 @@ function resourcelib_embed_mp3($fullurl, $title, $clicktoopen) {
 </div>
 OET;
 
-    $PAGE->requires->yui_lib('dom')->in_head();
+    $PAGE->requires->yui2_lib('dom')->in_head();
     $PAGE->requires->js('lib/ufo.js')->in_head();
     $PAGE->requires->js('lib/resourcelib.js')->in_head();
     $code .= $PAGE->requires->data_for_js('FO', $ufoargs)->asap();
@@ -218,7 +218,7 @@ function resourcelib_embed_flashvideo($fullurl, $title, $clicktoopen) {
 </div>
 EOT;
 
-    $PAGE->requires->yui_lib('dom')->in_head();
+    $PAGE->requires->yui2_lib('dom')->in_head();
     $PAGE->requires->js('lib/ufo.js')->in_head();
     $PAGE->requires->js('lib/resourcelib.js')->in_head();
     $code .= $PAGE->requires->data_for_js('FO', $ufoargs)->asap();
index 407b4b3..250a726 100644 (file)
@@ -1567,7 +1567,7 @@ function get_emoticons_list_for_help_file() {
         $fieldname = 'message';
     }
 
-    $PAGE->requires->yui_lib('event');
+    $PAGE->requires->yui2_lib('event');
     $PAGE->requires->js_function_call('emoticons_help.init', array($formname, $fieldname, 'emoticonlist'));
     return $output;
 
@@ -2048,7 +2048,7 @@ function print_collapsible_region_start($classes, $id, $caption, $userpref = fal
     global $CFG, $PAGE, $OUTPUT;
 
     // Include required JavaScript libraries.
-    $PAGE->requires->yui_lib('animation');
+    $PAGE->requires->yui2_lib('animation');
 
     // Work out the initial state.
     if (is_string($userpref)) {
index eeca5f1..ae792ed 100644 (file)
@@ -58,14 +58,14 @@ $str_themes = get_string('themes');
 
 $PAGE->set_pagelayout('popup');
 $PAGE->set_title('Chat');
-$PAGE->requires->yui_lib('dragdrop');
-$PAGE->requires->yui_lib('resize');
-$PAGE->requires->yui_lib('layout');
-$PAGE->requires->yui_lib('container');
-$PAGE->requires->yui_lib('connection');
-$PAGE->requires->yui_lib('json');
-$PAGE->requires->yui_lib('animation');
-$PAGE->requires->yui_lib('menu');
+$PAGE->requires->yui2_lib('dragdrop');
+$PAGE->requires->yui2_lib('resize');
+$PAGE->requires->yui2_lib('layout');
+$PAGE->requires->yui2_lib('container');
+$PAGE->requires->yui2_lib('connection');
+$PAGE->requires->yui2_lib('json');
+$PAGE->requires->yui2_lib('animation');
+$PAGE->requires->yui2_lib('menu');
 
 if (!file_exists(dirname(__FILE__) . '/theme/'.$theme.'/chat.css')) {
     $theme = 'bubble';
@@ -91,7 +91,7 @@ $PAGE->requires->string_for_js('beep', 'chat');
 $PAGE->requires->string_for_js('talk', 'chat');
 
 $PAGE->requires->js('mod/chat/gui_ajax/script.js');
-$PAGE->requires->yui_lib('animation')->in_head();
+$PAGE->requires->yui2_lib('animation')->in_head();
 
 $PAGE->add_body_class('yui-skin-sam');
 $PAGE->set_pagelayout('embedded');
index f91b7da..785981d 100644 (file)
@@ -46,8 +46,8 @@ $context = get_context_instance(CONTEXT_MODULE, $cm->id);
 add_to_log($course->id, 'folder', 'view', 'view.php?id='.$cm->id, $folder->id, $cm->id);
 
 $PAGE->set_url('mod/folder/view.php', array('id' => $cm->id));
-$PAGE->requires->yui_lib('json');
-$PAGE->requires->yui_lib('treeview');
+$PAGE->requires->yui2_lib('json');
+$PAGE->requires->yui2_lib('treeview');
 $PAGE->requires->js('mod/folder/functions.js');
 
 $PAGE->set_title($course->shortname.': '.$folder->name);
index 2671dff..3be7593 100644 (file)
@@ -69,9 +69,9 @@
     require_course_login($course, true, $cm);
 
 /// Add ajax-related libs
-    $PAGE->requires->yui_lib('event');
-    $PAGE->requires->yui_lib('connection');
-    $PAGE->requires->yui_lib('json');
+    $PAGE->requires->yui2_lib('event');
+    $PAGE->requires->yui2_lib('connection');
+    $PAGE->requires->yui2_lib('json');
     $PAGE->requires->js('mod/forum/rate_ajax.js');
 
     // move this down fix for MDL-6926
index 4a569b7..7daa7b4 100644 (file)
@@ -94,9 +94,9 @@
 
 /// Print header.
     /// Add ajax-related libs for ratings if required  MDL-20119
-    $PAGE->requires->yui_lib('event');
-    $PAGE->requires->yui_lib('connection');
-    $PAGE->requires->yui_lib('json');
+    $PAGE->requires->yui2_lib('event');
+    $PAGE->requires->yui2_lib('connection');
+    $PAGE->requires->yui2_lib('json');
     $PAGE->requires->js('mod/forum/rate_ajax.js');
 
     $PAGE->set_title(format_string($forum->name));
index e8ad427..92f57e7 100644 (file)
@@ -46,14 +46,14 @@ $context = get_context_instance(CONTEXT_MODULE, $cm->id);
 add_to_log($course->id, 'imscp', 'view', 'view.php?id='.$cm->id, $imscp->id, $cm->id);
 
 $PAGE->set_url('mod/imscp/view.php', array('id' => $cm->id));
-$PAGE->requires->yui_lib('json')->in_head();
-$PAGE->requires->yui_lib('event')->in_head();
-$PAGE->requires->yui_lib('treeview')->in_head();
-$PAGE->requires->yui_lib('layout')->in_head();
-$PAGE->requires->yui_lib('button')->in_head();
-$PAGE->requires->yui_lib('container')->in_head();
-$PAGE->requires->yui_lib('dragdrop')->in_head();
-$PAGE->requires->yui_lib('resize')->in_head();
+$PAGE->requires->yui2_lib('json')->in_head();
+$PAGE->requires->yui2_lib('event')->in_head();
+$PAGE->requires->yui2_lib('treeview')->in_head();
+$PAGE->requires->yui2_lib('layout')->in_head();
+$PAGE->requires->yui2_lib('button')->in_head();
+$PAGE->requires->yui2_lib('container')->in_head();
+$PAGE->requires->yui2_lib('dragdrop')->in_head();
+$PAGE->requires->yui2_lib('resize')->in_head();
 $PAGE->requires->js('mod/imscp/functions.js')->in_head();
 
 $PAGE->requires->string_for_js('navigation', 'imscp');
index 29320d6..3df5067 100644 (file)
@@ -1036,7 +1036,7 @@ function lesson_get_media_html($lesson, $context) {
     } else {
         // anything else - just try object tag enlarged as much as possible
         $code = resourcelib_embed_general($url, $title, $clicktoopen, $mimetype);
-        $PAGE->requires->yui_lib('dom');
+        $PAGE->requires->yui2_lib('dom');
         $PAGE->requires->js('mod/url/functions.js');
         $PAGE->requires->js_function_call('imscp_setup_object')->on_dom_ready();
     }
index aa9ce35..7209f50 100644 (file)
@@ -737,8 +737,8 @@ class quiz_attempt extends quiz {
         global $PAGE;
         // The JS does important things like navigation and so must be initialised
         // as seen as possible, particularly if the page is loading slowly.
-        $PAGE->requires->yui_lib('dom')->in_head();
-        $PAGE->requires->yui_lib('event')->in_head();
+        $PAGE->requires->yui2_lib('dom')->in_head();
+        $PAGE->requires->yui2_lib('event')->in_head();
         $PAGE->requires->js('mod/quiz/quiz.js')->in_head();
         get_html_head_contributions($this->get_question_ids($page), $this->questions, $this->states);
     }
index c331013..0f98ab1 100644 (file)
@@ -50,8 +50,8 @@
 require_once('../../config.php');
 require_once($CFG->dirroot . '/mod/quiz/editlib.php');
 require_once($CFG->dirroot . '/question/category_class.php');
-$PAGE->requires->yui_lib('container');
-$PAGE->requires->yui_lib('dragdrop');
+$PAGE->requires->yui2_lib('container');
+$PAGE->requires->yui2_lib('dragdrop');
 
 /**
  * Callback function called from question_list() function
index 83b98d6..f246659 100644 (file)
@@ -111,7 +111,7 @@ class mod_quiz_mod_form extends moodleform_mod {
         if (!empty($this->_cm)) {
             $pagegroup[] = &$mform->createElement('checkbox', 'repaginatenow', '', get_string('repaginatenow', 'quiz'), array('id' => 'id_repaginatenow'));
             $mform->disabledIf('repaginatenow', 'shufflequestions', 'eq', 1);
-            $PAGE->requires->yui_lib('event');
+            $PAGE->requires->yui2_lib('event');
             $PAGE->requires->js('mod/quiz/edit.js');
         }
 
index 093135a..14ac628 100644 (file)
@@ -66,7 +66,7 @@
     if ($accessmanager->securewindow_required($canpreview)) {
         $PAGE->requires->js_function_call('popupchecker',array(get_string('popupblockerwarning', 'quiz')));
     }
-    $PAGE->requires->yui_lib('event');
+    $PAGE->requires->yui2_lib('event');
 
     // Note: MDL-19010 there will be further changes to printing header and blocks.
     // The code will be much nicer than this eventually.
index 0c2b499..169f414 100644 (file)
@@ -104,7 +104,7 @@ function resource_display_embed($resource, $cm, $course, $file) {
     } else {
         // anything else - just try object tag enlarged as much as possible
         $code = resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype);
-        $PAGE->requires->yui_lib('dom')->in_head();
+        $PAGE->requires->yui2_lib('dom')->in_head();
         $PAGE->requires->js('mod/url/functions.js')->in_head();
         $PAGE->requires->js_function_call('url_init_object');
     }
index f914a30..4e7ae7a 100644 (file)
@@ -266,7 +266,7 @@ function url_display_embed($url, $cm, $course) {
     } else {
         // anything else - just try object tag enlarged as much as possible
         $code = resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype);
-        $PAGE->requires->yui_lib('dom')->in_head();
+        $PAGE->requires->yui2_lib('dom')->in_head();
         $PAGE->requires->js('mod/url/functions.js')->in_head();
         $PAGE->requires->js_function_call('url_init_object');
     }
index b790180..2109d2a 100644 (file)
@@ -8,7 +8,7 @@
     require_once("lib.php");
     #require_once("$CFG->dirroot/course/lib.php"); // For side-blocks
     require_once($CFG->libdir . '/ajax/ajaxlib.php');
-    $PAGE->requires->yui_lib('connection');
+    $PAGE->requires->yui2_lib('connection');
 
     $ewiki_action = optional_param('ewiki_action', '', PARAM_ALPHA);     // Action on Wiki-Page
     $id           = optional_param('id', 0, PARAM_INT);                  // Course Module ID, or
index 9671f88..3fa89d5 100644 (file)
@@ -13,7 +13,7 @@ if (empty($CFG->enableportfolios)) {
 require_once($CFG->libdir.'/portfoliolib.php');
 require_once($CFG->libdir.'/portfolio/exporter.php');
 
-$PAGE->requires->yui_lib('dom');
+$PAGE->requires->yui2_lib('dom');
 $id = required_param('id', PARAM_INT);
 
 require_login();
index 30dad12..df9a6c6 100644 (file)
@@ -816,7 +816,7 @@ class question_bank_view {
         $this->init_columns($this->wanted_columns());
         $this->init_sort();
 
-        $PAGE->requires->yui_lib('container');
+        $PAGE->requires->yui2_lib('container');
     }
 
     protected function wanted_columns() {
@@ -1935,8 +1935,8 @@ function create_new_question_button($categoryid, $params, $caption, $tooltip = '
     echo $OUTPUT->button($form);
 
     echo $OUTPUT->help_icon(moodle_help_icon::make('types', get_string('createnewquestion', 'question'), 'question'));
-    $PAGE->requires->yui_lib('dragdrop');
-    $PAGE->requires->yui_lib('container');
+    $PAGE->requires->yui2_lib('dragdrop');
+    $PAGE->requires->yui2_lib('container');
     if (!$choiceformprinted) {
         echo '<div id="qtypechoicecontainer">';
         print_choose_qtype_to_add_form(array());
index 2e7cee7..c68a0e4 100644 (file)
@@ -1763,19 +1763,19 @@ function repository_setup_default_plugins() {
 function repository_head_setup() {
     global $PAGE;
 
-    $PAGE->requires->yui_lib('yahoo')->in_head();
-    $PAGE->requires->yui_lib('dom')->in_head();
-    $PAGE->requires->yui_lib('element')->in_head();
-    $PAGE->requires->yui_lib('event')->in_head();
-    $PAGE->requires->yui_lib('json')->in_head();
-    $PAGE->requires->yui_lib('treeview')->in_head();
-    $PAGE->requires->yui_lib('dragdrop')->in_head();
-    $PAGE->requires->yui_lib('container')->in_head();
-    $PAGE->requires->yui_lib('resize')->in_head();
-    $PAGE->requires->yui_lib('layout')->in_head();
-    $PAGE->requires->yui_lib('connection')->in_head();
-    $PAGE->requires->yui_lib('button')->in_head();
-    $PAGE->requires->yui_lib('selector')->in_head();
+    $PAGE->requires->yui2_lib('yahoo')->in_head();
+    $PAGE->requires->yui2_lib('dom')->in_head();
+    $PAGE->requires->yui2_lib('element')->in_head();
+    $PAGE->requires->yui2_lib('event')->in_head();
+    $PAGE->requires->yui2_lib('json')->in_head();
+    $PAGE->requires->yui2_lib('treeview')->in_head();
+    $PAGE->requires->yui2_lib('dragdrop')->in_head();
+    $PAGE->requires->yui2_lib('container')->in_head();
+    $PAGE->requires->yui2_lib('resize')->in_head();
+    $PAGE->requires->yui2_lib('layout')->in_head();
+    $PAGE->requires->yui2_lib('connection')->in_head();
+    $PAGE->requires->yui2_lib('button')->in_head();
+    $PAGE->requires->yui2_lib('selector')->in_head();
 
     //TODO: remove the ->in_head() once we refactor the inline script tags in repo code
     $PAGE->requires->js('repository/repository.src.js')->in_head();
index 4a04427..f6521f5 100644 (file)
@@ -33,8 +33,8 @@ $PAGE->set_context($systemcontext);
 $PAGE->set_blocks_editing_capability('moodle/tag:editblocks');
 $PAGE->set_pagelayout('form');
 
-$PAGE->requires->yui_lib('animation');
-$PAGE->requires->yui_lib('autocomplete');
+$PAGE->requires->yui2_lib('animation');
+$PAGE->requires->yui2_lib('autocomplete');
 
 $tagname = tag_display_name($tag);
 
index d6c6579..f1713a3 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 
-echo $PAGE->requires->yui_lib('animation')->asap(); ?>
+echo $PAGE->requires->yui2_lib('animation')->asap(); ?>
 
 <!--[if IE 7]>
     <link rel="stylesheet" type="text/css" href="<?php echo $CFG->httpsthemewww ?>/lines/styles_ie7.css" />
index 46c5f05..7fd5280 100644 (file)
@@ -105,9 +105,9 @@ abstract class user_selector_base {
         $this->searchanywhere = $this->initialise_option('userselector_searchanywhere', $this->searchanywhere);
 
         // Required JavaScript code.
-        $PAGE->requires->yui_lib('json');
-        $PAGE->requires->yui_lib('connection');
-        $PAGE->requires->yui_lib('datasource');
+        $PAGE->requires->yui2_lib('json');
+        $PAGE->requires->yui2_lib('connection');
+        $PAGE->requires->yui2_lib('datasource');
         $PAGE->requires->js('user/selector/script.js');
     }