MDL-21240 shortened urls now start with / everywhere
authorPetr Skoda <skodak@moodle.org>
Mon, 18 Jan 2010 20:57:32 +0000 (20:57 +0000)
committerPetr Skoda <skodak@moodle.org>
Mon, 18 Jan 2010 20:57:32 +0000 (20:57 +0000)
87 files changed:
admin/report/capability/index.php
admin/report/spamcleaner/index.php
admin/roles/assign.php
admin/roles/lib.php
admin/webservice/service_users.php
admin/xmldb/index.php
blocks/admin_tree/block_admin_tree.php
blocks/calendar_month/block_calendar_month.php
blocks/global_navigation_tree/block_global_navigation_tree.php
blocks/settings_navigation_tree/block_settings_navigation_tree.php
calendar/event.php
calendar/view.php
comment/index.php
course/report/participation/index.php
course/report/progress/index.php
course/view.php
enrol/authorize/locallib.php
filter/mediaplugin/filter.php
grade/edit/tree/index.php
grade/report/grader/index.php
group/index.php
group/members.php
group/overview.php
lib/ajax/ajaxlib.php
lib/commentlib.php
lib/deprecatedlib.php
lib/form/editor.php
lib/form/filemanager.php
lib/form/filepicker.php
lib/form/passwordunmask.php
lib/form/searchableselector.php
lib/form/url.php
lib/outputrenderers.php
lib/questionlib.php
lib/resourcelib.php
lib/upgradelib.php
message/lib.php
message/refresh.php
message/send.php
mod/assignment/lib.php
mod/chat/gui_ajax/index.php
mod/chat/gui_header_js/chatinput.php
mod/chat/gui_header_js/insert.php
mod/chat/gui_header_js/users.php
mod/chat/gui_sockets/chatinput.php
mod/data/edit.php
mod/data/lib.php
mod/data/templates.php
mod/data/view.php
mod/feedback/analysis_course.php
mod/feedback/edit_item.php
mod/feedback/show_entries_anonym.php
mod/folder/view.php
mod/forum/discuss.php
mod/forum/lib.php
mod/forum/search.php
mod/forum/view.php
mod/hotpot/review.php
mod/hotpot/view.php
mod/imscp/view.php
mod/lesson/lib.php
mod/lesson/locallib.php
mod/quiz/accessrules.php
mod/quiz/attempt.php
mod/quiz/attemptlib.php
mod/quiz/edit.php
mod/quiz/mod_form.php
mod/quiz/report/grading/report.php
mod/quiz/review.php
mod/quiz/reviewquestion.php
mod/quiz/summary.php
mod/resource/locallib.php
mod/scorm/datamodels/aicclib.php
mod/scorm/datamodels/scorm_12lib.php
mod/scorm/datamodels/scorm_13lib.php
mod/scorm/loaddatamodel.php
mod/scorm/player.php
mod/survey/view.php
mod/url/locallib.php
question/editlib.php
question/type/multianswer/questiontype.php
question/type/questiontype.php
tag/coursetagslib.php
tag/edit.php
user/index.php
user/selector/lib.php
webservice/amf/testclient/index.php

