diff --git a/admin/dbperformance.php b/admin/dbperformance.php index fb32a6557d2..d48b29a56de 100644 --- a/admin/dbperformance.php +++ b/admin/dbperformance.php @@ -22,8 +22,8 @@ error('TODO: rewrite db perf code'); // TODO: rewrite $site = get_site(); if (!empty($topframe)) { - $PAGE->set_url(new moodle_url($CFG->wwwroot.'/admin/dbperformance.php')); - $PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/admin/index.php')); + $PAGE->set_url('/admin/dbperformance.php'); + $PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php')); $PAGE->navbar->add($strdatabaseperformance); $PAGE->set_title("$site->shortname: $strdatabaseperformance"); $PAGE->set_heading($site->fullname); diff --git a/admin/generator.php b/admin/generator.php index 931868b48eb..499afa3f222 100755 --- a/admin/generator.php +++ b/admin/generator.php @@ -1333,7 +1333,7 @@ if (CLI_SCRIPT) { $systemcontext = get_context_instance(CONTEXT_SYSTEM); require_capability('moodle/site:config', $systemcontext); - $PAGE->set_url($CFG->wwwroot.'/admin/generator.php'); + $PAGE->set_url('/admin/generator.php'); $PAGE->set_pagelayout('base'); $generator = new generator_web(); $generator->setup(); diff --git a/admin/index.php b/admin/index.php index 8d2e0d30ea9..f4728c7f98e 100644 --- a/admin/index.php +++ b/admin/index.php @@ -54,7 +54,7 @@ $agreelicense = optional_param('agreelicense', 0, PARAM_BOOL); // Check some PHP server settings -$PAGE->set_url($CFG->admin . '/index.php'); +$PAGE->set_url('/admin/index.php'); $documentationlink = 'Installation docs'; diff --git a/admin/mnet/access_control.php b/admin/mnet/access_control.php index 6008680d0dd..17a769f1da0 100644 --- a/admin/mnet/access_control.php +++ b/admin/mnet/access_control.php @@ -186,7 +186,7 @@ if (!$acl) { if (!empty($table)) { echo $OUTPUT->table($table); echo '

 

