MDL-21233 moodle_url improvemewnts, code simplification, more diagnostics; fixed several regressions
This commit is contained in:
@@ -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);
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
+1
-1
@@ -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 = '<a href="http://docs.moodle.org/en/Installation">Installation docs</a>';
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ if (!$acl) {
|
||||
if (!empty($table)) {
|
||||
echo $OUTPUT->table($table);
|
||||
echo '<p> </p>';
|
||||
$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);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
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();
|
||||
?>
|
||||
|
||||
@@ -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();
|
||||
|
||||
?>
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
+5
-5
@@ -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();
|
||||
}
|
||||
|
||||
+4
-4
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -136,7 +136,7 @@ class block_blog_tags extends block_base {
|
||||
/// Accessibility: markup as a list.
|
||||
$this->content->text .= "\n<ul class='inline-list'>\n";
|
||||
foreach ($etags as $tag) {
|
||||
$blogurl = new moodle_url($CFG->wwwroot.'/blog/index.php');
|
||||
$blogurl = new moodle_url('/blog/index.php');
|
||||
|
||||
switch ($CFG->bloglevel) {
|
||||
case BLOG_USER_LEVEL:
|
||||
|
||||
@@ -195,7 +195,7 @@ class block_global_navigation_tree extends block_tree {
|
||||
* @return bool
|
||||
*/
|
||||
protected function showmyhistory() {
|
||||
global $USER, $PAGE, $ME;
|
||||
global $USER, $PAGE;
|
||||
|
||||
// Create a navigation cache so that we can store the history
|
||||
$cache = new navigation_cache('navigationhistory', 60*60);
|
||||
|
||||
@@ -172,9 +172,9 @@ if ($courseid) {
|
||||
if ($returnurl) {
|
||||
$urlparams['returnurl'] = $returnurl;
|
||||
}
|
||||
$managefeeds = new moodle_url($CFG->wwwroot . '/blocks/rss_client/managefeeds.php', $urlparams);
|
||||
$managefeeds = new moodle_url('/blocks/rss_client/managefeeds.php', $urlparams);
|
||||
|
||||
$PAGE->set_url('blocks/rss_client/editfeed.php', $urlparams);
|
||||
$PAGE->set_url('/blocks/rss_client/editfeed.php', $urlparams);
|
||||
$PAGE->set_pagelayout('base');
|
||||
|
||||
if ($rssid) {
|
||||
@@ -216,7 +216,7 @@ if ($mform->is_cancelled()) {
|
||||
$PAGE->set_title($strtitle);
|
||||
$PAGE->set_heading($strtitle);
|
||||
|
||||
$settingsurl = new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksettingrss_client');
|
||||
$settingsurl = new moodle_url('/admin/settings.php?section=blocksettingrss_client');
|
||||
$PAGE->navbar->add(get_string('blocks'));
|
||||
$PAGE->navbar->add(get_string('feedstitle', 'block_rss_client'), $settingsurl);
|
||||
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'));
|
||||
|
||||
@@ -59,7 +59,7 @@ if ($returnurl) {
|
||||
$urlparams['returnurl'] = $returnurl;
|
||||
$extraparams = '&returnurl=' . $returnurl;
|
||||
}
|
||||
$PAGE->set_url('blocks/rss_client/managefeeds.php', $urlparams);
|
||||
$PAGE->set_url('/blocks/rss_client/managefeeds.php', $urlparams);
|
||||
|
||||
// Process any actions
|
||||
if ($deleterssid && confirm_sesskey()) {
|
||||
@@ -82,8 +82,8 @@ $PAGE->set_pagelayout('base');
|
||||
$PAGE->set_title($strmanage);
|
||||
$PAGE->set_heading($strmanage);
|
||||
|
||||
$settingsurl = new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksettingrss_client');
|
||||
$managefeeds = new moodle_url($CFG->wwwroot . '/blocks/rss_client/managefeeds.php', $urlparams);
|
||||
$settingsurl = new moodle_url('/admin/settings.php?section=blocksettingrss_client');
|
||||
$managefeeds = new moodle_url('/blocks/rss_client/managefeeds.php', $urlparams);
|
||||
$PAGE->navbar->add(get_string('blocks'));
|
||||
$PAGE->navbar->add(get_string('feedstitle', 'block_rss_client'), $settingsurl);
|
||||
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'), $managefeeds);
|
||||
|
||||
@@ -54,7 +54,7 @@ if ($courseid) {
|
||||
if ($returnurl) {
|
||||
$urlparams['returnurl'] = $returnurl;
|
||||
}
|
||||
$PAGE->set_url('blocks/rss_client/viewfeed.php', $urlparams);
|
||||
$PAGE->set_url('/blocks/rss_client/viewfeed.php', $urlparams);
|
||||
$PAGE->set_pagelayout('popup');
|
||||
|
||||
$rssrecord = $DB->get_record('block_rss_client', array('id' => $rssid), '*', MUST_EXIST);
|
||||
@@ -71,8 +71,8 @@ $strviewfeed = get_string('viewfeed', 'block_rss_client');
|
||||
$PAGE->set_title($strviewfeed);
|
||||
$PAGE->set_heading($strviewfeed);
|
||||
|
||||
$settingsurl = new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksettingrss_client');
|
||||
$managefeeds = new moodle_url($CFG->wwwroot . '/blocks/rss_client/managefeeds.php', $urlparams);
|
||||
$settingsurl = new moodle_url('/admin/settings.php?section=blocksettingrss_client');
|
||||
$managefeeds = new moodle_url('/blocks/rss_client/managefeeds.php', $urlparams);
|
||||
$PAGE->navbar->add(get_string('blocks'));
|
||||
$PAGE->navbar->add(get_string('feedstitle', 'block_rss_client'), $settingsurl);
|
||||
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'));
|
||||
|
||||
+2
-2
@@ -34,14 +34,14 @@ $confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
$modid = optional_param('modid', 0, PARAM_INT); // To associate the entry with a module instance
|
||||
$courseid = optional_param('courseid', 0, PARAM_INT); // To associate the entry with a course
|
||||
|
||||
$PAGE->set_url('blog/edit.php', array('action' => $action, 'entryid' => $id, 'confirm' => $confirm, 'modid' => $modid, 'courseid' => $courseid));
|
||||
$PAGE->set_url('/blog/edit.php', array('action' => $action, 'entryid' => $id, 'confirm' => $confirm, 'modid' => $modid, 'courseid' => $courseid));
|
||||
|
||||
// If action is add, we ignore $id to avoid any further problems
|
||||
if (!empty($id) && $action == 'add') {
|
||||
$id = null;
|
||||
}
|
||||
|
||||
$returnurl = new moodle_url($CFG->wwwroot . '/blog/index.php');
|
||||
$returnurl = new moodle_url('/blog/index.php');
|
||||
|
||||
if (!empty($courseid) && empty($modid)) {
|
||||
$returnurl->param('courseid', $courseid);
|
||||
|
||||
@@ -39,7 +39,7 @@ require_capability('moodle/blog:manageexternal', get_context_instance(CONTEXT_SY
|
||||
$id = optional_param('id', null, PARAM_INT);
|
||||
$PAGE->set_url('/blog/external_blog_edit.php', array('id' => $id));
|
||||
|
||||
$returnurl = new moodle_url($CFG->wwwroot . '/blog/external_blogs.php');
|
||||
$returnurl = new moodle_url('/blog/external_blogs.php');
|
||||
|
||||
$action = (empty($id)) ? 'add' : 'edit';
|
||||
|
||||
@@ -112,8 +112,8 @@ if ($externalblogform->is_cancelled()){
|
||||
redirect($returnurl);
|
||||
}
|
||||
|
||||
$PAGE->navbar->add(fullname($USER), new moodle_url($CFG->wwwroot.'/user/view.php', array('id'=>$USER->id)));
|
||||
$PAGE->navbar->add($strblogs, new moodle_url($CFG->wwwroot.'/blog/index.php', array('userid'=>$USER->id)));
|
||||
$PAGE->navbar->add(fullname($USER), new moodle_url('/user/view.php', array('id'=>$USER->id)));
|
||||
$PAGE->navbar->add($strblogs, new moodle_url('/blog/index.php', array('userid'=>$USER->id)));
|
||||
$PAGE->navbar->add($strformheading);
|
||||
$PAGE->set_heading("$SITE->shortname: $strblogs: $strexternalblogs", $SITE->fullname);
|
||||
$PAGE->set_title("$SITE->shortname: $strblogs: $strexternalblogs");
|
||||
|
||||
@@ -50,8 +50,8 @@ if ($delete && confirm_sesskey()) {
|
||||
|
||||
$blogs = $DB->get_records('blog_external', array('userid' => $USER->id));
|
||||
|
||||
$PAGE->navbar->add(fullname($USER), new moodle_url($CFG->wwwroot.'/user/view.php', array('id'=>$USER->id)));
|
||||
$PAGE->navbar->add($strblogs, new moodle_url($CFG->wwwroot.'/blog/index.php', array('userid'=>$USER->id)));
|
||||
$PAGE->navbar->add(fullname($USER), new moodle_url('/user/view.php', array('id'=>$USER->id)));
|
||||
$PAGE->navbar->add($strblogs, new moodle_url('/blog/index.php', array('userid'=>$USER->id)));
|
||||
$PAGE->navbar->add($strexternalblogs);
|
||||
$PAGE->set_heading("$SITE->shortname: $strblogs: $strexternalblogs", $SITE->fullname);
|
||||
$PAGE->set_title("$SITE->shortname: $strblogs: $strexternalblogs");
|
||||
@@ -78,10 +78,10 @@ if (!empty($blogs)) {
|
||||
$validicon = $OUTPUT->image('i/tick_green_big', array('alt'=>get_string('feedisvalid', 'blog'), 'title'=>get_string('feedisvalid', 'blog')));
|
||||
}
|
||||
|
||||
$editurl = new moodle_url($CFG->wwwroot.'/blog/external_blog_edit.php', array('id' => $blog->id));
|
||||
$editurl = new moodle_url('/blog/external_blog_edit.php', array('id' => $blog->id));
|
||||
$editicon = $OUTPUT->action_icon($editurl, get_string('editexternalblog', 'blog'), 't/edit');
|
||||
|
||||
$deletelink = new html_link(new moodle_url($CFG->wwwroot.'/blog/external_blog_edit.php', array('id' => $blog->id, 'sesskey'=>sesskey())));
|
||||
$deletelink = new html_link(new moodle_url('/blog/external_blog_edit.php', array('id' => $blog->id, 'sesskey'=>sesskey())));
|
||||
$deletelink->add_confirm_action(get_string('externalblogdeleteconfirm', 'blog'));
|
||||
$deleteicon = $OUTPUT->action_icon($deletelink, get_string('deleteexternalblog', 'blog'), 't/delete');
|
||||
|
||||
@@ -90,7 +90,7 @@ if (!empty($blogs)) {
|
||||
echo $OUTPUT->table($table);
|
||||
}
|
||||
|
||||
$newexternalurl = new moodle_url($CFG->wwwroot.'/blog/external_blog_edit.php');
|
||||
$newexternalurl = new moodle_url('/blog/external_blog_edit.php');
|
||||
echo $OUTPUT->link(html_link::make($newexternalurl, $straddnewexternalblog));
|
||||
echo $OUTPUT->box_end();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ foreach ($url_params as $var => $val) {
|
||||
unset($url_params[$var]);
|
||||
}
|
||||
}
|
||||
$PAGE->set_url('blog/index.php', $url_params);
|
||||
$PAGE->set_url('/blog/index.php', $url_params);
|
||||
|
||||
//correct tagid if a text tag is provided as a param
|
||||
if (!empty($tag)) {
|
||||
|
||||
+2
-2
@@ -227,7 +227,7 @@ function blog_delete_external_entries($externalblog) {
|
||||
function blog_get_context_url($context=null) {
|
||||
global $CFG;
|
||||
|
||||
$viewblogentriesurl = new moodle_url($CFG->wwwroot . '/blog/index.php');
|
||||
$viewblogentriesurl = new moodle_url('/blog/index.php');
|
||||
|
||||
if (empty($context)) {
|
||||
global $PAGE;
|
||||
@@ -313,7 +313,7 @@ function blog_get_headers() {
|
||||
|
||||
$headers = array('title' => '', 'heading' => '', 'cm' => null, 'filters' => array());
|
||||
|
||||
$blogurl = new moodle_url($CFG->wwwroot . '/blog/index.php');
|
||||
$blogurl = new moodle_url('/blog/index.php');
|
||||
|
||||
// If the title is not yet set, it's likely that the context isn't set either, so skip this part
|
||||
$pagetitle = $PAGE->title;
|
||||
|
||||
+6
-6
@@ -149,7 +149,7 @@ class blog_entry {
|
||||
|
||||
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $COURSE->id)));
|
||||
$by = new object();
|
||||
$by->name = html_writer::link(new moodle_url($CFG->wwwroot.'/user/view.php', array('id' => $user->id, 'course' => $COURSE->id)), $fullname);
|
||||
$by->name = html_writer::link(new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $COURSE->id)), $fullname);
|
||||
$by->date = $template['created'];
|
||||
|
||||
$topiccell->text .= get_string('bynameondate', 'forum', $by);
|
||||
@@ -237,7 +237,7 @@ class blog_entry {
|
||||
foreach ($blogassociations as $assocrec) {
|
||||
$contextrec = $DB->get_record('context', array('id' => $assocrec->contextid));
|
||||
if ($contextrec->contextlevel == CONTEXT_COURSE) {
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/view.php', array('id' => $contextrec->instanceid));
|
||||
$url = new moodle_url('/course/view.php', array('id' => $contextrec->instanceid));
|
||||
$text = $DB->get_field('course', 'shortname', array('id' => $contextrec->instanceid)); //TODO: performance!!!!
|
||||
$assocstr .= $OUTPUT->action_icon($associconurl, $text, 'i/course');
|
||||
$hascourseassocs = true;
|
||||
@@ -258,7 +258,7 @@ class blog_entry {
|
||||
$modinfo = $DB->get_record('course_modules', array('id' => $contextrec->instanceid));
|
||||
$modname = $DB->get_field('modules', 'name', array('id' => $modinfo->module));
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/mod/'.$modname.'/view.php', array('id' => $modinfo->id));
|
||||
$url = new moodle_url('/mod/'.$modname.'/view.php', array('id' => $modinfo->id));
|
||||
$text = $DB->get_field($modname, 'name', array('id' => $modinfo->instance)); //TODO: performance!!!!
|
||||
$assocstr .= $OUTPUT->action_icon($associconurl, $text, $OUTPUT->pix_url('icon', $modname));
|
||||
$assocstr .= ', ';
|
||||
@@ -281,11 +281,11 @@ class blog_entry {
|
||||
$contentcell->text .= $OUTPUT->container_start('commands');
|
||||
|
||||
if (blog_user_can_edit_entry($this) && empty($this->uniquehash)) {
|
||||
$contentcell->text .= html_writer::link(new moodle_url($CFG->wwwroot.'/blog/edit.php', array('action' => 'edit', 'entryid' => $this->id)), $stredit) . ' | ';
|
||||
$contentcell->text .= html_writer::link(new moodle_url($CFG->wwwroot.'/blog/edit.php', array('action' => 'delete', 'entryid' => $this->id)), $strdelete) . ' | ';
|
||||
$contentcell->text .= html_writer::link(new moodle_url('/blog/edit.php', array('action' => 'edit', 'entryid' => $this->id)), $stredit) . ' | ';
|
||||
$contentcell->text .= html_writer::link(new moodle_url('/blog/edit.php', array('action' => 'delete', 'entryid' => $this->id)), $strdelete) . ' | ';
|
||||
}
|
||||
|
||||
$contentcell->text .= html_writer::link(new moodle_url($CFG->wwwroot.'/blog/index.php', array('entryid' => $this->id)), get_string('permalink', 'blog'));
|
||||
$contentcell->text .= html_writer::link(new moodle_url('/blog/index.php', array('entryid' => $this->id)), get_string('permalink', 'blog'));
|
||||
|
||||
$contentcell->text .= $OUTPUT->container_end();
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ $userid = optional_param('userid', null, PARAM_INT);
|
||||
$tagid = optional_param('tagid', null, PARAM_INT);
|
||||
$groupid = optional_param('groupid', null, PARAM_INT);
|
||||
|
||||
$PAGE->set_url('blog/preferences.php', array('courseid' => $courseid, 'modid' => $modid, 'userid' => $userid, 'tagid' => $tagid, 'groupid' => $groupid));
|
||||
$PAGE->set_url('/blog/preferences.php', array('courseid' => $courseid, 'modid' => $modid, 'userid' => $userid, 'tagid' => $tagid, 'groupid' => $groupid));
|
||||
|
||||
if ($courseid == SITEID) {
|
||||
require_login();
|
||||
@@ -76,7 +76,7 @@ $strblogs = get_string('blogs', 'blog');
|
||||
$title = "$site->shortname: $strblogs : $strpreferences";
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($title);
|
||||
$PAGE->navbar->add($strblogs, new moodle_url($CFG->wwwroot.'/blog/'));
|
||||
$PAGE->navbar->add($strblogs, new moodle_url('/blog/'));
|
||||
$PAGE->navbar->add($strpreferences);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
@@ -119,7 +119,7 @@ class bloglib_test extends UnitTestCaseUsingDatabase {
|
||||
*/
|
||||
public function test_blog_get_headers_case_1() {
|
||||
global $CFG, $PAGE, $OUTPUT;
|
||||
$PAGE->url = new moodle_url($CFG->wwwroot . '/blog/index.php', array('entryid' => 1));
|
||||
$PAGE->url = new moodle_url('/blog/index.php', array('entryid' => 1));
|
||||
$blog_headers = blog_get_headers();
|
||||
|
||||
$this->assertEqual($blog_headers['title'], '');
|
||||
|
||||
+2
-2
@@ -34,10 +34,10 @@ $confirm = optional_param('confirm', false, PARAM_BOOL);
|
||||
$repeats = optional_param('repeats', false, PARAM_BOOL);
|
||||
$courseid = optional_param('course', 0, PARAM_INT);
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/calendar/delete.php', array('id'=>$eventid)));
|
||||
$PAGE->set_url('/calendar/delete.php', array('id'=>$eventid));
|
||||
|
||||
if(!$site = get_site()) {
|
||||
redirect(new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
|
||||
redirect(new moodle_url('/admin/index.php'));
|
||||
}
|
||||
|
||||
$event = calendar_event::load($eventid);
|
||||
|
||||
+2
-2
@@ -64,7 +64,7 @@ if ($courseid === 0) {
|
||||
$courseid = optional_param('course', 0, PARAM_INT);
|
||||
}
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/calendar/event.php', array('action'=>$action));
|
||||
$url = new moodle_url('/calendar/event.php', array('action'=>$action));
|
||||
if ($eventid !== 0) $url->param('id', $eventid);
|
||||
if ($courseid !== 0) $url->param('course', $courseid);
|
||||
if ($cal_y !== 0) $url->param('cal_y', $cal_y);
|
||||
@@ -73,7 +73,7 @@ if ($cal_d !== 0) $url->param('cal_d', $cal_d);
|
||||
$PAGE->set_url($url);
|
||||
|
||||
if ($action === 'delete' && $eventid>0) {
|
||||
$deleteurl = new moodle_url($CFG->wwwroot.'/calendar/delete.php', array('id'=>$eventid));
|
||||
$deleteurl = new moodle_url('/calendar/delete.php', array('id'=>$eventid));
|
||||
if ($courseid > 0) {
|
||||
$deleteurl->param('course', $courseid);
|
||||
}
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ if ($courseid = optional_param('course', 0, PARAM_INT)) {
|
||||
$course = NULL;
|
||||
}
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/calendar/export.php');
|
||||
$url = new moodle_url('/calendar/export.php');
|
||||
if ($action !== '') {
|
||||
$url->param('action', $action);
|
||||
}
|
||||
@@ -95,7 +95,7 @@ $navlinks = array();
|
||||
$now = usergetdate(time());
|
||||
|
||||
if (!empty($courseid) && $course->id != SITEID) {
|
||||
$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)));
|
||||
}
|
||||
|
||||
if(!checkdate($mon, $day, $yr)) {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
require('../config.php');
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/calendar/view.php'));
|
||||
$PAGE->set_url('/calendar/view.php');
|
||||
redirect($CFG->wwwroot.'/calendar/view.php');
|
||||
@@ -11,7 +11,7 @@ if (isset($SESSION->cal_course_referer)) {
|
||||
}
|
||||
}
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/calendar/preferences.php'));
|
||||
$PAGE->set_url('/calendar/preferences.php');
|
||||
|
||||
if ($course->id != SITEID) {
|
||||
require_login($course->id);
|
||||
@@ -62,9 +62,9 @@ $strcalendar = get_string('calendar', 'calendar');
|
||||
$strpreferences = get_string('preferences', 'calendar');
|
||||
|
||||
if ($course->id != SITEID) {
|
||||
$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($strpreferences, new moodle_url($CFG->wwwroot.'/calendar/view.php'));
|
||||
$PAGE->navbar->add($strpreferences, new moodle_url('/calendar/view.php'));
|
||||
|
||||
$PAGE->set_title("$site->shortname: $strcalendar: $strpreferences");
|
||||
$PAGE->set_heading($strcalendar);
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ $cal_y = optional_param('cal_y', 0, PARAM_INT);
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$type = optional_param('type', '', PARAM_ALPHA);
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/calendar/set.php', array('from'=>$from,'var'=>$var));
|
||||
$url = new moodle_url('/calendar/set.php', array('from'=>$from,'var'=>$var));
|
||||
if ($id !== 0) {
|
||||
$url->param('id', $id);
|
||||
}
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ $yr = optional_param('cal_y', 0, PARAM_INT);
|
||||
|
||||
$site = get_site();
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/calendar/view.php');
|
||||
$url = new moodle_url('/calendar/view.php');
|
||||
if ($courseid !== 0) {
|
||||
$url->param('course', $courseid);
|
||||
}
|
||||
|
||||
+3
-3
@@ -31,7 +31,7 @@
|
||||
if ($perpage) {
|
||||
$urlparams['perpage'] = $perpage;
|
||||
}
|
||||
$PAGE->set_url('course/category.php', $urlparams);
|
||||
$PAGE->set_url('/course/category.php', $urlparams);
|
||||
$context = $PAGE->context;
|
||||
$category = $PAGE->category;
|
||||
|
||||
@@ -207,11 +207,11 @@
|
||||
|
||||
// Print button to update this category
|
||||
$options = array('id' => $category->id);
|
||||
echo $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/course/editcategory.php', $options), get_string('editcategorythis'), 'get');
|
||||
echo $OUTPUT->single_button(new moodle_url('/course/editcategory.php', $options), get_string('editcategorythis'), 'get');
|
||||
|
||||
// Print button for creating new categories
|
||||
$options = array('parent' => $category->id);
|
||||
echo $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/course/editcategory.php', $options), get_string('addsubcategory'), 'get');
|
||||
echo $OUTPUT->single_button(new moodle_url('/course/editcategory.php', $options), get_string('addsubcategory'), 'get');
|
||||
|
||||
echo $OUTPUT->container_end();
|
||||
}
|
||||
|
||||
+4
-4
@@ -7,7 +7,7 @@
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
$delete = optional_param('delete', '', PARAM_ALPHANUM); // delete confirmation hash
|
||||
|
||||
$PAGE->set_url('course/delete.php', array('id' => $id));
|
||||
$PAGE->set_url('/course/delete.php', array('id' => $id));
|
||||
require_login();
|
||||
|
||||
if (!can_delete_course($id)) {
|
||||
@@ -26,9 +26,9 @@
|
||||
|
||||
$category = $DB->get_record("course_categories", array("id"=>$course->category));
|
||||
|
||||
$PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php/'));
|
||||
$PAGE->navbar->add($strcategories, new moodle_url($CFG->wwwroot.'/course/index.php'));
|
||||
$PAGE->navbar->add($category->name, new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$course->category)));
|
||||
$PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php/'));
|
||||
$PAGE->navbar->add($strcategories, new moodle_url('/course/index.php'));
|
||||
$PAGE->navbar->add($category->name, new moodle_url('/course/category.php', array('id'=>$course->category)));
|
||||
if (! $delete) {
|
||||
$strdeletecheck = get_string("deletecheck", "", $course->shortname);
|
||||
$strdeletecoursecheck = get_string("deletecoursecheck");
|
||||
|
||||
+3
-3
@@ -38,7 +38,7 @@
|
||||
print_error('needcoursecategroyid');
|
||||
}
|
||||
|
||||
$PAGE->set_url($CFG->wwwroot.'/course/edit.php');
|
||||
$PAGE->set_url('/course/edit.php');
|
||||
if ($id !== 0) {
|
||||
$PAGE->url->param('id',$id);
|
||||
} else {
|
||||
@@ -146,8 +146,8 @@
|
||||
$title = $streditcoursesettings;
|
||||
$fullname = $course->fullname;
|
||||
} else {
|
||||
$PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
|
||||
$PAGE->navbar->add($strcategories, new moodle_url($CFG->wwwroot.'/course/index.php'));
|
||||
$PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php'));
|
||||
$PAGE->navbar->add($strcategories, new moodle_url('/course/index.php'));
|
||||
$PAGE->navbar->add($straddnewcourse);
|
||||
$title = "$site->shortname: $straddnewcourse";
|
||||
$fullname = $site->fullname;
|
||||
|
||||
@@ -17,14 +17,14 @@ if ($id) {
|
||||
if (!$category = $DB->get_record('course_categories', array('id' => $id))) {
|
||||
print_error('unknowcategory');
|
||||
}
|
||||
$PAGE->set_url('course/editcategory.php', array('id' => $id));
|
||||
$PAGE->set_url('/course/editcategory.php', array('id' => $id));
|
||||
$categorycontext = get_context_instance(CONTEXT_COURSECAT, $id);
|
||||
require_capability('moodle/category:manage', $categorycontext);
|
||||
$strtitle = get_string('editcategorysettings');
|
||||
$editorcontext = $categorycontext;
|
||||
} else {
|
||||
$parent = required_param('parent', PARAM_INT);
|
||||
$PAGE->set_url('course/editcategory.php', array('parent' => $parent));
|
||||
$PAGE->set_url('/course/editcategory.php', array('parent' => $parent));
|
||||
if ($parent) {
|
||||
if (!$DB->record_exists('course_categories', array('id' => $parent))) {
|
||||
print_error('unknowcategory');
|
||||
@@ -100,8 +100,8 @@ if ($id) {
|
||||
$title = $strtitle;
|
||||
$fullname = $category->name;
|
||||
} else {
|
||||
$PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
|
||||
$PAGE->navbar->add($strcategories, new moodle_url($CFG->wwwroot.'/course/index.php'));
|
||||
$PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php'));
|
||||
$PAGE->navbar->add($strcategories, new moodle_url('/course/index.php'));
|
||||
$PAGE->navbar->add($straddnewcategory);
|
||||
$title = "$SITE->shortname: $straddnewcategory";
|
||||
$fullname = $SITE->fullname;
|
||||
|
||||
@@ -30,7 +30,7 @@ require_once('editsection_form.php');
|
||||
|
||||
$id = required_param('id',PARAM_INT); // Week/topic ID
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/editsection.php', array('id'=>$id)));
|
||||
$PAGE->set_url('/course/editsection.php', array('id'=>$id));
|
||||
|
||||
if (! $section = $DB->get_record("course_sections", array("id"=>$id))) {
|
||||
print_error("sectionnotexist");
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ require_once("$CFG->dirroot/enrol/enrol.class.php");
|
||||
$id = required_param('id', PARAM_INT);
|
||||
$loginasguest = optional_param('loginasguest', 0, PARAM_BOOL); // hmm, is this still needed?
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/enrol.php', array('id'=>$id));
|
||||
$url = new moodle_url('/course/enrol.php', array('id'=>$id));
|
||||
if ($loginasguest !== 0) {
|
||||
$url->param('loginasguest', $loginasguest);
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ require_once('../config.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT); // course id to import TO
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/import.php', array('id'=>$id)));
|
||||
$PAGE->set_url('/course/import.php', array('id'=>$id));
|
||||
|
||||
if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
||||
print_error("That's an invalid course id");
|
||||
|
||||
@@ -35,7 +35,7 @@ $fromcoursesearch = optional_param('fromcoursesearch', '', PARAM_RAW);
|
||||
$page = optional_param('page', 0, PARAM_INT);
|
||||
$filename = optional_param('filename', 0, PARAM_PATH);
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/import/activities/index.php', array('id'=>$id));
|
||||
$url = new moodle_url('/course/import/activities/index.php', array('id'=>$id));
|
||||
if ($fromcourse !== 0) {
|
||||
$url->param('fromcourse', $fromcourse);
|
||||
}
|
||||
@@ -92,8 +92,8 @@ if ($from = $DB->get_record('course', array('id'=>$fromcourse))) {
|
||||
}
|
||||
}
|
||||
|
||||
$PAGE->navbar->add($course->shortname, new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add(get_string('import'), new moodle_url($CFG->wwwroot.'/course/import.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($course->shortname, new moodle_url('/course/view.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add(get_string('import'), new moodle_url('/course/import.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strimportactivities);
|
||||
|
||||
$PAGE->set_title("$course->shortname: $strimportactivities");
|
||||
|
||||
@@ -29,7 +29,7 @@ require_once($CFG->dirroot.'/group/lib.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT); // Course id
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/import/groups/index.php', array('id'=>$id)));
|
||||
$PAGE->set_url('/course/import/groups/index.php', array('id'=>$id));
|
||||
|
||||
if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
||||
print_error('invalidcourseid');
|
||||
@@ -63,8 +63,8 @@ if (isset($CFG->CSV_DELIMITER)) {
|
||||
}
|
||||
|
||||
/// Print the header
|
||||
$PAGE->navbar->add($course->shortname, new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add(get_string('import'), new moodle_url($CFG->wwwroot.'/course/import.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($course->shortname, new moodle_url('/course/view.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add(get_string('import'), new moodle_url('/course/import.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strimportgroups);
|
||||
|
||||
$PAGE->set_title("$course->shortname: $strimportgroups");
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
$previoussearch = optional_param('previoussearch', 0, PARAM_BOOL);
|
||||
$previoussearch = ($searchtext != '') or ($previoussearch) ? 1:0;
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/importstudents.php', array('id'=>$id));
|
||||
$url = new moodle_url('/course/importstudents.php', array('id'=>$id));
|
||||
if ($add !== 0) {
|
||||
$url->param('add', $add);
|
||||
}
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ $site = get_site();
|
||||
|
||||
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/index.php'));
|
||||
$PAGE->set_url('/course/index.php');
|
||||
$PAGE->set_context($systemcontext);
|
||||
|
||||
if (can_edit_in_category()) {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
print_error('coursehidden', '', $CFG->wwwroot .'/');
|
||||
}
|
||||
|
||||
$PAGE->set_url('course/info.php', array('id' => $course->id));
|
||||
$PAGE->set_url('/course/info.php', array('id' => $course->id));
|
||||
$PAGE->set_title(get_string("summaryof", "", $course->fullname));
|
||||
$PAGE->set_heading('Course info');
|
||||
$PAGE->set_course($course);
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ require('../config.php');
|
||||
|
||||
$jump = optional_param('jump', '', PARAM_RAW);
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/jumpto.php'));
|
||||
$PAGE->set_url('/course/jumpto.php');
|
||||
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad');
|
||||
|
||||
+2
-2
@@ -2099,7 +2099,7 @@ function update_category_button($categoryid = 0) {
|
||||
} else {
|
||||
$page = 'index.php';
|
||||
}
|
||||
return $OUTPUT->single_button(new moodle_url($CFG->wwwroot . '/course/' . $page, $options), $label, 'get');
|
||||
return $OUTPUT->single_button(new moodle_url('/course/' . $page, $options), $label, 'get');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2145,7 +2145,7 @@ function print_courses($category) {
|
||||
$options = array();
|
||||
$options['category'] = $category->id;
|
||||
echo '<div class="addcoursebutton">';
|
||||
echo $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/course/edit.php', $options), get_string("addnewcourse"));
|
||||
echo $OUTPUT->single_button(new moodle_url('/course/edit.php', $options), get_string("addnewcourse"));
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
$id = optional_param('id', SITEID, PARAM_INT); // course id
|
||||
$userid = required_param('user', PARAM_INT); // login as this user
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/loginas.php', array('user'=>$userid, 'sesskey'=>sesskey()));
|
||||
$url = new moodle_url('/course/loginas.php', array('user'=>$userid, 'sesskey'=>sesskey()));
|
||||
if ($id !== SITEID) {
|
||||
$url->param('id', $id);
|
||||
}
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ $cancelcopy = optional_param('cancelcopy', 0, PARAM_BOOL);
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
// This page should always redirect
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/mod.php');
|
||||
$url = new moodle_url('/course/mod.php');
|
||||
foreach (compact('indent','update','hide','show','copy','moveto','movetosection','delete','course','cancelcopy','confirm') as $key=>$value) {
|
||||
if ($value !== 0) {
|
||||
$url->param($key, $value);
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@
|
||||
|
||||
$PAGE->set_pagelayout('base');
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/modedit.php');
|
||||
$url = new moodle_url('/course/modedit.php');
|
||||
if (!empty($add)) {
|
||||
$url->param('add', $add);
|
||||
} else if (!empty($update)) {
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ require_once('recent_form.php');
|
||||
|
||||
$id = required_param('id', PARAM_INT);
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/recent.php', array('id'=>$id)));
|
||||
$PAGE->set_url('/course/recent.php', array('id'=>$id));
|
||||
|
||||
if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
||||
print_error("That's an invalid course id");
|
||||
@@ -73,7 +73,7 @@ if (!empty($param->user)) {
|
||||
}
|
||||
|
||||
$strrecentactivity = get_string('recentactivity');
|
||||
$PAGE->navbar->add($strrecentactivity, new moodle_url($CFG->wwwroot.'/course/recent.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strrecentactivity, new moodle_url('/course/recent.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($userinfo);
|
||||
$PAGE->set_title("$course->shortname: $strrecentactivity");
|
||||
$PAGE->set_heading($course->fullname);
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
$strreports = get_string('reports');
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$id)));
|
||||
$PAGE->set_url('/course/report.php', array('id'=>$id));
|
||||
$PAGE->set_title($course->fullname.': '.$strreports);
|
||||
$PAGE->set_heading($course->fullname.': '.$strreports);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
@@ -32,7 +32,7 @@ $type = required_param('type', PARAM_FILE); // Graph Type
|
||||
$user = optional_param('user', 0, PARAM_INT); // Student ID
|
||||
$date = optional_param('date', 0, PARAM_INT); // A time of a day (in GMT)
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/report/log/graph.php', array('id'=>$id,'type'=>$type));
|
||||
$url = new moodle_url('/course/report/log/graph.php', array('id'=>$id,'type'=>$type));
|
||||
if ($user !== 0) {
|
||||
$url->param('user', $user);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
if ($showusers !== 0) $params['showusers'] = $showusers;
|
||||
if ($chooselog !== 0) $params['chooselog'] = $chooselog;
|
||||
if ($logformat !== 'showashtml') $params['logformat'] = $logformat;
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/report/log/index.php', $params));
|
||||
$PAGE->set_url('/course/report/log/index.php', $params);
|
||||
|
||||
if ($hostid == $CFG->mnet_localhost_id) {
|
||||
if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
||||
@@ -98,8 +98,8 @@
|
||||
} else {
|
||||
$PAGE->set_title($course->shortname .': '. $strlogs);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->navbar->add($strreports, new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strlogs, new moodle_url($CFG->wwwroot.'/course/index.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strreports, new moodle_url('/course/report.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strlogs, new moodle_url('/course/index.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add("$userinfo, $dateinfo");
|
||||
echo $OUTPUT->header();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
} else {
|
||||
$PAGE->set_title($course->shortname .': '. $strlogs);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->navbar->add($strreports, new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)), navigation_node::TYPE_CUSTOM);
|
||||
$PAGE->navbar->add($strreports, new moodle_url('/course/report.php', array('id'=>$course->id)), navigation_node::TYPE_CUSTOM);
|
||||
$PAGE->navbar->add($strlogs);
|
||||
echo $OUTPUT->header();
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate='today'
|
||||
function log_report_extend_navigation($navigation, $course, $context) {
|
||||
global $CFG, $OUTPUT;
|
||||
if (has_capability('coursereport/log:view', $context)) {
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/report/log/index.php', array('id'=>$course->id));
|
||||
$url = new moodle_url('/course/report/log/index.php', array('id'=>$course->id));
|
||||
$navigation->add(get_string('log:view', 'coursereport_log'), $url, navigation_node::TYPE_SETTING, null, null, $OUTPUT->pix_url('i/report'));
|
||||
}
|
||||
if (has_capability('coursereport/log:viewlive', $context)) {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
$strlivelogs = get_string("livelogs");
|
||||
$strupdatesevery = get_string("updatesevery", "moodle", COURSE_LIVELOG_REFRESH);
|
||||
|
||||
$PAGE->set_url('/course/report/log/live.php', Array('id'=>$course->id));
|
||||
$PAGE->set_url('/course/report/log/live.php', array('id'=>$course->id));
|
||||
$PAGE->set_pagelayout('popup');
|
||||
$PAGE->set_title("$strlivelogs ($strupdatesevery)");
|
||||
$PAGE->set_periodic_refresh_delay(COURSE_LIVELOG_REFRESH);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/report/outline/index.php', array('id'=>$id)));
|
||||
$PAGE->set_url('/course/report/outline/index.php', array('id'=>$id));
|
||||
|
||||
require_login($course);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
$PAGE->set_title($course->shortname .': '. $stractivityreport);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->navbar->add($strreports, new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strreports, new moodle_url('/course/report.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($stractivityreport);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(format_string($course->fullname));
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
function outline_report_extend_navigation($navigation, $course, $context) {
|
||||
global $CFG, $OUTPUT;
|
||||
if (has_capability('coursereport/outline:view', $context)) {
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/report/outline/index.php', array('id'=>$course->id));
|
||||
$url = new moodle_url('/course/report/outline/index.php', array('id'=>$course->id));
|
||||
$navigation->add(get_string( 'activityreport' ), $url, navigation_node::TYPE_SETTING, null, null, $OUTPUT->pix_url('i/report'));
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
$page = optional_param('page', 0, PARAM_INT); // which page to show
|
||||
$perpage = optional_param('perpage', DEFAULT_PAGE_SIZE, PARAM_INT); // how many per page
|
||||
|
||||
$PAGE->set_url('course/report/participation/index.php', compact('id', 'roleid', 'instanceid', 'timefrom', 'page', 'perpage'));
|
||||
$PAGE->set_url('/course/report/participation/index.php', compact('id', 'roleid', 'instanceid', 'timefrom', 'page', 'perpage'));
|
||||
|
||||
if ($action != 'view' and $action != 'post') {
|
||||
$action = ''; // default to all (don't restrict)
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
$PAGE->set_title($course->shortname .': '. $strparticipation);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->navbar->add($strreports, new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strreports, new moodle_url('/course/report.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strparticipation);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
function participation_report_extend_navigation($navigation, $course, $context) {
|
||||
global $CFG, $OUTPUT;
|
||||
if (has_capability('coursereport/participation:view', $context)) {
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/report/participation/index.php', array('id'=>$course->id));
|
||||
$url = new moodle_url('/course/report/participation/index.php', array('id'=>$course->id));
|
||||
$navigation->add(get_string('participationreport'), $url, navigation_node::TYPE_SETTING, null, null, $OUTPUT->pix_url('i/report'));
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ function csv_quote($value) {
|
||||
}
|
||||
}
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/report/progress/index.php', array('course'=>$id));
|
||||
$url = new moodle_url('/course/report/progress/index.php', array('course'=>$id));
|
||||
if ($sort !== '') {
|
||||
$url->param('sort', $sort);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ if($csv) {
|
||||
|
||||
$PAGE->set_title($strcompletion);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->navbar->add($strreports, new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strreports, new moodle_url('/course/report.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strcompletion);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
function progress_report_extend_navigation($navigation, $course, $context) {
|
||||
global $CFG, $OUTPUT;
|
||||
if (has_capability('coursereport/progress:view', $context)) {
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/report/progress/index.php', array('course'=>$course->id));
|
||||
$url = new moodle_url('/course/report/progress/index.php', array('course'=>$course->id));
|
||||
$navigation->add(get_string('completionreport','completion'), $url, navigation_node::TYPE_SETTING, null, null, $OUTPUT->pix_url('i/report'));
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ $mode = required_param('mode', PARAM_INT);
|
||||
$userid = optional_param('userid', 0, PARAM_INT);
|
||||
$roleid = optional_param('roleid',0,PARAM_INT);
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/report/stats/graph.php', array('course'=>$courseid, 'report'=>$report, 'time'=>$time, 'mode'=>$mode));
|
||||
$url = new moodle_url('/course/report/stats/graph.php', array('course'=>$courseid, 'report'=>$report, 'time'=>$time, 'mode'=>$mode));
|
||||
if ($userid !== 0) {
|
||||
$url->param('userid', $userid);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
$PAGE->set_title("$course->shortname: $strstats");
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->set_headingmenu();
|
||||
$PAGE->navbar->add($strreports, new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strreports, new moodle_url('/course/report.php', array('id'=>$course->id)));
|
||||
$PAGE->navbar->add($strstats);
|
||||
$PAGE->headingmenu(report_stats_mode_menu($course, $mode, $time, "$CFG->wwwroot/course/report/stats/index.php"));
|
||||
echo $OUTPUT->header();
|
||||
|
||||
@@ -86,7 +86,7 @@ function stats_report_extend_navigation($navigation, $course, $context) {
|
||||
global $CFG, $OUTPUT;
|
||||
if (has_capability('coursereport/stats:view', $context)) {
|
||||
if (!empty($CFG->enablestats)) {
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/report/stats/index.php', array('id'=>$course->id));
|
||||
$url = new moodle_url('/course/report/stats/index.php', array('id'=>$course->id));
|
||||
$navigation->add(get_string('stats'), $url, navigation_node::TYPE_SETTING, null, null, $OUTPUT->pix_url('i/report'));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ require_once(dirname(__FILE__) . '/../config.php');
|
||||
require_once($CFG->dirroot . '/course/lib.php');
|
||||
require_once($CFG->dirroot . '/course/request_form.php');
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/request.php'));
|
||||
$PAGE->set_url('/course/request.php');
|
||||
|
||||
/// Where we came from. Used in a number of redirects.
|
||||
$returnurl = $CFG->wwwroot . '/course/index.php';
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
||||
print_error("invalidcourseid");
|
||||
}
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/reset.php', array('id'=>$id)));
|
||||
$PAGE->set_url('/course/reset.php', array('id'=>$id));
|
||||
|
||||
require_login($course);
|
||||
require_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id));
|
||||
|
||||
@@ -58,7 +58,7 @@ $strname = get_string('name');
|
||||
$strintro = get_string('moduleintro');
|
||||
$strlastmodified = get_string('lastmodified');
|
||||
|
||||
$PAGE->set_url('course/resources.php', array('id' => $course->id));
|
||||
$PAGE->set_url('/course/resources.php', array('id' => $course->id));
|
||||
$PAGE->set_title($course->shortname.': '.$strresources);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->navbar->add($strresources);
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ $sequence = optional_param('sequence', '', PARAM_SEQUENCE);
|
||||
$visible = optional_param('visible', 0, PARAM_INT);
|
||||
$pageaction = optional_param('action', '', PARAM_ALPHA); // Used to simulate a DELETE command
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/rest.php', array('courseId'=>$courseId,'class'=>$class)));
|
||||
$PAGE->set_url('/course/rest.php', array('courseId'=>$courseId,'class'=>$class));
|
||||
|
||||
// Authorise the user and verify some incoming data
|
||||
if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ require_once("lib.php");
|
||||
$id = required_param('id', PARAM_INT); // course id
|
||||
$scaleid = optional_param('scaleid', 0, PARAM_INT); // scale id (show only this one)
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/scales.php', array('id'=>$id));
|
||||
$url = new moodle_url('/course/scales.php', array('id'=>$id));
|
||||
if ($scaleid !== 0) {
|
||||
$url->param('scaleid', $scaleid);
|
||||
}
|
||||
|
||||
+5
-5
@@ -15,7 +15,7 @@
|
||||
$blocklist = optional_param('blocklist', 0, PARAM_INT);
|
||||
$modulelist= optional_param('modulelist', '', PARAM_ALPHAEXT);
|
||||
|
||||
$PAGE->set_url('course/search.php', compact('search', 'page', 'perpage', 'blocklist', 'modulelist', 'edit'));
|
||||
$PAGE->set_url('/course/search.php', compact('search', 'page', 'perpage', 'blocklist', 'modulelist', 'edit'));
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
$search = trim(strip_tags($search)); // trim & clean raw searched string
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
if ($perpage != 10) {
|
||||
$urlparams['perpage'] = $perpage;
|
||||
}
|
||||
$PAGE->set_url('course/search.php', $urlparams);
|
||||
$PAGE->set_url('/course/search.php', $urlparams);
|
||||
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
|
||||
|
||||
if ($CFG->forcelogin) {
|
||||
@@ -95,7 +95,7 @@
|
||||
$strnovalidcourses = get_string('novalidcourses');
|
||||
|
||||
if (empty($search) and empty($blocklist) and empty($modulelist)) {
|
||||
$PAGE->navbar->add($strcourses, new moodle_url($CFG->wwwroot.'/course/index.php'));
|
||||
$PAGE->navbar->add($strcourses, new moodle_url('/course/index.php'));
|
||||
$PAGE->navbar->add($strsearch);
|
||||
$PAGE->set_title("$site->fullname : $strsearch");
|
||||
$PAGE->set_heading($site->fullname);
|
||||
@@ -198,8 +198,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
$PAGE->navbar->add($strcourses, new moodle_url($CFG->wwwroot.'/course/index.php'));
|
||||
$PAGE->navbar->add($strsearch, new moodle_url($CFG->wwwroot.'/course/search.php'));
|
||||
$PAGE->navbar->add($strcourses, new moodle_url('/course/index.php'));
|
||||
$PAGE->navbar->add($strsearch, new moodle_url('/course/search.php'));
|
||||
if (!empty($search)) {
|
||||
$PAGE->navbar->add(s($search));
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ $id = required_param('id', PARAM_INT);
|
||||
$switchrole = optional_param('switchrole',-1, PARAM_INT);
|
||||
$returnurlkey = optional_param('returnurl', false, PARAM_INT);
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/switchrole.php', array('id'=>$id)));
|
||||
$PAGE->set_url('/course/switchrole.php', array('id'=>$id));
|
||||
|
||||
if (!confirm_sesskey()) {
|
||||
print_error('confirmsesskeybad', 'error');
|
||||
|
||||
@@ -29,7 +29,7 @@ require_once($CFG->libdir.'/completionlib.php');
|
||||
$cmid=required_param('id',PARAM_INT);
|
||||
$targetstate=required_param('completionstate',PARAM_INT);
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/togglecompletion.php', array('id'=>$id,'completionstate'=>$targetstate)));
|
||||
$PAGE->set_url('/course/togglecompletion.php', array('id'=>$id,'completionstate'=>$targetstate));
|
||||
|
||||
switch($targetstate) {
|
||||
case COMPLETION_COMPLETE:
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ $id = required_param('id', PARAM_INT); //course
|
||||
$userid = optional_param('user', 0, PARAM_INT); //course
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/unenrol.php', array('id'=>$id)));
|
||||
$PAGE->set_url('/course/unenrol.php', array('id'=>$id));
|
||||
|
||||
if($userid == $USER->id){
|
||||
// the rest of this code assumes $userid=0 means
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ $mode = optional_param('mode', "todaylogs", PARAM_ALPHA);
|
||||
$page = optional_param('page', 0, PARAM_INT);
|
||||
$perpage = optional_param('perpage', 100, PARAM_INT);
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/course/user.php', array('id'=>$id,'user'=>$user, 'mode'=>$mode));
|
||||
$url = new moodle_url('/course/user.php', array('id'=>$id,'user'=>$user, 'mode'=>$mode));
|
||||
if ($page !== 0) {
|
||||
$url->param('page', $page);
|
||||
}
|
||||
@@ -133,7 +133,7 @@ $fullname = fullname($user, true);
|
||||
|
||||
$link = null;
|
||||
if ($course->id != SITEID && has_capability('moodle/course:viewparticipants', $coursecontext)) {
|
||||
$link = new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$course->id));
|
||||
$link = new moodle_url('/user/index.php', array('id'=>$course->id));
|
||||
}
|
||||
|
||||
$PAGE->navigation->extend_for_user($user);
|
||||
|
||||
+2
-2
@@ -89,7 +89,7 @@
|
||||
$course->format = 'weeks'; // Default format is weeks
|
||||
}
|
||||
|
||||
$PAGE->set_url('course/view.php', array('id' => $course->id));
|
||||
$PAGE->set_url('/course/view.php', array('id' => $course->id));
|
||||
$PAGE->set_pagelayout('course');
|
||||
$PAGE->set_pagetype('course-view-' . $course->format);
|
||||
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
|
||||
@@ -192,7 +192,7 @@
|
||||
// (i.e., no breadcrumbs other than the default one added inside this function)
|
||||
$buttons = switchroles_form($course->id);
|
||||
if ($PAGE->user_allowed_editing()) {
|
||||
$buttons .= $OUTPUT->edit_button(new moodle_url($CFG->wwwroot.'/course/view.php', array('id' => $course->id)));
|
||||
$buttons .= $OUTPUT->edit_button(new moodle_url('/course/view.php', array('id' => $course->id)));
|
||||
}
|
||||
|
||||
$PAGE->set_title(get_string('course') . ': ' . $course->fullname);
|
||||
|
||||
@@ -57,7 +57,7 @@ class enrolment_plugin_authorize
|
||||
$strcourses = get_string('courses');
|
||||
$strloginto = get_string('loginto', '', $course->shortname);
|
||||
|
||||
$PAGE->navbar->add($strcourses, new moodle_url($CFG->wwwroot.'/course/'));
|
||||
$PAGE->navbar->add($strcourses, new moodle_url('/course/'));
|
||||
$PAGE->navbar->add($strloginto);
|
||||
$PAGE->set_title($strloginto);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
$courseid = optional_param('course', SITEID, PARAM_INT);
|
||||
$userid = optional_param('user', 0, PARAM_INT);
|
||||
|
||||
$url = new moodle_url($CFG->wwwroot.'/enrol/authorize/index.php');
|
||||
$url = new moodle_url('/enrol/authorize/index.php');
|
||||
if ($orderid !== 0) {
|
||||
$url->param('order', $orderid);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ function authorize_print_orders($courseid, $userid) {
|
||||
}
|
||||
|
||||
if (SITEID != $courseid) {
|
||||
$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($authstrs->paymentmanagement, 'index.php');
|
||||
$PAGE->set_title("$course->shortname: $authstrs->paymentmanagement");
|
||||
@@ -268,7 +268,7 @@ function authorize_print_order($orderid)
|
||||
}
|
||||
|
||||
if (SITEID != $courseid) {
|
||||
$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($authstrs->paymentmanagement, 'index.php?course='.$course->id);
|
||||
$PAGE->navbar->add($authstrs->orderid . ': ' . $orderid, 'index.php');
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user