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();
}
<?php
// this page deals with the 2 tabs for manage.php and grant.php
- $toprow[] = new tabobject('manage', $CFG->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);
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') . ' <br />' . $errors);
$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'));
/// 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());
$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 '<script language="JavaScript" type="text/javascript" src="' . $wwwfile . '"></script>' . "\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 '<script language="JavaScript" type="text/javascript" src="' . $wwwfile . '"></script>' . "\n";
}
/// Assign roles to the course
if (has_capability('moodle/role:assign', $context)) {
- $this->content->items[]='<a href="'.$CFG->wwwroot.'/admin/roles/assign.php?contextid='.$context->id.'">'.get_string('assignroles', 'role').'</a>';
+ $this->content->items[]='<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id.'">'.get_string('assignroles', 'role').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/roles.gif" alt="" />';
}
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey));
// place holder for roles button
- $movebuttons .= '<a class="icon roles" title="'. $this->str->assignroles .'" href="'.$CFG->wwwroot.'/admin/roles/assign.php?contextid='.$blockcontext->id.'">' .
+ $movebuttons .= '<a class="icon roles" title="'. $this->str->assignroles .'" href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$blockcontext->id.'">' .
'<img src="'.$CFG->pixpath.'/i/roles.gif" alt="'.$this->str->assignroles.'" /></a>';
$movebuttons .= '<a class="icon hide" title="'. $title .'" href="'.$script.'&blockaction=toggle">' .
}
/// Print link to roles
- print('<a href="'.$CFG->wwwroot.'/admin/roles/assign.php?contextid='.$context->id.'">'.get_string('roles').'</a>');
+ print('<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id.'">'.get_string('roles').'</a>');
/// Print the category selector
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
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.
$str = get_strings(array('enrolments', 'users', 'administration', 'settings'));
print_header("$site->shortname: $str->enrolments", "$site->fullname",
- "<a href=\"../../admin/index.php\">$str->administration</a> ->
- <a href=\"../../admin/users.php\">$str->users</a> ->
+ "<a href=\"../../$CFG->admin/index.php\">$str->administration</a> ->
$str->enrolments -> IMS import");
require_once('enrol.php');
if ($site = get_site()) {
require_login();
} else {
- redirect($CFG->wwwroot . '/admin/index.php');
+ redirect($CFG->wwwroot . '/'.$CFG->admin.'/index.php');
die;
}
// 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);
}
}
$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;
}
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/';
}
} 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');
}
$a->items = $currentrole->name;
echo '<h2>'.get_string('counteditems', '', $a);
if (user_can_assign($context, $roleid)) {
- echo ' <a href="'.$CFG->wwwroot.'/admin/roles/assign.php?roleid='.$roleid.'&contextid='.$context->id.'">';
+ echo ' <a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?roleid='.$roleid.'&contextid='.$context->id.'">';
echo '<img src="'.$CFG->pixpath.'/i/edit.gif" height="16" width="16" alt="" /></a>';
}
echo '</h2>';
if (!empty($showroles)) { // this variable controls whether this roles is showed, or not, so only user/view page should set this flag
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
- $toprow[] = new tabobject('roles', $CFG->wwwroot.'/admin/roles/assign.php?contextid='.$usercontext->id.'&userid='.$user->id.'&courseid='.$course->id
+ $toprow[] = new tabobject('roles', $CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$usercontext->id.'&userid='.$user->id.'&courseid='.$course->id
,get_string('roles'));
if (in_array($currenttab, array('assign', 'override'))) {
$activetwo = array('roles');
$secondrow = array();
- $secondrow[] = new tabobject('assign', $CFG->wwwroot.'/admin/roles/assign.php?contextid='.$usercontext->id.'&userid='.$user->id.'&courseid='.$course->id
+ $secondrow[] = new tabobject('assign', $CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$usercontext->id.'&userid='.$user->id.'&courseid='.$course->id
,get_string('assignroles', 'role'));
- $secondrow[] = new tabobject('override', $CFG->wwwroot.'/admin/roles/override.php?contextid='.$usercontext->id.'&userid='.$user->id.'&courseid='.$course->id
+ $secondrow[] = new tabobject('override', $CFG->wwwroot.'/'.$CFG->admin.'/roles/override.php?contextid='.$usercontext->id.'&userid='.$user->id.'&courseid='.$course->id
,get_string('overrideroles', 'role'));
}