'; - $baseurl = new moodle_url(null, array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage)); + $baseurl = new moodle_url('/admin/mnet/access_control.php', array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage)); $pagingbar = moodle_paging_bar::make($aclcount, $page, $perpage, $baseurl); echo $OUTPUT->paging_bar($pagingbar); } diff --git a/admin/mnet/delete.php b/admin/mnet/delete.php index c9333873ff5..9704a7c5e39 100644 --- a/admin/mnet/delete.php +++ b/admin/mnet/delete.php @@ -38,9 +38,9 @@ if ($live_users > 0) { $warn[] = get_string('usersareonline', 'mnet', $live_users); } - $PAGE->set_url(new moodle_url($CFG->wwwroot.'/admin/mnet/delete.php')); - $PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php')); - $PAGE->navbar->add(get_string('mnetsettings', 'mnet'), new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/mnet/index.php')); + $PAGE->set_url('/admin/mnet/delete.php'); + $PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php')); + $PAGE->navbar->add(get_string('mnetsettings', 'mnet'), new moodle_url('/admin/mnet/index.php')); $PAGE->navbar->add(get_string('deletehost', 'mnet')); $PAGE->set_title("$site->shortname: $strmnetsettings"); diff --git a/admin/mnet/mnet_review.html b/admin/mnet/mnet_review.html index 0ca46e3c0a4..d4915d75266 100644 --- a/admin/mnet/mnet_review.html +++ b/admin/mnet/mnet_review.html @@ -3,7 +3,7 @@ admin_externalpage_print_header(); $currenttab = 'mnetdetails'; -require_once($CFG->dirroot .'/admin/mnet/tabs.php'); +require_once($CFG->dirroot .'/'.$CFG->admin.'/mnet/tabs.php'); echo $OUTPUT->box_start(); ?> diff --git a/admin/mnet/mnet_review_allhosts.html b/admin/mnet/mnet_review_allhosts.html index 74e5eb393c8..85fd7f08fd6 100644 --- a/admin/mnet/mnet_review_allhosts.html +++ b/admin/mnet/mnet_review_allhosts.html @@ -1,7 +1,7 @@ dirroot .'/admin/mnet/tabs.php'); +require_once($CFG->dirroot .'/'.$CFG->admin.'/mnet/tabs.php'); echo $OUTPUT->box_start(); ?> diff --git a/admin/mnet/mnet_services.html b/admin/mnet/mnet_services.html index b91ed36a716..7df1593baa7 100644 --- a/admin/mnet/mnet_services.html +++ b/admin/mnet/mnet_services.html @@ -2,7 +2,7 @@ admin_externalpage_print_header(); $currenttab = 'mnetservices'; -require_once($CFG->dirroot .'/admin/mnet/tabs.php'); +require_once($CFG->dirroot .'/'.$CFG->admin.'/mnet/tabs.php'); echo $OUTPUT->box_start(); ?> diff --git a/admin/mnet/mnet_themes.html b/admin/mnet/mnet_themes.html index d105458a2af..64ecee5b24e 100644 --- a/admin/mnet/mnet_themes.html +++ b/admin/mnet/mnet_themes.html @@ -6,7 +6,7 @@ admin_externalpage_print_header(); echo $OUTPUT->heading(get_string('themes')); $original_theme = fullclone($THEME); $currenttab = 'mnetthemes'; - require_once($CFG->dirroot .'/admin/mnet/tabs.php'); + require_once($CFG->dirroot .'/'.$CFG->admin.'/mnet/tabs.php'); $themes = get_list_of_plugins("theme"); $sesskey = sesskey(); diff --git a/admin/report/courseoverview/reportsgraph.php b/admin/report/courseoverview/reportsgraph.php index 7a148d7cd3e..471ffc0d9ab 100644 --- a/admin/report/courseoverview/reportsgraph.php +++ b/admin/report/courseoverview/reportsgraph.php @@ -30,7 +30,7 @@ $courses = $DB->get_records_sql($sql, $param->$params, 0, $numcourses); if (empty($courses)) { - $PAGE->set_url(new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/index.php')); + $PAGE->set_url('/admin/report/courseoverview/index.php'); print_error('statsnodata', 'error', $PAGE->url->out()); } diff --git a/admin/roles/assign.php b/admin/roles/assign.php index 33e65f7f85b..b3e11a9af62 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -54,7 +54,7 @@ if ($returnurl) { $urlparams['returnurl'] = $returnurl; } - $PAGE->set_url($CFG->admin . '/roles/assign.php', $urlparams); + $PAGE->set_url('/admin/roles/assign.php', $urlparams); $baseurl = $PAGE->url->out(); if (! $context = get_context_instance_by_id($contextid)) { @@ -266,7 +266,7 @@ $PAGE->set_title($title); if ($courseid != SITEID) { if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $courseid))) { - $PAGE->navbar->add(get_string('participants'), new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid))); + $PAGE->navbar->add(get_string('participants'), new moodle_url('/user/index.php', array('id'=>$courseid))); } $PAGE->set_heading($fullname); } else { diff --git a/admin/roles/check.php b/admin/roles/check.php index 34a0849e4ac..89ae5ae6c20 100755 --- a/admin/roles/check.php +++ b/admin/roles/check.php @@ -48,7 +48,7 @@ if ($returnurl) { $urlparams['returnurl'] = $returnurl; } - $PAGE->set_url($CFG->admin . '/roles/check.php', $urlparams); + $PAGE->set_url('/admin/roles/check.php', $urlparams); if (! $context = get_context_instance_by_id($contextid)) { print_error('wrongcontextid', 'error'); @@ -108,7 +108,7 @@ $PAGE->set_title($title); if ($courseid != SITEID) { if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $courseid))) { - $PAGE->navbar->add(get_string('participants'), new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid))); + $PAGE->navbar->add(get_string('participants'), new moodle_url('/user/index.php', array('id'=>$courseid))); } $PAGE->set_heading($fullname); } else { diff --git a/admin/roles/explain.php b/admin/roles/explain.php index edcf5c75b89..15642ba743d 100755 --- a/admin/roles/explain.php +++ b/admin/roles/explain.php @@ -37,7 +37,7 @@ $userid = required_param('user', PARAM_INTEGER); // We use 0 here to mean not-lo $contextid = required_param('contextid', PARAM_INTEGER); $capability = required_param('capability', PARAM_CAPABILITY); -$PAGE->set_url(new moodle_url($CFG->wwwroot.'/admin/roles/explain.php', array('user'=>$userid, 'contextid'=>$contextid, 'capability'=>$capability))); +$PAGE->set_url('/admin/roles/explain.php', array('user'=>$userid, 'contextid'=>$contextid, 'capability'=>$capability)); // Get the context and its parents. $context = get_context_instance_by_id($contextid); diff --git a/admin/roles/override.php b/admin/roles/override.php index 65612c238ad..90ed07b937f 100755 --- a/admin/roles/override.php +++ b/admin/roles/override.php @@ -50,7 +50,7 @@ if ($returnurl) { $urlparams['returnurl'] = $returnurl; } - $PAGE->set_url($CFG->admin . '/roles/override.php', $urlparams); + $PAGE->set_url('/admin/roles/override.php', $urlparams); $baseurl = $PAGE->url->out(); /// Validate the contextid parameter. @@ -151,7 +151,7 @@ $PAGE->set_title($title); if ($courseid != SITEID) { if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $course->id))) { - $PAGE->navbar->add(get_string('participants'), new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$course->id))); + $PAGE->navbar->add(get_string('participants'), new moodle_url('/user/index.php', array('id'=>$course->id))); } $PAGE->set_heading($fullname); } else { diff --git a/admin/roles/tabs.php b/admin/roles/tabs.php index d97d39a455e..3578b7b353a 100755 --- a/admin/roles/tabs.php +++ b/admin/roles/tabs.php @@ -52,7 +52,7 @@ if ($currenttab != 'update') { if (empty($title)) { $title = $SITE->fullname; } - $PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/admin/'), navigation_node::TYPE_SETTING); + $PAGE->navbar->add($stradministration, new moodle_url('/admin/'), navigation_node::TYPE_SETTING); $PAGE->navbar->add($straction); $PAGE->set_title($title); $PAGE->set_heading($SITE->fullname); @@ -73,8 +73,8 @@ if ($currenttab != 'update') { $title = "$SITE->shortname: $category->name"; } - $PAGE->navbar->add($strcategories, new moodle_url($CFG->wwwroot.'/course/index.php'), navigation_node::TYPE_SETTING); - $PAGE->navbar->add($category->name, new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$category->id)), navigation_node::TYPE_SETTING); + $PAGE->navbar->add($strcategories, new moodle_url('/course/index.php'), navigation_node::TYPE_SETTING); + $PAGE->navbar->add($category->name, new moodle_url('/course/category.php', array('id'=>$category->id)), navigation_node::TYPE_SETTING); $PAGE->navbar->add(get_string("roles")); $PAGE->set_title($title); $PAGE->set_heading("$SITE->fullname: $strcourses"); diff --git a/admin/roles/usersroles.php b/admin/roles/usersroles.php index 0fddff7a909..04c7d2280f3 100644 --- a/admin/roles/usersroles.php +++ b/admin/roles/usersroles.php @@ -126,7 +126,7 @@ $PAGE->set_title($title); if ($courseid != SITEID) { $PAGE->set_heading($fullname); if (has_capability('moodle/course:viewparticipants', $coursecontext)) { - $PAGE->navbar->add(get_string('participants'),new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid))); + $PAGE->navbar->add(get_string('participants'),new moodle_url('/user/index.php', array('id'=>$courseid))); } } else { $PAGE->set_heading($course->fullname); diff --git a/admin/settings.php b/admin/settings.php index c8a4bd6aea8..fa554812c4c 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -10,7 +10,7 @@ $adminediting = optional_param('adminedit', -1, PARAM_BOOL); /// no guest autologin require_login(0, false); $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM)); -$PAGE->set_url($CFG->admin . '/settings.php', array('section' => $section)); +$PAGE->set_url('/admin/settings.php', array('section' => $section)); $PAGE->set_pagetype('admin-setting-' . $section); $PAGE->set_pagelayout('admin'); $PAGE->navigation->clear_cache(); diff --git a/admin/timezone.php b/admin/timezone.php index 7068d57d3dd..bff4d6b049a 100644 --- a/admin/timezone.php +++ b/admin/timezone.php @@ -18,7 +18,7 @@ $strusers = get_string("users"); $strall = get_string("all"); - $PAGE->set_url(new moodle_url($CFG->wwwroot.'/admin/timezone.php')); + $PAGE->set_url('/admin/timezone.php'); $PAGE->set_title($strtimezone); $PAGE->set_heading($strtimezone); $PAGE->navbar->add($strtimezone); diff --git a/admin/webservice/protocols.php b/admin/webservice/protocols.php index 5f296b69e8e..3d5ece12119 100644 --- a/admin/webservice/protocols.php +++ b/admin/webservice/protocols.php @@ -27,7 +27,7 @@ require_once('../../config.php'); require_once($CFG->libdir.'/adminlib.php'); require_once($CFG->libdir.'/tablelib.php'); -$PAGE->set_url('/admin/webservice/protocols.php', array()); +$PAGE->set_url('/admin/webservice/protocols.php'); //TODO: disable the blocks here or better make the page layout default to no blocks! require_login(); diff --git a/admin/webservice/service.php b/admin/webservice/service.php index 8abde5c75f0..f0af3594341 100644 --- a/admin/webservice/service.php +++ b/admin/webservice/service.php @@ -31,7 +31,7 @@ $id = required_param('id', PARAM_INT); $action = optional_param('action', '', PARAM_ACTION); $confirm = optional_param('confirm', 0, PARAM_BOOL); -$PAGE->set_url('admin/external_service.php', array('id'=>$id)); +$PAGE->set_url('/admin/external_service.php', array('id'=>$id)); admin_externalpage_setup('externalservice'); @@ -57,7 +57,7 @@ if ($action == 'delete' and confirm_sesskey() and $service and empty($service->c $DB->delete_records('external_services_users', array('externalserviceid'=>$service->id)); $DB->delete_records('external_services_functions', array('externalserviceid'=>$service->id)); $DB->delete_records('external_services', array('id'=>$service->id)); - add_to_log(1, 'webservice', 'delete', $CFG->wwwroot."/admin/settings.php?section=externalservices", get_string('deleteservice', 'webservice', $service)); + add_to_log(1, 'webservice', 'delete', $CFG->wwwroot."/$CFG->admin/settings.php?section=externalservices", get_string('deleteservice', 'webservice', $service)); redirect($returnurl); } @@ -76,11 +76,11 @@ if ($mform->is_cancelled()) { if (empty($data->id)) { $data->timecreated = mktime(); $data->id = $DB->insert_record('external_services', $data); - add_to_log(1, 'webservice', 'add', $CFG->wwwroot."/admin/settings.php?section=externalservices", get_string('addservice', 'webservice', $data)); + add_to_log(1, 'webservice', 'add', $CFG->wwwroot."/$CFG->admin/settings.php?section=externalservices", get_string('addservice', 'webservice', $data)); } else { $data->timemodified = mktime(); $DB->update_record('external_services', $data); - add_to_log(1, 'webservice', 'edit', $CFG->wwwroot."/admin/settings.php?section=externalservices", get_string('editservice', 'webservice', $data)); + add_to_log(1, 'webservice', 'edit', $CFG->wwwroot."/$CFG->admin/settings.php?section=externalservices", get_string('editservice', 'webservice', $data)); } redirect($returnurl); diff --git a/admin/webservice/service_functions.php b/admin/webservice/service_functions.php index 9c20ee309d2..49e9a93bfc5 100644 --- a/admin/webservice/service_functions.php +++ b/admin/webservice/service_functions.php @@ -33,7 +33,7 @@ $fid = optional_param('fid', 0, PARAM_INT); $action = optional_param('action', '', PARAM_ACTION); $confirm = optional_param('confirm', 0, PARAM_BOOL); -$PAGE->set_url('admin/websevice/service_functions.php', array('id'=>$id)); +$PAGE->set_url('/admin/websevice/service_functions.php', array('id'=>$id)); admin_externalpage_setup('externalservicefunctions'); diff --git a/admin/webservice/service_users.php b/admin/webservice/service_users.php index 939c44c6294..f6c754dc6cf 100644 --- a/admin/webservice/service_users.php +++ b/admin/webservice/service_users.php @@ -29,7 +29,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->set_url('/admin/webservice/service_users.php', array('id'=>$id)); $PAGE->requires->js($CFG->admin.'/webservice/script.js'); admin_externalpage_setup('externalserviceusers'); diff --git a/admin/webservice/tokens.php b/admin/webservice/tokens.php index d0ceb0bc02f..144ec84e2d4 100644 --- a/admin/webservice/tokens.php +++ b/admin/webservice/tokens.php @@ -28,7 +28,7 @@ require_once('../../config.php'); require_once($CFG->libdir.'/adminlib.php'); require_once('forms.php'); -$PAGE->set_url('/admin/webservice/tokens.php', array()); +$PAGE->set_url('/admin/webservice/tokens.php'); admin_externalpage_setup('addwebservicetoken'); diff --git a/auth/ldap/ntlmsso_attempt.php b/auth/ldap/ntlmsso_attempt.php index eb268bb0f29..b31d196d323 100644 --- a/auth/ldap/ntlmsso_attempt.php +++ b/auth/ldap/ntlmsso_attempt.php @@ -5,7 +5,7 @@ require_once(dirname(dirname(dirname(__FILE__)))."/config.php"); //HTTPS is potentially required in this page httpsrequired(); -$PAGE->set_url(new moodle_url($CFG->wwwroot.'/auth/ldap/ntlmsso_attempt.php')); +$PAGE->set_url('/auth/ldap/ntlmsso_attempt.php'); /// Define variables used in page $site = get_site(); diff --git a/auth/ldap/ntlmsso_finish.php b/auth/ldap/ntlmsso_finish.php index 5e26b76c889..725b2f0eda7 100644 --- a/auth/ldap/ntlmsso_finish.php +++ b/auth/ldap/ntlmsso_finish.php @@ -5,7 +5,7 @@ require_once(dirname(dirname(dirname(__FILE__)))."/config.php"); //HTTPS is potentially required in this page httpsrequired(); -$PAGE->set_url(new moodle_url($CFG->wwwroot.'/auth/ldap/ntlmsso_finish.php')); +$PAGE->set_url('/auth/ldap/ntlmsso_finish.php'); /// Define variables used in page $site = get_site(); diff --git a/auth/mnet/jump.php b/auth/mnet/jump.php index f65a25c9385..b729a7b6a03 100644 --- a/auth/mnet/jump.php +++ b/auth/mnet/jump.php @@ -20,7 +20,7 @@ $hostid = optional_param('hostid', '0', PARAM_INT); $hostwwwroot = optional_param('hostwwwroot', '', PARAM_URL); $wantsurl = optional_param('wantsurl', '', PARAM_RAW); -$url = new moodle_url($CFG->wwwroot.'/auth/mnet/jump.php'); +$url = new moodle_url('/auth/mnet/jump.php'); if ($hostid !== '0') $url->param('hostid', $hostid); if ($hostwwwroot !== '') $url->param('hostwwwroot', $hostwwwroot); if ($wantsurl !== '') $url->param('wantsurl', $wantsurl); diff --git a/auth/mnet/land.php b/auth/mnet/land.php index e3ae0fe4c57..184d3fe9a79 100644 --- a/auth/mnet/land.php +++ b/auth/mnet/land.php @@ -21,7 +21,7 @@ $remotewwwroot = required_param('idp', PARAM_URL); $wantsurl = required_param('wantsurl', PARAM_LOCALURL); $wantsremoteurl = optional_param('remoteurl', false, PARAM_BOOL); -$url = new moodle_url($CFG->wwwroot.'/auth/mnet/jump.php', array('token'=>$token, 'idp'=>$remotewwwroot, 'wantsurl'=>$wantsurl)); +$url = new moodle_url('/auth/mnet/jump.php', array('token'=>$token, 'idp'=>$remotewwwroot, 'wantsurl'=>$wantsurl)); if ($wantsremoteurl !== false) $url->param('remoteurl', $wantsremoteurl); $PAGE->set_url($url); diff --git a/auth/shibboleth/index.php b/auth/shibboleth/index.php index b8925a18e4d..2babbfe20ca 100644 --- a/auth/shibboleth/index.php +++ b/auth/shibboleth/index.php @@ -4,7 +4,7 @@ require('../../config.php'); - $PAGE->set_url(new moodle_url($CFG->wwwroot.'/auth/shibboleth/index.php')); + $PAGE->set_url('/auth/shibboleth/index.php'); if (isloggedin() && $USER->username != 'guest') { // Nothing to do if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) { diff --git a/auth/shibboleth/login.php b/auth/shibboleth/login.php index b77f45b2150..d3b56aad06d 100644 --- a/auth/shibboleth/login.php +++ b/auth/shibboleth/login.php @@ -66,7 +66,7 @@ httpsrequired(); $loginsite = get_string("loginsite"); - $PAGE->set_url(new moodle_url($CFG->wwwroot.'/auth/shibboleth/login.php')); + $PAGE->set_url('/auth/shibboleth/login.php'); $PAGE->navbar->add($loginsite); $PAGE->set_title("$site->fullname: $loginsite"); $PAGE->set_heading($site->fullname); diff --git a/backup/backup.php b/backup/backup.php index 1ee0ed3b5f3..45862cc35dc 100644 --- a/backup/backup.php +++ b/backup/backup.php @@ -13,7 +13,7 @@ $cancel = optional_param('cancel', '', PARAM_RAW); $launch = optional_param('launch', '', PARAM_ACTION); - $url = new moodle_url(); + $url = new moodle_url('/backup/backup.php'); if ($id !== 0) { $url->param('id', $id); } @@ -75,7 +75,7 @@ $PAGE->set_title("$site->shortname: $strcoursebackup"); $PAGE->set_heading($site->fullname); if (!$id) { - $PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php')); + $PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php')); $PAGE->navbar->add($strcoursebackup); echo $OUTPUT->header(); if ($courses = get_courses('all','c.shortname','c.id,c.shortname,c.fullname')) { @@ -100,12 +100,12 @@ //Print header if (has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) { - $PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php')); - $PAGE->navbar->add($strcoursebackup, new moodle_url($CFG->wwwroot.'/backup/backup.php')); + $PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php')); + $PAGE->navbar->add($strcoursebackup, new moodle_url('/backup/backup.php')); $PAGE->navbar->add("$course->fullname ($course->shortname)"); echo $OUTPUT->header(); } else { - $PAGE->navbar->add($course->fullname, new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id))); + $PAGE->navbar->add($course->fullname, new moodle_url('/course/view.php', array('id'=>$course->id))); $PAGE->navbar->add($strcoursebackup); echo $OUTPUT->header(); } diff --git a/backup/restore.php b/backup/restore.php index bbc424f548b..7528d0fcf70 100644 --- a/backup/restore.php +++ b/backup/restore.php @@ -22,7 +22,7 @@ $method = optional_param('method', '', PARAM_ACTION); $backup_unique_code = optional_param('backup_unique_code',0,PARAM_INT); - $url = new moodle_url($CFG->wwwroot.'/backup/restore.php'); + $url = new moodle_url('/backup/restore.php'); if ($id !== 0) { $url->param('id', $id); } @@ -109,7 +109,7 @@ $PAGE->set_title("$site->shortname: $strcourserestore"); $PAGE->set_heading($site->fullname); if (!$file) { - $PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php')); + $PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php')); $PAGE->navbar->add($strcourserestore); echo $OUTPUT->header(); echo $OUTPUT->heading(get_string("nofilesselected")); @@ -120,7 +120,7 @@ //If cancel has been selected, inform and end if ($cancel) { - $PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php')); + $PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php')); $PAGE->navbar->add($strcourserestore); echo $OUTPUT->header(); echo $OUTPUT->heading(get_string("restorecancelled")); @@ -141,7 +141,7 @@ $PAGE->navbar->add(basename($file)); echo $OUTPUT->header(); } else { - $PAGE->navbar->add($course->shortname, new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id))); + $PAGE->navbar->add($course->shortname, new moodle_url('/course/view.php', array('id'=>$course->id))); $PAGE->navbar->add($strcourserestore); echo $OUTPUT->header(); } diff --git a/blocks/blog_menu/block_blog_menu.php b/blocks/blog_menu/block_blog_menu.php index a51ed350693..3937eb7354b 100755 --- a/blocks/blog_menu/block_blog_menu.php +++ b/blocks/blog_menu/block_blog_menu.php @@ -100,7 +100,7 @@ class block_blog_menu extends block_base { $output .= ''; // show View my entries link - $myentrieslink = html_link::make(new moodle_url($CFG->wwwroot .'/blog/index.php', array('userid' => $USER->id)), get_string('viewmyentries', 'blog')); + $myentrieslink = html_link::make(new moodle_url('/blog/index.php', array('userid' => $USER->id)), get_string('viewmyentries', 'blog')); $myentrieslink->url->params($blogheaders['url']->params()); $myentrieslink->url->param('userid', $USER->id); $pageuserid = $PAGE->url->param('userid'); @@ -113,7 +113,7 @@ class block_blog_menu extends block_base { // show "Add entry" or "Blog about this" link $sitecontext = get_context_instance(CONTEXT_SYSTEM); if (has_capability('moodle/blog:create', $sitecontext)) { - $addentrylink = html_link::make(new moodle_url($CFG->wwwroot .'/blog/edit.php', array('action' => 'add')), $blogheaders['stradd']); + $addentrylink = html_link::make(new moodle_url('/blog/edit.php', array('action' => 'add')), $blogheaders['stradd']); $addentrylink->url->params($blogheaders['url']->params()); $addentrylink->disableifcurrent = true; $menulist->add_item($OUTPUT->link($addentrylink)); diff --git a/blocks/blog_recent/block_blog_recent.php b/blocks/blog_recent/block_blog_recent.php index b1eb7394e29..61f3ac924e3 100644 --- a/blocks/blog_recent/block_blog_recent.php +++ b/blocks/blog_recent/block_blog_recent.php @@ -92,7 +92,7 @@ class block_blog_recent extends block_base { if (!empty($entries)) { $entrieslist = new html_list(); $entrieslist->add_class('list'); - $viewblogurl = new moodle_url($CFG->wwwroot . '/blog/index.php'); + $viewblogurl = new moodle_url('/blog/index.php'); foreach ($entries as $entryid => $entry) { $viewblogurl->param('entryid', $entryid); diff --git a/blocks/blog_tags/block_blog_tags.php b/blocks/blog_tags/block_blog_tags.php index 4627265b052..424db0dfca9 100644 --- a/blocks/blog_tags/block_blog_tags.php +++ b/blocks/blog_tags/block_blog_tags.php @@ -136,7 +136,7 @@ class block_blog_tags extends block_base { /// Accessibility: markup as a list. $this->content->text .= "\n