diff --git a/admin/index.php b/admin/index.php
index 03733186159..aeed1b7ec5f 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -524,7 +524,7 @@
if (optional_param('dbmigrate')) { // ??? Is this actually used?
print_simple_box_start('center','60%');
- require_once($CFG->dirroot.'/admin/utfdbmigrate.php');
+ require_once($CFG->dirroot.'/'.$CFG->admin.'/utfdbmigrate.php');
db_migrate2utf8();
print_simple_box_end();
}
diff --git a/admin/roles/managetabs.php b/admin/roles/managetabs.php
index 2e103ff88ad..563ef9aabda 100755
--- a/admin/roles/managetabs.php
+++ b/admin/roles/managetabs.php
@@ -1,11 +1,11 @@
wwwroot.'/admin/roles/manage.php', get_string('manageroles', 'role'));
+ $toprow[] = new tabobject('manage', $CFG->wwwroot.'/'.$CFG->admin.'/roles/manage.php', get_string('manageroles', 'role'));
- $toprow[] = new tabobject('allowassign', $CFG->wwwroot.'/admin/roles/allowassign.php', get_string('allowassign', 'role'));
+ $toprow[] = new tabobject('allowassign', $CFG->wwwroot.'/'.$CFG->admin.'/roles/allowassign.php', get_string('allowassign', 'role'));
- $toprow[] = new tabobject('allowoverride', $CFG->wwwroot.'/admin/roles/allowoverride.php', get_string('allowoverride', 'role'));
+ $toprow[] = new tabobject('allowoverride', $CFG->wwwroot.'/'.$CFG->admin.'/roles/allowoverride.php', get_string('allowoverride', 'role'));
$tabs = array($toprow);
diff --git a/admin/settings.php b/admin/settings.php
index 7d715d2be15..a39e1b9daf5 100644
--- a/admin/settings.php
+++ b/admin/settings.php
@@ -64,11 +64,11 @@ if ($data = data_submitted()) {
case 'site':
redirect("$CFG->wwwroot/");
case 'admin':
- redirect("$CFG->wwwroot/admin/");
+ redirect("$CFG->wwwroot/$CFG->admin/");
default:
// following redirect should display confirmation message because it redirects
// to the same page, user might not know if save button worked
- redirect("$CFG->wwwroot/admin/settings.php?section=" . $PAGE->section, get_string('changessaved'),2);
+ redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=" . $PAGE->section, get_string('changessaved'),2);
}
} else {
error(get_string('errorwithsettings', 'admin') . '
' . $errors);
diff --git a/admin/settings/courses.php b/admin/settings/courses.php
index 893340f5e4f..b1b0edcbaf2 100644
--- a/admin/settings/courses.php
+++ b/admin/settings/courses.php
@@ -5,7 +5,7 @@
$ADMIN->add('courses', new admin_externalpage('coursemgmt', get_string('coursemgmt', 'admin'), $CFG->wwwroot . '/course/index.php?categoryedit=on'));
-$ADMIN->add('courses', new admin_externalpage('enrolment', get_string('enrolments'), $CFG->wwwroot . '/admin/enrol.php'));
+$ADMIN->add('courses', new admin_externalpage('enrolment', get_string('enrolments'), $CFG->wwwroot . '/'.$CFG->admin.'/enrol.php'));
// "courserequests" settingpage
$temp = new admin_settingpage('courserequest', get_string('courserequest'));
diff --git a/admin/xmldb/index.php b/admin/xmldb/index.php
index 1bb29e77c14..025997b8dae 100644
--- a/admin/xmldb/index.php
+++ b/admin/xmldb/index.php
@@ -102,7 +102,7 @@
/// Save the original one to add it from ours. Global too! :-(
global $standard_javascript;
$standard_javascript = $CFG->javascript; // Save original javascript file
- $CFG->javascript = $CFG->dirroot.'/admin/xmldb/javascript.php'; //Use our custom javascript code
+ $CFG->javascript = $CFG->dirroot.'/'.$CFG->admin.'/xmldb/javascript.php'; //Use our custom javascript code
/// Go with standard admin header
admin_externalpage_print_header($adminroot);
print_heading($xmldb_action->getTitle());
diff --git a/admin/xmldb/javascript.php b/admin/xmldb/javascript.php
index ecafad4d438..abf86cd5973 100644
--- a/admin/xmldb/javascript.php
+++ b/admin/xmldb/javascript.php
@@ -39,15 +39,15 @@
$postaction = optional_param('postaction', '', PARAM_ALPHAEXT);
/// If the js exists, load it
if ($action) {
- $file = $CFG->dirroot . '/admin/xmldb/actions/' . $action . '/' . $action . '.js';
- $wwwfile = $CFG->wwwroot . '/admin/xmldb/actions/' . $action . '/' . $action . '.js';
+ $file = $CFG->dirroot . '/'.$CFG->admin.'/xmldb/actions/' . $action . '/' . $action . '.js';
+ $wwwfile = $CFG->wwwroot . '/'.$CFG->admin.'/xmldb/actions/' . $action . '/' . $action . '.js';
if (file_exists($file) && is_readable($file)) {
echo '' . "\n";
} else {
/// Try to load the postaction javascript if exists
if ($postaction) {
- $file = $CFG->dirroot . '/admin/xmldb/actions/' . $postaction . '/' . $postaction . '.js';
- $wwwfile = $CFG->wwwroot . '/admin/xmldb/actions/' . $postaction . '/' . $postaction . '.js';
+ $file = $CFG->dirroot . '/'.$CFG->admin.'/xmldb/actions/' . $postaction . '/' . $postaction . '.js';
+ $wwwfile = $CFG->wwwroot . '/'.$CFG->admin.'/xmldb/actions/' . $postaction . '/' . $postaction . '.js';
if (file_exists($file) && is_readable($file)) {
echo '' . "\n";
}
diff --git a/blocks/admin/block_admin.php b/blocks/admin/block_admin.php
index 16cae5466fb..46001a8c134 100644
--- a/blocks/admin/block_admin.php
+++ b/blocks/admin/block_admin.php
@@ -58,7 +58,7 @@ class block_admin extends block_list {
/// Assign roles to the course
if (has_capability('moodle/role:assign', $context)) {
- $this->content->items[]=''.get_string('assignroles', 'role').'';
+ $this->content->items[]=''.get_string('assignroles', 'role').'';
$this->content->icons[]='
';
}
diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php
index ee35ca7b08d..a7a41c3b267 100644
--- a/blocks/moodleblock.class.php
+++ b/blocks/moodleblock.class.php
@@ -357,7 +357,7 @@ class block_base {
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey));
// place holder for roles button
- $movebuttons .= '' .
+ $movebuttons .= '' .
'
';
$movebuttons .= ''.get_string('roles').'');
+ print(''.get_string('roles').'');
/// Print the category selector
diff --git a/course/edit2.php b/course/edit2.php
index 8cfa2160e7f..5c15b6c1701 100644
--- a/course/edit2.php
+++ b/course/edit2.php
@@ -249,7 +249,7 @@
redirect($CFG->wwwroot."/course/importstudents.php?id=$newcourseid");
} else if (has_capability('moodle/role:assign', $context)) { // Redirect users with assign capability to assign users to different roles
- redirect($CFG->wwwroot."/admin/roles/assign.php?contextid=$context->id");
+ redirect($CFG->wwwroot."/$CFG->admin/roles/assign.php?contextid=$context->id");
} else { // Add current teacher and send to course
diff --git a/course/mod.php b/course/mod.php
index d1427c545ca..fa993819aff 100644
--- a/course/mod.php
+++ b/course/mod.php
@@ -638,7 +638,7 @@
if (!empty($cm->id)) {
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$currenttab = 'update';
- include_once($CFG->dirroot.'/admin/roles/tabs.php');
+ include_once($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php');
}
unset($SESSION->modform); // Clear any old ones that may be hanging around.
diff --git a/enrol/imsenterprise/importnow.php b/enrol/imsenterprise/importnow.php
index 776383a4aad..b04bc5c51d7 100644
--- a/enrol/imsenterprise/importnow.php
+++ b/enrol/imsenterprise/importnow.php
@@ -11,8 +11,7 @@ if (!$site = get_site()) {
$str = get_strings(array('enrolments', 'users', 'administration', 'settings'));
print_header("$site->shortname: $str->enrolments", "$site->fullname",
- "$str->administration ->
- $str->users ->
+ "admin/index.php\">$str->administration ->
$str->enrolments -> IMS import");
require_once('enrol.php');
diff --git a/lib/adminlib.php b/lib/adminlib.php
index c87ffc48d4d..0d2e88d4ccf 100644
--- a/lib/adminlib.php
+++ b/lib/adminlib.php
@@ -2333,7 +2333,7 @@ function admin_externalpage_setup($section, $adminroot) {
if ($site = get_site()) {
require_login();
} else {
- redirect($CFG->wwwroot . '/admin/index.php');
+ redirect($CFG->wwwroot . '/'.$CFG->admin.'/index.php');
die;
}
@@ -2412,12 +2412,12 @@ function admin_get_root() {
// start the admin tree!
$ADMIN = new admin_category('root','Administration');
// we process this file first to get categories up and running
- include($CFG->dirroot . '/admin/settings/top.php');
+ include($CFG->dirroot . '/'.$CFG->admin.'/settings/top.php');
// now we process all other files in admin/settings to build the
// admin tree
- foreach (glob($CFG->dirroot . '/admin/settings/*.php') as $file) {
- if ($file != $CFG->dirroot . '/admin/settings/top.php') {
+ foreach (glob($CFG->dirroot . '/'.$CFG->admin.'/settings/*.php') as $file) {
+ if ($file != $CFG->dirroot . '/'.$CFG->admin.'/settings/top.php') {
include_once($file);
}
}
diff --git a/lib/environmentlib.php b/lib/environmentlib.php
index 09f5d1178c4..515d4c56ede 100644
--- a/lib/environmentlib.php
+++ b/lib/environmentlib.php
@@ -279,7 +279,7 @@ function load_environment_xml() {
$file = $CFG->dataroot.'/environment/environment.xml';
if (!is_file($file) || !is_readable($file) || !$contents = file_get_contents($file)) {
/// Fallback to fixed $CFG->admin/environment.xml
- $file = $CFG->dirroot.'/admin/environment.xml';
+ $file = $CFG->dirroot.'/'.$CFG->admin.'/environment.xml';
if (!is_file($file) || !is_readable($file) || !$contents = file_get_contents($file)) {
return false;
}
diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index cde2f68d3aa..a6b1d975c7f 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -4275,7 +4275,7 @@ function get_string($identifier, $module='', $a=NULL) {
if (strpos($module, 'block_') === 0) { // It's a block lang file
$locations[] = $CFG->dirroot .'/blocks/'.substr($module, 6).'/lang/';
} else if (strpos($module, 'report_') === 0) { // It's a report lang file
- $locations[] = $CFG->dirroot .'/admin/report/'.substr($module, 7).'/lang/';
+ $locations[] = $CFG->dirroot .'/'.$CFG->admin.'/report/'.substr($module, 7).'/lang/';
$locations[] = $CFG->dirroot .'/course/report/'.substr($module, 7).'/lang/';
} else { // It's a normal activity
$locations[] = $CFG->dirroot .'/mod/'.$module.'/lang/';
diff --git a/user/index.php b/user/index.php
index 754d3b341e7..9accbcaac3e 100644
--- a/user/index.php
+++ b/user/index.php
@@ -50,7 +50,7 @@
}
} else { // no roles yet
if (has_capability('moodle/user:assign', $context)) {
- redirect($CFG->wwwroot.'/admin/roles/assign.php?contextid='.$context->id);
+ redirect($CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id);
} else {
error ('no participants found for this course');
}
@@ -435,7 +435,7 @@ function checkchecked(form) {
$a->items = $currentrole->name;
echo '