index 20ca20d..d15924e 100644 (file)
@@ -39,7 +39,7 @@ if (empty($cleanedroleids)) {
 
 // Include the required JavaScript.
 $PAGE->requires->yui2_lib('event');
-$PAGE->requires->js('admin/report/capability/script.js');
+$PAGE->requires->js('/admin/report/capability/script.js');
 $PAGE->requires->js_function_call('capability_report.cap_filter_init', array(get_string('search')));
 
 // Log.
index 88278c2..1f83b18 100755 (executable)
@@ -285,7 +285,7 @@ function print_user_entry($user, $keywords, $count) {
 
 function print_spamcleaner_javascript()  {
     global $PAGE;
-    $PAGE->requires->js('admin/report/spamcleaner/spamcleaner.js');
+    $PAGE->requires->js('/admin/report/spamcleaner/spamcleaner.js');
     $strings = Array('spaminvalidresult','spamdeleteallconfirm','spamcannotdelete','spamdeleteconfirm');
     $PAGE->requires->strings_for_js($strings, 'report_spamcleaner');
     $PAGE->requires->data_for_js('spamcleaner', Array('me'=>me()));
index 2c3a96d..9d096ce 100755 (executable)
 
 /// Print the header and tabs
     $PAGE->requires->yui2_lib('dom-event');
-    $PAGE->requires->js($CFG->admin . '/roles/roles.js');
+    $PAGE->requires->js('/admin/roles/roles.js');
     if ($context->contextlevel == CONTEXT_USER) {
         $user = $DB->get_record('user', array('id'=>$userid));
         $fullname = fullname($user, has_capability('moodle/site:viewfullnames', $context));
index 3344744..d185c1c 100644 (file)
@@ -123,7 +123,7 @@ abstract class capability_table_base {
             if (count($this->capabilities) > capability_table_base::NUM_CAPS_FOR_SEARCH) {
                 global $CFG, $PAGE;
                 $PAGE->requires->yui2_lib('dom-event');
-                $PAGE->requires->js($CFG->admin . '/roles/roles.js');
+                $PAGE->requires->js('/admin/roles/roles.js');
                 $PAGE->requires->js_function_call('cap_table_filter.init',
                         array($this->id, get_string('filter'), get_string('clear')));
             }
index f6c754d..195c78c 100644 (file)
@@ -30,7 +30,7 @@ require_once($CFG->dirroot.'/admin/webservice/lib.php');
 $id = required_param('id', PARAM_INT);
 
 $PAGE->set_url('/admin/webservice/service_users.php', array('id'=>$id));
-$PAGE->requires->js($CFG->admin.'/webservice/script.js');
+$PAGE->requires->js('/admin/webservice/script.js');
 
 admin_externalpage_setup('externalserviceusers');
 admin_externalpage_print_header();
index b2d6480..d455d67 100644 (file)
                             $script = $CFG->admin . '/xmldb/actions/' . $action . '/' . $action . '.js';
                             $file = $CFG->dirroot . '/' . $script;
                             if (file_exists($file) && is_readable($file)) {
-                                $PAGE->requires->js($script);
+                                $PAGE->requires->js('/'.$script);
                             } else if ($postaction) {
                             /// Try to load the postaction javascript if exists
                                 $script = $CFG->admin . '/xmldb/actions/' . $postaction . '/' . $postaction . '.js';
                                 $file = $CFG->dirroot . '/' . $script;
                                 if (file_exists($file) && is_readable($file)) {
-                                    $PAGE->requires->js($script);
+                                    $PAGE->requires->js('/'.$script);
                                 }
                             }
                         }
index 5351f21..8da9137 100644 (file)
@@ -138,7 +138,7 @@ class block_admin_tree extends block_base {
 
         if ($this->tempcontent !== '') {
             $this->page->requires->yui2_lib('event');
-            $this->page->requires->js('blocks/admin_tree/admintree.js');
+            $this->page->requires->js('/blocks/admin_tree/admintree.js');
             $this->page->requires->js_function_call('admin_tree.init',
                     array($this->divcounter - 1, $this->expandnodes,
                     $OUTPUT->pix_url('i/open'), $OUTPUT->pix_url('i/closed'),
index 01f8fed..3297ac0 100644 (file)
@@ -60,7 +60,7 @@ class block_calendar_month extends block_base {
         // Be VERY careful with the format for default courses arguments!
         // Correct formatting is [courseid] => 1 to be concise with moodlelib.php functions.
         calendar_set_filters($courses, $group, $user, $filtercourse, $groupeventsfrom, false);
-        $this->page->requires->js('calendar/calendar.js');
+        $this->page->requires->js('/calendar/calendar.js');
         if ($courseshown == SITEID) {
             // For the front page
             $this->content->text .= calendar_top_controls('frontpage', array('id' => $courseshown, 'm' => $cal_m, 'y' => $cal_y));
index 9a7ff86..4ac631e 100644 (file)
@@ -81,7 +81,7 @@ class block_global_navigation_tree extends block_tree {
 
     function get_required_javascript() {
         $this->_initialise_dock();
-        $this->page->requires->js('blocks/global_navigation_tree/navigation.js');
+        $this->page->requires->js('/blocks/global_navigation_tree/navigation.js');
         user_preference_allow_ajax_update('docked_block_instance_'.$this->instance->id, PARAM_INT);
     }
 
@@ -96,7 +96,7 @@ class block_global_navigation_tree extends block_tree {
         }
         $this->page->requires->yui2_lib('dom');
         // JS for navigation moved to the standard theme, the code will probably have to depend on the actual page structure
-        // $this->page->requires->js('lib/javascript-navigation.js');
+        // $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 ef51316..ec741e5 100644 (file)
@@ -79,7 +79,7 @@ class block_settings_navigation_tree extends block_tree {
 
     function get_required_javascript() {
         $this->_initialise_dock();
-        $this->page->requires->js('blocks/global_navigation_tree/navigation.js');
+        $this->page->requires->js('/blocks/global_navigation_tree/navigation.js');
         $args = array($this->instance->id, array('instance'=>$this->instance->id, 'candock'=>$this->instance_can_be_docked()));
         $this->page->requires->js_function_call('blocks.navigation.setup_new_tree', $args)->on_dom_ready();
         user_preference_allow_ajax_update('docked_block_instance_'.$this->instance->id, PARAM_INT);
@@ -96,7 +96,7 @@ class block_settings_navigation_tree extends block_tree {
         }
         $this->page->requires->yui2_lib('dom');
         // JS for navigation moved to the standard theme, the code will probably have to depend on the actual page structure
-        // $this->page->requires->js('lib/javascript-navigation.js');
+        // $this->page->requires->js('/lib/javascript-navigation.js');
         block_settings_navigation_tree::$navcount++;
 
         // Check if this block has been docked
index 4e777e4..a7ea27e 100644 (file)
@@ -201,7 +201,7 @@ if ($data) {
                 }
 
 $PAGE->requires->yui2_lib('animation');
-$PAGE->requires->js('calendar/calendar.js');
+$PAGE->requires->js('/calendar/calendar.js');
 
 $PAGE->navbar->add($strcalendar, $link);
 $PAGE->navbar->add($title);
index f14f897..13542ba 100644 (file)
@@ -155,7 +155,7 @@ $PAGE->set_heading($strcalendar);
 $PAGE->set_button($prefsbutton);
 
 $PAGE->requires->yui2_lib('animation');
-$PAGE->requires->js('calendar/calendar.js');
+$PAGE->requires->js('/calendar/calendar.js');
 
 echo $OUTPUT->header();
 
index a9d9ec0..673c806 100644 (file)
@@ -34,7 +34,7 @@ $PAGE->requires->yui2_lib('event');
 $PAGE->requires->yui2_lib('animation');
 $PAGE->requires->yui2_lib('json');
 $PAGE->requires->yui2_lib('connection');
-$PAGE->requires->js('comment/admin.js');
+$PAGE->requires->js('/comment/admin.js');
 
 $action     = optional_param('action', '', PARAM_ALPHA);
 $commentid  = optional_param('commentid', 0, PARAM_INT);
index ff96552..31b42b1 100644 (file)
 
         echo '<h2>'.get_string('counteditems', '', $a).'</h2>'."\n";
 
-        echo $PAGE->requires->js('course/report/participation/participation.js')->asap();
+        echo $PAGE->requires->js('/course/report/participation/participation.js')->asap();
 
         echo '<form action="'.$CFG->wwwroot.'/user/action_redir.php" method="post" id="studentsform" onsubmit="return checksubmit(this);">'."\n";
         echo '<div>'."\n";
index 906c8c1..b45fb3a 100644 (file)
@@ -105,7 +105,7 @@ if($csv) {
 
     if($svgcleverness) {
         $PAGE->requires->yui2_lib('event');
-        $PAGE->requires->js('course/report/progress/textrotate.js');
+        $PAGE->requires->js('/course/report/progress/textrotate.js');
     }
 
     // Handle groups (if enabled)
index c9be1ea..8d1d206 100644 (file)
                 $PAGE->requires->yui2_lib('dragdrop');
                 $PAGE->requires->yui2_lib('connection');
                 $PAGE->requires->yui2_lib('selector');
-                $PAGE->requires->js('lib/ajax/block_classes.js');
-                $PAGE->requires->js('lib/ajax/section_classes.js');
+                $PAGE->requires->js('/lib/ajax/block_classes.js');
+                $PAGE->requires->js('/lib/ajax/section_classes.js');
 
                 // Okay, global variable alert. VERY UGLY. We need to create
                 // this object here before the <blockname>_print_block()
     $completion = new completion_info($course);
     if ($completion->is_enabled() && ajaxenabled()) {
         $PAGE->requires->yui2_lib('connection');
-        $PAGE->requires->js('course/completion.js')->in_head();
+        $PAGE->requires->js('/course/completion.js')->in_head();
         $PAGE->requires->js_function_call('completion_init')->on_dom_ready();
         $PAGE->requires->data_for_js('completion_strsaved', get_string('saved', 'completion'));
         $PAGE->requires->data_for_js('completion_strtitley', get_string('completion-title-manual-y', 'completion'));
index 6ecbdeb..91005c6 100644 (file)
@@ -70,7 +70,7 @@ function authorize_print_orders($courseid, $userid) {
     if ($canmanagepayments) {
         $popupmenu .= '<br />';
         $checkbox = html_select_option::make_checkbox(1, $userid == $USER->id, get_string('mypaymentsonly', 'enrol_authorize'));
-        $PAGE->requires->js('enrol/authorize/authorize.js');
+        $PAGE->requires->js('/enrol/authorize/authorize.js');
         $checkbox->add_action('click', 'authorize_jump_to_mypayments', array('userid' => $USER->id, 'status' => $status));
         $popupmenu .= $OUTPUT->checkbox($checkbox, 'showonlymy');
     }
index 40be83a..ade18ad 100644 (file)
@@ -117,7 +117,7 @@ class mediaplugin_filter extends moodle_text_filter {
         }
 
         if (!$this->eolas_fix_applied) {
-            $PAGE->requires->js('filter/mediaplugin/eolas_fix.js');
+            $PAGE->requires->js('/filter/mediaplugin/eolas_fix.js');
             $this->eolas_fix_applied = true;
         }
 
@@ -148,7 +148,7 @@ function mediaplugin_filter_mp3_callback($link) {
     $args['flashvars'] = $c;
     $args['quality'] = 'high';
 
-    $jsoutput = $PAGE->requires->js('lib/ufo.js')->asap();
+    $jsoutput = $PAGE->requires->js('/lib/ufo.js')->asap();
     $jsoutput .= $PAGE->requires->data_for_js('FO', $args)->asap();
     $jsoutput .= $PAGE->requires->js_function_call('create_UFO_object', Array($id))->asap();
 
@@ -175,7 +175,7 @@ function mediaplugin_filter_swf_callback($link) {
     $args['build'] = 40;
     $args['allowscriptaccess'] = 'never';
     $args['quality'] = 'high';
-    $jsoutput = $PAGE->requires->js('lib/ufo.js')->asap();
+    $jsoutput = $PAGE->requires->js('/lib/ufo.js')->asap();
     $jsoutput .= $PAGE->requires->data_for_js('FO', $args)->asap();
     $jsoutput .= $PAGE->requires->js_function_call('create_UFO_object', Array($id))->asap();
 
@@ -204,7 +204,7 @@ function mediaplugin_filter_flv_callback($link) {
     $args['allowscriptaccess'] = 'never';
     $args['quality'] = 'high';
     $args['allowfullscreen'] = 'true';
-    $jsoutput = $PAGE->requires->js('lib/ufo.js')->asap();
+    $jsoutput = $PAGE->requires->js('/lib/ufo.js')->asap();
     $jsoutput .= $PAGE->requires->data_for_js('FO', $args)->asap();
     $jsoutput .= $PAGE->requires->js_function_call('create_UFO_object', Array($id))->asap();
 
index 93f3585..3a211d3 100644 (file)
@@ -35,7 +35,7 @@ $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');
+$PAGE->requires->js('/grade/edit/tree/functions.js');
 
 $courseid        = required_param('id', PARAM_INT);
 $action          = optional_param('action', 0, PARAM_ALPHA);
index 087be33..0a6ec5e 100644 (file)
@@ -116,10 +116,10 @@ $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();
-$PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
+$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();
+$PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->in_head();
 
 if ($report->get_pref('enableajax')) {
     $report = new grade_report_grader_ajax($courseid, $gpr, $context, $page, $sortitemid);
index 8aa6474..4532589 100644 (file)
@@ -14,7 +14,7 @@ require_once('lib.php');
 ini_set('include_path', $CFG->libdir.'/pear'.PATH_SEPARATOR.ini_get('include_path'));
 
 $PAGE->requires->yui2_lib('connection');
-$PAGE->requires->js('group/clientlib.js');
+$PAGE->requires->js('/group/clientlib.js');
 
 $courseid = required_param('id', PARAM_INT);
 $groupid  = optional_param('group', false, PARAM_INT);
index a9254a5..941e5ed 100644 (file)
@@ -77,7 +77,7 @@ $strusergroupmembership = get_string('usergroupmembership', 'group');
 
 $groupname = format_string($group->name);
 
-$PAGE->requires->js('group/clientlib.js');
+$PAGE->requires->js('/group/clientlib.js');
 $PAGE->navbar->add($strparticipants, new moodle_url('/user/index.php', array('id'=>$courseid)));
 $PAGE->navbar->add($strgroups, new moodle_url('/group/index.php', array('id'=>$courseid)));
 $PAGE->navbar->add($stradduserstogroup);
index 5543da6..0b140f3 100644 (file)
@@ -115,8 +115,8 @@ if ($rs = $DB->get_recordset_sql($sql, $params)) {
     $rs->close();
 }
 
-$PAGE->requires->js('lib/overlib/overlib.js')->in_head();
-$PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
+$PAGE->requires->js('/lib/overlib/overlib.js')->in_head();
+$PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->in_head();
 
 $PAGE->navbar->add($strparticipants, new moodle_url('/user/index.php', array('id'=>$courseid)));
 $PAGE->navbar->add($strgroups);
index f1455fd..29819ea 100644 (file)
@@ -33,9 +33,9 @@
  *
  * Typical useage would be
  * <pre>
- *     $PAGE->requires->css('mod/mymod/userstyles.php?id='.$id); // not overriddable via themes!
- *     $PAGE->requires->js('mod/mymod/script.js');
- *     $PAGE->requires->js('mod/mymod/small_but_urgent.js')->in_head();
+ *     $PAGE->requires->css('/mod/mymod/userstyles.php?id='.$id); // not overriddable via themes!
+ *     $PAGE->requires->js('/mod/mymod/script.js');
+ *     $PAGE->requires->js('/mod/mymod/small_but_urgent.js')->in_head();
  *     $PAGE->requires->js_function_call('init_mymod', array($data))->on_dom_ready();
  * </pre>
  *
@@ -881,7 +881,7 @@ abstract class linked_requirement extends requirement_base {
  *
  * 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->js('mod/mymod/script.js')->in_head();
+ *     $PAGE->requires->js('/mod/mymod/script.js')->in_head();
  *
  * However, by default JavaScript files are included at the end of the HTML.
  * This is recommended practice because it means that the web browser will only
index 9429dcd..3295b75 100644 (file)
@@ -184,7 +184,7 @@ EOD;
         $PAGE->requires->yui2_lib('animation');
         $PAGE->requires->yui2_lib('json');
         $PAGE->requires->yui2_lib('connection');
-        $PAGE->requires->js('comment/comment.js')->in_head();
+        $PAGE->requires->js('/comment/comment.js')->in_head();
         $PAGE->requires->string_for_js('addcomment', 'moodle');
         $PAGE->requires->string_for_js('deletecomment', 'moodle');
         $PAGE->requires->string_for_js('comments', 'moodle');
index a17e9e9..c79cde3 100644 (file)
@@ -1698,7 +1698,7 @@ function require_js($lib) {
     if (strpos($lib, 'yui_') === 0) {
         $PAGE->requires->yui2_lib(substr($lib, 4));
     } else if (preg_match('/^https?:/', $lib)) {
-        echo $PAGE->requires->js(str_replace($CFG->wwwroot, '', $lib))->asap();
+        echo $PAGE->requires->js(str_replace($CFG->wwwroot, '/', $lib))->asap();
     } else {
         echo $PAGE->requires->js($lib)->asap();
     }
index 22c93a6..da4166a 100644 (file)
@@ -19,7 +19,7 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
 
     function MoodleQuickForm_editor($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
         global $CFG, $PAGE;
-        $PAGE->requires->js('lib/form/filepicker.js');
+        $PAGE->requires->js('/lib/form/filepicker.js');
 
         $options = (array)$options;
         foreach ($options as $name=>$value) {
index 92735d0..1d882c0 100644 (file)
@@ -46,8 +46,8 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element {
             $this->_options['maxbytes'] = get_max_upload_file_size($CFG->maxbytes, $options['maxbytes']);
         }
         parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
-        $PAGE->requires->js('repository/filepicker.js');
-        $PAGE->requires->js('lib/form/filemanager.js');
+        $PAGE->requires->js('/repository/filepicker.js');
+        $PAGE->requires->js('/lib/form/filemanager.js');
     }
 
     function setName($name) {
index 2bb18b8..cf00a14 100644 (file)
@@ -80,7 +80,7 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_input {
         }
 
         $client_id = uniqid();
-        $PAGE->requires->js('lib/form/filepicker.js');
+        $PAGE->requires->js('/lib/form/filepicker.js');
 
         $args = new stdclass;
         // need these three to filter repositories list
index 9c485b2..37f5232 100644 (file)
@@ -26,7 +26,7 @@ class MoodleQuickForm_passwordunmask extends MoodleQuickForm_password {
             $id = $this->getAttribute('id');
             $unmask = get_string('unmaskpassword', 'form');
             $unmaskjs = $PAGE->requires->data_for_js('punmask',Array('id'=>$id, 'unmaskstr'=>$unmask))->asap();
-            $unmaskjs .= $PAGE->requires->js('lib/form/passwordunmask.js')->asap();
+            $unmaskjs .= $PAGE->requires->js('/lib/form/passwordunmask.js')->asap();
             return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' /><div class="unmask" id="'.$id.'unmaskdiv"></div>'.$unmaskjs;
         }
     } //end func toHtml
index 0d2d6ee..7ecf4b9 100644 (file)
@@ -55,7 +55,7 @@ class MoodleQuickForm_searchableselector extends MoodleQuickForm_select{
             // Javascript for the search/selection fields
             global $PAGE;
             $PAGE->requires->yui2_lib('event');
-            $PAGE->requires->js('lib/form/searchableselector.js');
+            $PAGE->requires->js('/lib/form/searchableselector.js');
             $PAGE->requires->js_function_call('selector.filter_init', array(get_string('search'),$this->getAttribute('id')));
 
             $strHtml = '';
index 22fe5d7..ce0cbd7 100755 (executable)
@@ -60,7 +60,7 @@ class MoodleQuickForm_url extends HTML_QuickForm_text{
 
         $repojs = repository_get_client($context, $client_id, '*', FILE_EXTERNAL);
 
-        $PAGE->requires->js('lib/form/url.js');
+        $PAGE->requires->js('/lib/form/url.js');
         $str .= $repojs;
         $str .= <<<EOD
 <button id="filepicker-btn-{$client_id}" style="display:none" onclick="return url_launch_filepicker('$id', '$client_id', 0)">$straddlink</button>
index 6ae5957..fcfd725 100644 (file)
@@ -310,7 +310,7 @@ class core_renderer extends renderer_base {
             $output .= '<meta http-equiv="refresh" content="'.$this->page->periodicrefreshdelay.';url='.$this->page->url->out().'" />';
         }
 
-        $this->page->requires->js('lib/javascript-static.js')->in_head(); // contains deprecated stuff too, do not add extre file for that for perf reasons!
+        $this->page->requires->js('/lib/javascript-static.js')->in_head(); // contains deprecated stuff too, do not add extre file for that for perf reasons!
         $this->page->requires->js_function_call('setTimeout', array('fix_column_widths()', 20));
 
         $focus = $this->page->focuscontrol;
@@ -346,8 +346,8 @@ class core_renderer extends renderer_base {
         if (isloggedin() && !empty($CFG->excludeoldflashclients) && empty($SESSION->flashversion)) {
             $this->page->requires->yui2_lib('event');
             $this->page->requires->yui2_lib('connection');
-            $this->page->requires->js('lib/swfobject/swfobject.js')->in_head();
-            $this->page->requires->js('lib/flashdetect/flashdetect.js')->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()));
         }
 
@@ -2216,7 +2216,7 @@ class core_renderer extends renderer_base {
 
         if ($table->rotateheaders && can_use_rotated_text()) {
             $this->page->requires->yui2_lib('event');
-            $this->page->requires->js('course/report/progress/textrotate.js');
+            $this->page->requires->js('/course/report/progress/textrotate.js');
         }
 
         return $output;
index a31fd87..cf7cb7b 100644 (file)
@@ -2128,7 +2128,7 @@ function get_html_head_contributions($questionlist, &$questions, &$states) {
 
     // The question engine's own JavaScript.
     $PAGE->requires->yui2_lib('connection');
-    $PAGE->requires->js('question/qengine.js');
+    $PAGE->requires->js('/question/qengine.js');
     question_init_qengine_js();
 
     // Anything that questions on this page need.
index 858c2c3..032264a 100644 (file)
@@ -168,8 +168,8 @@ function resourcelib_embed_mp3($fullurl, $title, $clicktoopen) {
 OET;
 
     $PAGE->requires->yui2_lib('dom');
-    $PAGE->requires->js('lib/ufo.js')->in_head();
-    $PAGE->requires->js('lib/resourcelib.js')->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();
     $code .= $PAGE->requires->js_function_call('resourcelib_create_UFO_object', array($id))->asap();
     return $code;
@@ -214,8 +214,8 @@ function resourcelib_embed_flashvideo($fullurl, $title, $clicktoopen) {
 EOT;
 
     $PAGE->requires->yui2_lib('dom');
-    $PAGE->requires->js('lib/ufo.js')->in_head();
-    $PAGE->requires->js('lib/resourcelib.js')->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();
     $code .= $PAGE->requires->js_function_call('resourcelib_create_UFO_object', array($id))->asap();
     return $code;
index 89d4614..615c571 100644 (file)
@@ -1106,7 +1106,7 @@ function print_upgrade_part_end($plugin, $installation, $verbose) {
  */
 function upgrade_get_javascript() {
     global $PAGE;
-    $PAGE->requires->js('lib/javascript-static.js')->at_top_of_body();
+    $PAGE->requires->js('/lib/javascript-static.js')->at_top_of_body();
     $PAGE->requires->js_function_call('repeatedly_scroll_to_end')->at_top_of_body();
     $PAGE->requires->js_function_call('cancel_scroll_to_end')->after_delay(1);
 }
index 26e7ea1..839bc4c 100644 (file)
@@ -171,7 +171,7 @@ function message_print_contacts() {
     $autorefresh = '<p align="center" class="note">'.get_string('pagerefreshes', 'message', $CFG->message_contacts_refresh).'</p>';
     $autorefresh = addslashes_js($autorefresh); // js escaping
 
-    $PAGE->requires->js('message/message.js');
+    $PAGE->requires->js('/message/message.js');
     $PAGE->requires->js_function_call('refresh_page', Array(60*1000, $PAGE->url->out()));
 
     echo $OUTPUT->container_start('messagejsautorefresh note center');
index ed35419..22a9c83 100644 (file)
@@ -76,7 +76,7 @@ if ($messages ) {
     }
 }
 
-$PAGE->requires->js('message/message.js')->in_head();
+$PAGE->requires->js('/message/message.js')->in_head();
 $PAGE->requires->js_function_call('refresh_parent_messages_frame');
 $PAGE->requires->data_for_js('chatmessages', Array('msgcount'=>count($jsmessages), 'msg'=>$jsmessages))->in_head();
 
index 8af7caa..0c04039 100644 (file)
@@ -39,7 +39,7 @@ if (has_capability('moodle/site:sendmessage', get_context_instance(CONTEXT_SYSTE
 
     $PAGE->set_pagelayout('popup');
     $PAGE->set_title('send');
-    $PAGE->requires->js('message/message.js');
+    $PAGE->requires->js('/message/message.js');
 
 /// Script parameters
     $userid   = required_param('id', PARAM_INT);
index 62c114f..0330dc6 100644 (file)
@@ -933,7 +933,7 @@ class assignment_base {
         echo $extra_javascript;
 
         echo $PAGE->requires->data_for_js('assignment', Array('nextid'=>$nextid, 'userid'=>$userid))->asap();
-        echo $PAGE->requires->js('mod/assignment/assignment.js')->asap();
+        echo $PAGE->requires->js('/mod/assignment/assignment.js')->asap();
 
         echo '<table cellspacing="0" class="feedback '.$subtype.'" >';
 
index 9e4c011..e1e0b0f 100644 (file)
@@ -90,7 +90,7 @@ $PAGE->requires->string_for_js('modulename', 'chat');
 $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->js('/mod/chat/gui_ajax/script.js');
 $PAGE->requires->yui2_lib('animation');
 
 $PAGE->add_body_class('yui-skin-sam');
index 1e220c6..5493e5d 100644 (file)
@@ -32,7 +32,7 @@ $USER = $DB->get_record('user', array('id'=>$chatuser->userid));
 
 //Setup course, lang and theme
 $PAGE->set_course($course);
-$PAGE->requires->js('mod/chat/gui_header_js/chat_gui_header.js')->in_head();
+$PAGE->requires->js('/mod/chat/gui_header_js/chat_gui_header.js')->in_head();
 $PAGE->set_pagelayout('embedded');
 $PAGE->set_focuscontrol('input_chat_message');
 $PAGE->set_cacheable(false);
index d057098..cf306aa 100644 (file)
@@ -64,7 +64,7 @@ if (!empty($chat_message)) {
 
 if ($chatuser->version == 'header_js') {
     /// force msg referesh ASAP
-    echo $PAGE->requires->js('mod/chat/gui_header_js/chat_gui_header.js')->asap();
+    echo $PAGE->requires->js('/mod/chat/gui_header_js/chat_gui_header.js')->asap();
     if ($CFG->chat_normal_updatemode != 'jsupdated') {  // See bug MDL-6791
         echo $PAGE->requires->js_function_call('insert_redirect')->asap();;
     }
index ba35605..a458ba8 100644 (file)
@@ -69,7 +69,7 @@ foreach ($chatusers as $chatuser) {
     $i++;
 }
 $PAGE->requires->data_for_js('uidles', $uidles)->in_head();
-$PAGE->requires->js('mod/chat/gui_header_js/chat_gui_header.js')->in_head();
+$PAGE->requires->js('/mod/chat/gui_header_js/chat_gui_header.js')->in_head();
 $PAGE->requires->js_function_call('start')->on_dom_ready();
 ob_start();
 echo $OUTPUT->header();
index 927e158..929df8a 100644 (file)
@@ -18,7 +18,7 @@ $USER = $DB->get_record('user', array('id'=>$chatuser->userid));
 
 //Setup course, lang and theme
 $PAGE->set_course($DB->get_record('course', array('id' => $chatuser->course)));
-$PAGE->requires->js('mod/chat/gui_sockets/chat_gui_sockets.js')->in_head();
+$PAGE->requires->js('/mod/chat/gui_sockets/chat_gui_sockets.js')->in_head();
 $PAGE->requires->js_function_call('setfocus');
 $PAGE->set_focuscontrol('chat_message');
 $PAGE->set_cacheable(false);
index 58bb1e4..de89f55 100755 (executable)
@@ -117,7 +117,7 @@ if ($data->csstemplate) {
     $PAGE->requires->css('/mod/data/css.php?d='.$data->id);
 }
 if ($data->jstemplate) {
-    $PAGE->requires->js('mod/data/js.php?d='.$data->id)->in_head();
+    $PAGE->requires->js('/mod/data/js.php?d='.$data->id)->in_head();
 }
 
 
index 9d48b3b..58a69d1 100755 (executable)
@@ -1426,7 +1426,7 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
     else {
         $checked = '';
     }
-    $PAGE->requires->js('mod/data/data.js');
+    $PAGE->requires->js('/mod/data/data.js');
     echo '&nbsp;<input type="hidden" name="advanced" value="0" />';
     echo '&nbsp;<input type="hidden" name="filter" value="1" />';
     echo '&nbsp;<input type="checkbox" id="advancedcheckbox" name="advanced" value="1" '.$checked.' onchange="showHideAdvSearch(this.checked);" /><label for="advancedcheckbox">'.get_string('advancedsearch', 'data').'</label>';
index 3dfd09f..566ac50 100755 (executable)
@@ -89,7 +89,7 @@ $bodytag .= 'currTextarea = document.getElementById(\'tempform\').template;';
 $bodytag .= '" ';
 
 $PAGE->navbar->add(get_string($mode,'data'));
-$PAGE->requires->js('mod/data/data.js');
+$PAGE->requires->js('/mod/data/data.js');
 $PAGE->set_title($data->name);
 echo $OUTPUT->header();
 echo $OUTPUT->heading(format_string($data->name));
index 003f117..da8a44f 100755 (executable)
         $PAGE->requires->css('/mod/data/css.php?d='.$data->id);
     }
     if ($data->jstemplate) {
-        $PAGE->requires->js('mod/data/js.php?d='.$data->id)->in_head();
+        $PAGE->requires->js('/mod/data/js.php?d='.$data->id)->in_head();
     }
 
 /// Print the page header
index 9a61e63..bb8d31b 100644 (file)
@@ -144,7 +144,7 @@ if ($courseitemfilter > 0) {
     echo '<input type="hidden" name="courseitemfilter" value="'.$courseitemfilter.'" />';
     echo '<input type="hidden" name="courseitemfiltertyp" value="'.$courseitemfiltertyp.'" />';
     echo '<input type="hidden" name="courseid" value="'.$courseid.'" />';
-    echo $PAGE->requires->js('mod/feedback/feedback.js')->asap();
+    echo $PAGE->requires->js('/mod/feedback/feedback.js')->asap();
     $sql = 'select c.id, c.shortname from {course} c, '.
                                           '{feedback_value} fv, {feedback_item} fi '.
                                           'where c.id = fv.course_id and fv.item = fi.id '.
index 0569c11..cb5c972 100644 (file)
@@ -227,7 +227,7 @@ echo '</form>';
 // echo $OUTPUT->box_end();
 
 if ($typ!='label') {
-    $PAGE->requires->js('mod/feedback/feedback.js');
+    $PAGE->requires->js('/mod/feedback/feedback.js');
     $PAGE->requires->js_function_call('set_item_focus', Array('id_itemname'));
 }
 
index 11b29f1..d3822d6 100644 (file)
@@ -85,7 +85,7 @@ echo $OUTPUT->heading(format_text($feedback->name));
 echo $OUTPUT->continue_button(htmlspecialchars('show_entries.php?id='.$id.'&do_show=showentries'));
 //print the list with anonymous completeds
 echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
-$PAGE->requires->js('mod/feedback/feedback.js');
+$PAGE->requires->js('/mod/feedback/feedback.js');
 ?>
 <div class="mdl-align">
 <form name="frm" action="<?php echo me();?>" method="post">
index a9366b3..70dba5e 100644 (file)
@@ -48,7 +48,7 @@ add_to_log($course->id, 'folder', 'view', 'view.php?id='.$cm->id, $folder->id, $
 $PAGE->set_url('/mod/folder/view.php', array('id' => $cm->id));
 $PAGE->requires->yui2_lib('json');
 $PAGE->requires->yui2_lib('treeview');
-$PAGE->requires->js('mod/folder/functions.js');
+$PAGE->requires->js('/mod/folder/functions.js');
 
 $PAGE->set_title($course->shortname.': '.$folder->name);
 $PAGE->set_heading($course->fullname);
index e360eed..ca0ef71 100644 (file)
@@ -72,7 +72,7 @@
     $PAGE->requires->yui2_lib('event');
     $PAGE->requires->yui2_lib('connection');
     $PAGE->requires->yui2_lib('json');
-    $PAGE->requires->js('mod/forum/rate_ajax.js');
+    $PAGE->requires->js('/mod/forum/rate_ajax.js');
 
     // move this down fix for MDL-6926
     require_once('lib.php');
index 226c82f..5f6c4a8 100644 (file)
@@ -5012,7 +5012,7 @@ function forum_get_subscribe_link($forum, $context, $messages = array(), $cantac
         $link = '';
 
         if ($fakelink) {
-            $PAGE->requires->js('mod/forum/forum.js');
+            $PAGE->requires->js('/mod/forum/forum.js');
             $PAGE->requires->js_function_call('forum_produce_subscribe_link', Array($forum->id, $backtoindexlink, $linktext, $linktitle));
             $link = "<noscript>";
         }
@@ -5067,7 +5067,7 @@ function forum_get_tracking_link($forum, $messages=array(), $fakelink=true) {
 
     $link = '';
     if ($fakelink) {
-        $PAGE->requires->js('mod/forum/forum.js');
+        $PAGE->requires->js('/mod/forum/forum.js');
         $PAGE->requires->js_function_call('forum_produce_tracking_link', Array($forum->id, $linktext, $linktitle));
         // use <noscript> to print button in case javascript is not enabled
         $link .= '<noscript>';
index 9f8488e..376c44c 100644 (file)
@@ -271,7 +271,7 @@ function forum_print_big_search_form($course) {
 
     echo $OUTPUT->box_start('generalbox boxaligncenter');
 
-    echo $PAGE->requires->js('mod/forum/forum.js')->asap();
+    echo $PAGE->requires->js('/mod/forum/forum.js')->asap();
 
     echo '<form id="searchform" action="search.php" method="get">';
     echo '<table cellpadding="10" class="searchbox" id="form">';
index be5c9dd..25dfebd 100644 (file)
@@ -97,7 +97,7 @@
     $PAGE->requires->yui2_lib('event');
     $PAGE->requires->yui2_lib('connection');
     $PAGE->requires->yui2_lib('json');
-    $PAGE->requires->js('mod/forum/rate_ajax.js');
+    $PAGE->requires->js('/mod/forum/rate_ajax.js');
 
     $PAGE->set_title(format_string($forum->name));
     $PAGE->set_heading(format_string($course->fullname));
index 58bf7bc..f7f82e6 100644 (file)
@@ -55,8 +55,8 @@
     $strmodulename  = get_string("modulename", "hotpot");
     // print header
 
-    $PAGE->requires->js('lib/overlib/overlib.js')->in_head();
-    $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
+    $PAGE->requires->js('/lib/overlib/overlib.js')->in_head();
+    $PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->in_head();
     $PAGE->set_title(format_string($course->shortname) . ": $hotpot->name");
     $PAGE->set_heading($course->fullname);
     echo $OUTPUT->header();
index 46ed484..9b1f8e5 100644 (file)
                 break;
                 default:
                     $iframe_id = 'hotpot_iframe';
-                    $PAGE->requires->js('mod/hotpot/iframe.js');
+                    $PAGE->requires->js('/mod/hotpot/iframe.js');
                     $PAGE->requires->js_function_call('set_iframe_height', array($iframe_id))->on_dom_ready();
                     echo $OUTPUT->header();
                     if (!empty($available_msg)) {
index a3a086e..37d4877 100644 (file)
@@ -54,7 +54,7 @@ $PAGE->requires->yui2_lib('button');
 $PAGE->requires->yui2_lib('container');
 $PAGE->requires->yui2_lib('dragdrop');
 $PAGE->requires->yui2_lib('resize');
-$PAGE->requires->js('mod/imscp/functions.js')->in_head();
+$PAGE->requires->js('/mod/imscp/functions.js')->in_head();
 
 $PAGE->requires->string_for_js('navigation', 'imscp');
 $PAGE->requires->string_for_js('toc', 'imscp');
index 338a802..3738d1e 100644 (file)
@@ -1036,7 +1036,7 @@ function lesson_get_media_html($lesson, $context) {
         // anything else - just try object tag enlarged as much as possible
         $code = resourcelib_embed_general($url, $title, $clicktoopen, $mimetype);
         $PAGE->requires->yui2_lib('dom');
-        $PAGE->requires->js('mod/url/functions.js');
+        $PAGE->requires->js('/mod/url/functions.js');
         $PAGE->requires->js_function_call('imscp_setup_object')->on_dom_ready();
     }
 
index 6416a1c..ec4020d 100644 (file)
@@ -487,7 +487,7 @@ function lesson_clock_block_contents($cmid, $lesson, $timer, $page) {
 
     $clocksettings = array('starttime'=>$timer->starttime, 'servertime'=>time(),'testlength'=>($lesson->maxtime * 60));
     $content .= $page->requires->data_for_js('clocksettings', $clocksettings)->now();
-    $content .= $page->requires->js('mod/lesson/timer.js')->now();
+    $content .= $page->requires->js('/mod/lesson/timer.js')->now();
     $content .= $page->requires->js_function_call('show_clock')->now();
 
     $bc = new block_contents();
index c5bee92..2e8e408 100644 (file)
@@ -727,7 +727,7 @@ class securewindow_access_rule extends quiz_access_rule_base {
         echo "window.open('$attempturl', '$window', '$this->windowoptions');", '" />';
 
     /// JavaScript to reveal the button.
-        echo $PAGE->requires->js('mod/quiz/quiz.js')->asap();
+        echo $PAGE->requires->js('/mod/quiz/quiz.js')->asap();
         echo $PAGE->requires->js_function_call('reveal_start_button')->asap();
 
     /// A noscript tag to explains that this quiz only works with JavaScript enabled.
index e141e16..1c16f10 100644 (file)
@@ -85,8 +85,8 @@
     $attemptobj->load_question_states($questionids);
 
 /// Print the quiz page ////////////////////////////////////////////////////////
-    $PAGE->requires->js('lib/overlib/overlib.js')->in_head();
-    $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
+    $PAGE->requires->js('/lib/overlib/overlib.js')->in_head();
+    $PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->in_head();
 
     // Arrange for the navigation to be displayed.
     $navbc = $attemptobj->get_navigation_panel('quiz_attempt_nav_panel', $page);
index 5dbd383..c219b57 100644 (file)
@@ -724,7 +724,7 @@ class quiz_attempt extends quiz {
         // as seen as possible, particularly if the page is loading slowly.
         $PAGE->requires->yui2_lib('dom');
         $PAGE->requires->yui2_lib('event');
-        $PAGE->requires->js('mod/quiz/quiz.js')->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 c10df85..31753ed 100644 (file)
@@ -456,7 +456,7 @@ for ($pageiter = 1; $pageiter <= $numberoflisteners; $pageiter++) {
     $quizeditconfig->dialoglisteners[] = 'addrandomdialoglaunch_' . $pageiter;
 }
 $PAGE->requires->data_for_js('quiz_edit_config', $quizeditconfig);
-$PAGE->requires->js('mod/quiz/edit.js');
+$PAGE->requires->js('/mod/quiz/edit.js');
 
 // Print the tabs.
 $currenttab = 'edit';
index f246659..cb3af1c 100644 (file)
@@ -112,7 +112,7 @@ class mod_quiz_mod_form extends moodleform_mod {
             $pagegroup[] = &$mform->createElement('checkbox', 'repaginatenow', '', get_string('repaginatenow', 'quiz'), array('id' => 'id_repaginatenow'));
             $mform->disabledIf('repaginatenow', 'shufflequestions', 'eq', 1);
             $PAGE->requires->yui2_lib('event');
-            $PAGE->requires->js('mod/quiz/edit.js');
+            $PAGE->requires->js('/mod/quiz/edit.js');
         }
 
         $mform->addGroup($pagegroup, 'questionsperpagegrp', get_string('newpage', 'quiz'), null, false);
index 0aa4d51..7b4f11c 100644 (file)
@@ -56,8 +56,8 @@ class quiz_grading_report extends quiz_default_report {
 
         $this->cm = $cm;
 
-        echo $PAGE->requires->js('lib/overlib/overlib.js')->asap();
-        echo $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->asap();
+        echo $PAGE->requires->js('/lib/overlib/overlib.js')->asap();
+        echo $PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->asap();
 
         $this->print_header_and_tabs($cm, $course, $quiz, $reportmode="grading");
 
index bc66867..0ea3acc 100644 (file)
@@ -85,8 +85,8 @@
     $firstregion = reset($PAGE->blocks->get_regions());
     $PAGE->blocks->add_pretend_block($navbc, $firstregion);
 
-    $PAGE->requires->js('lib/overlib/overlib.js')->in_head();
-    $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
+    $PAGE->requires->js('/lib/overlib/overlib.js')->in_head();
+    $PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->in_head();
 
 /// Print the page header
     $headtags = $attemptobj->get_html_head_contributions($page);
index 2c8bc88..11b64ec 100644 (file)
@@ -67,8 +67,8 @@
             ($stateid ? '&state=' . $stateid : ''),
             $attemptobj->get_quizid(), $attemptobj->get_cmid());
 
-    $PAGE->requires->js('lib/overlib/overlib.js')->in_head();
-    $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
+    $PAGE->requires->js('/lib/overlib/overlib.js')->in_head();
+    $PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->in_head();
 
 /// Print the page header
     $attemptobj->get_question_html_head_contributions($questionid);
index 5d0652d..2a85f5e 100644 (file)
@@ -47,7 +47,7 @@ $attemptobj->load_questions();
 $attemptobj->load_question_states();
 
 /// Print the page header
-$PAGE->requires->js('mod/quiz/quiz.js');
+$PAGE->requires->js('/mod/quiz/quiz.js');
 $title = get_string('summaryofattempt', 'quiz');
 if ($accessmanager->securewindow_required($attemptobj->is_preview_user())) {
     $accessmanager->setup_secure_page($attemptobj->get_course()->shortname . ': ' .
index 90e8d48..975b267 100644 (file)
@@ -105,7 +105,7 @@ function resource_display_embed($resource, $cm, $course, $file) {
         // anything else - just try object tag enlarged as much as possible
         $code = resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype);
         $PAGE->requires->yui2_lib('dom');
-        $PAGE->requires->js('mod/url/functions.js')->in_head();
+        $PAGE->requires->js('/mod/url/functions.js')->in_head();
         $PAGE->requires->js_function_call('url_init_object');
     }
 
index 93ebdda..150430a 100644 (file)
@@ -541,8 +541,8 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
         $result->toc .= $PAGE->requires->data_for_js('scormdata', array(
                 'plusicon' => $OUTPUT->pix_url('pix/plus', 'scorm'),
                 'minusicon' => $OUTPUT->pix_url('pix/minus', 'scorm')))->asap();
-        $result->toc .= $PAGE->requires->js('lib/cookies.js')->asap();
-        $result->toc .= $PAGE->requires->js('mod/scorm/datamodels/scorm_datamodels.js')->asap();
+        $result->toc .= $PAGE->requires->js('/lib/cookies.js')->asap();
+        $result->toc .= $PAGE->requires->js('/mod/scorm/datamodels/scorm_datamodels.js')->asap();
     }
 
     $url = $CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&currentorg='.$currentorg.$modestr;
index 709bec5..e43e33e 100644 (file)
@@ -320,8 +320,8 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
         $PAGE->requires->data_for_js('scormdata', array(
                 'plusicon' => $OUTPUT->pix_url('pix/plus', 'scorm'),
                 'minusicon' => $OUTPUT->pix_url('pix/minus', 'scorm')));
-        $PAGE->requires->js('lib/cookies.js');
-        $PAGE->requires->js('mod/scorm/datamodels/scorm_datamodels.js');
+        $PAGE->requires->js('/lib/cookies.js');
+        $PAGE->requires->js('/mod/scorm/datamodels/scorm_datamodels.js');
     }
 
     $url = $CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&currentorg='.$currentorg.$modestr;
index 003182b..5af9f7e 100644 (file)
@@ -211,8 +211,8 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
         $PAGE->requires->data_for_js('scormdata', array(
                 'plusicon' => $OUTPUT->pix_url('pix/plus', 'scorm'),
                 'minusicon' => $OUTPUT->pix_url('pix/minus', 'scorm')));
-        $PAGE->requires->js('lib/cookies.js');
-        $PAGE->requires->js('mod/scorm/datamodels/scorm_datamodels.js');
+        $PAGE->requires->js('/lib/cookies.js');
+        $PAGE->requires->js('/mod/scorm/datamodels/scorm_datamodels.js');
     }
 
     $url = $CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&currentorg='.$currentorg.$modestr;
index 7766692..cd07dd6 100644 (file)
@@ -81,7 +81,7 @@
         print_error('cannotfindsco', 'scorm');
     }
     $scorm->version = strtolower(clean_param($scorm->version, PARAM_SAFEDIR));   // Just to be safe
-    $PAGE->requires->js('lib/cookies.js')->asap();
+    $PAGE->requires->js('/lib/cookies.js')->asap();
     if (file_exists($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php')) {
         include_once($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php');
     } else {
index 9c396cd..4f0c22d 100755 (executable)
     $PAGE->set_button($exitlink);
 
     echo $PAGE->requires->data_for_js('scormplayerdata', Array('cwidth'=>$scorm->width,'cheight'=>$scorm->height))->in_head();
-    echo $PAGE->requires->js('mod/scorm/request.js')->in_head();
-    echo $PAGE->requires->js('mod/scorm/loaddatamodel.php?id='.$cm->id.$scoidstr.$modestr.$attemptstr)->in_head();
-    echo $PAGE->requires->js('mod/scorm/rd.js')->in_head();
+    echo $PAGE->requires->js('/mod/scorm/request.js')->in_head();
+    echo $PAGE->requires->js('/mod/scorm/loaddatamodel.php?id='.$cm->id.$scoidstr.$modestr.$attemptstr)->in_head();
+    echo $PAGE->requires->js('/mod/scorm/rd.js')->in_head();
 
     echo $OUTPUT->header();
 
             $name = 'scorm_'.$name;
 
             echo $PAGE->requires->js_function_call('scorm_resize')->asap();
-            echo $PAGE->requires->js('mod/scorm/player.js')->asap();
+            echo $PAGE->requires->js('/mod/scorm/player.js')->asap();
             echo $PAGE->requires->js_function_call('scorm_openpopup', Array("loadSCO.php?id=".$cm->id.$scoidpop, p($name), p($scorm->options), p($scorm->width), p($scorm->height)))->asap();
             ?>
                     <noscript>
index 179696d..e70bb30 100644 (file)
            $checkarray['questions'][] = Array('question'=>$question, 'default'=>$default);
        }
     }
-    $PAGE->requires->js('mod/survey/survey.js');
+    $PAGE->requires->js('/mod/survey/survey.js');
     $PAGE->requires->data_for_js('surveycheck', $checkarray);
     $PAGE->requires->string_for_js('questionsnotanswered', 'survey');
     $PAGE->requires->js_function_call('survey_attach_onsubmit');
index a4a4267..276bace 100644 (file)
@@ -266,7 +266,7 @@ function url_display_embed($url, $cm, $course) {
         // anything else - just try object tag enlarged as much as possible
         $code = resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype);
         $PAGE->requires->yui2_lib('dom');
-        $PAGE->requires->js('mod/url/functions.js')->in_head();
+        $PAGE->requires->js('/mod/url/functions.js')->in_head();
         $PAGE->requires->js_function_call('url_init_object');
     }
 
index 9ffed88..af49fae 100644 (file)
@@ -1111,7 +1111,7 @@ class question_bank_view {
             return;
         }
 
-        $PAGE->requires->js('question/qbank.js');
+        $PAGE->requires->js('/question/qbank.js');
 
         // Category selection form
         echo $OUTPUT->heading(get_string('questionbank', 'question'), 2);
@@ -1857,7 +1857,7 @@ function require_login_in_context($contextorid = null){
  */
 function print_choose_qtype_to_add_form($hiddenparams) {
     global $CFG, $QTYPES, $PAGE, $OUTPUT;
-    $PAGE->requires->js('question/qbank.js');
+    $PAGE->requires->js('/question/qbank.js');
     echo '<div id="chooseqtypehead" class="hd">' . "\n";
     echo $OUTPUT->heading(get_string('chooseqtypetoadd', 'question'), 3);
     echo "</div>\n";
index 6eaed54..28e612a 100644 (file)
@@ -307,8 +307,8 @@ class embedded_cloze_qtype extends default_questiontype {
         // The regex will recognize text snippets of type {#X}
         // where the X can be any text not containg } or white-space characters.
 
-        echo $PAGE->requires->js('lib/overlib/overlib.js')->asap();
-        echo $PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->asap();
+        echo $PAGE->requires->js('/lib/overlib/overlib.js')->asap();
+        echo $PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->asap();
 
         while (preg_match('~\{#([^[:space:]}]*)}~', $qtextremaining, $regs)) {
             $qtextsplits = explode($regs[0], $qtextremaining, 2);
index c5e993d..82851ed 100644 (file)
@@ -866,10 +866,10 @@ class default_questiontype {
         $plugindirrel = 'question/type/' . $this->name();
 
         if (file_exists($plugindir . '/script.js')) {
-            $PAGE->requires->js($plugindirrel . '/script.js');
+            $PAGE->requires->js('/' . $plugindirrel . '/script.js');
         }
         if (file_exists($plugindir . '/script.php')) {
-            $PAGE->requires->js($plugindirrel . '/script.php');
+            $PAGE->requires->js('/' . $plugindirrel . '/script.php');
         }
     }
 
index a243e31..5887ff9 100644 (file)
@@ -243,7 +243,7 @@ function coursetag_print_cloud($tagcloud, $return=false, $max_size=180, $min_siz
 function coursetag_get_jscript($coursetagdivs = '') {
     global $CFG, $DB, $PAGE;
 
-    $PAGE->requires->js('tag/tag.js');
+    $PAGE->requires->js('/tag/tag.js');
     $PAGE->requires->strings_for_js(array('jserror1', 'jserror2'), 'block_tags');
 
     if ($coursetagdivs) {
@@ -256,7 +256,7 @@ function coursetag_get_jscript($coursetagdivs = '') {
         }
     }
 
-    $PAGE->requires->js('blocks/tags/coursetags.js');
+    $PAGE->requires->js('/blocks/tags/coursetags.js');
 
     return '';
 }
index 1c3cce7..00aa0aa 100644 (file)
@@ -137,7 +137,7 @@ if (!empty($errorstring)) {
 $tagform->display();
 
 if (ajaxenabled()) {
-    $PAGE->requires->js('tag/tag.js');
+    $PAGE->requires->js('/tag/tag.js');
     $PAGE->requires->js_function_call('init_tag_autocomplete')->on_dom_ready();
 }
 echo $OUTPUT->footer();
index 86b194c..fe5c5b6 100644 (file)
 
 
     if ($bulkoperations) {
-        $PAGE->requires->js('user/user.js');
+        $PAGE->requires->js('/user/user.js');
         echo '<form action="action_redir.php" method="post" id="participantsform" onsubmit="return checksubmit(this);">';
         echo '<div>';
         echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
index 0bbf0ed..8604319 100644 (file)
@@ -108,7 +108,7 @@ abstract class user_selector_base {
         $PAGE->requires->yui2_lib('json');
         $PAGE->requires->yui2_lib('connection');
         $PAGE->requires->yui2_lib('datasource');
-        $PAGE->requires->js('user/selector/script.js');
+        $PAGE->requires->js('/user/selector/script.js');
     }
 
     /**
index 6097e64..cf95e36 100644 (file)
@@ -14,7 +14,7 @@ $args['flashvars'] = 'amfurl='.$CFG->wwwroot.'/webservice/amf/server.php';
 $args['setcontainercss'] = 'true';
 
 
-$PAGE->requires->js('lib/ufo.js')->in_head();
+$PAGE->requires->js('/lib/ufo.js')->in_head();
 $PAGE->requires->data_for_js('FO', $args);
 $PAGE->requires->js_function_call('create_UFO_object', Array('moodletestclient'));