diff --git a/admin/report/capability/index.php b/admin/report/capability/index.php index 20ca20d1650..d15924e93a3 100644 --- a/admin/report/capability/index.php +++ b/admin/report/capability/index.php @@ -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. diff --git a/admin/report/spamcleaner/index.php b/admin/report/spamcleaner/index.php index 88278c21d0c..1f83b18fec1 100755 --- a/admin/report/spamcleaner/index.php +++ b/admin/report/spamcleaner/index.php @@ -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())); diff --git a/admin/roles/assign.php b/admin/roles/assign.php index 2c3a96db641..9d096cea991 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -257,7 +257,7 @@ /// 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)); diff --git a/admin/roles/lib.php b/admin/roles/lib.php index 33447441f38..d185c1c84b1 100644 --- a/admin/roles/lib.php +++ b/admin/roles/lib.php @@ -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'))); } diff --git a/admin/webservice/service_users.php b/admin/webservice/service_users.php index f6c754dc6cf..195c78c0035 100644 --- a/admin/webservice/service_users.php +++ b/admin/webservice/service_users.php @@ -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(); diff --git a/admin/xmldb/index.php b/admin/xmldb/index.php index b2d64806fd3..d455d674f0d 100644 --- a/admin/xmldb/index.php +++ b/admin/xmldb/index.php @@ -85,13 +85,13 @@ $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); } } } diff --git a/blocks/admin_tree/block_admin_tree.php b/blocks/admin_tree/block_admin_tree.php index 5351f210b49..8da9137df91 100644 --- a/blocks/admin_tree/block_admin_tree.php +++ b/blocks/admin_tree/block_admin_tree.php @@ -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'), diff --git a/blocks/calendar_month/block_calendar_month.php b/blocks/calendar_month/block_calendar_month.php index 01f8fed8f52..3297ac0f248 100644 --- a/blocks/calendar_month/block_calendar_month.php +++ b/blocks/calendar_month/block_calendar_month.php @@ -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)); diff --git a/blocks/global_navigation_tree/block_global_navigation_tree.php b/blocks/global_navigation_tree/block_global_navigation_tree.php index 9a7ff86f9aa..4ac631e7bbc 100644 --- a/blocks/global_navigation_tree/block_global_navigation_tree.php +++ b/blocks/global_navigation_tree/block_global_navigation_tree.php @@ -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 diff --git a/blocks/settings_navigation_tree/block_settings_navigation_tree.php b/blocks/settings_navigation_tree/block_settings_navigation_tree.php index ef51316a30d..ec741e59f54 100644 --- a/blocks/settings_navigation_tree/block_settings_navigation_tree.php +++ b/blocks/settings_navigation_tree/block_settings_navigation_tree.php @@ -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 diff --git a/calendar/event.php b/calendar/event.php index 4e777e44a55..a7ea27ede79 100644 --- a/calendar/event.php +++ b/calendar/event.php @@ -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); diff --git a/calendar/view.php b/calendar/view.php index f14f8972354..13542ba5f4a 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -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(); diff --git a/comment/index.php b/comment/index.php index a9d9ec05641..673c806415c 100644 --- a/comment/index.php +++ b/comment/index.php @@ -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); diff --git a/course/report/participation/index.php b/course/report/participation/index.php index ff965521d3d..31b42b1fd02 100644 --- a/course/report/participation/index.php +++ b/course/report/participation/index.php @@ -242,7 +242,7 @@ echo '