From 6859360cd4a9102bcdf315034e31c00cfed0b147 Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 26 Sep 2006 21:10:14 +0000 Subject: [PATCH] coverted /admin/ to proper /$CFG->admin/ in paths --- admin/index.php | 2 +- admin/roles/managetabs.php | 6 +++--- admin/settings.php | 4 ++-- admin/settings/courses.php | 2 +- admin/xmldb/index.php | 2 +- admin/xmldb/javascript.php | 8 ++++---- blocks/admin/block_admin.php | 2 +- blocks/moodleblock.class.php | 2 +- course/category.php | 2 +- course/edit2.php | 2 +- course/mod.php | 2 +- enrol/imsenterprise/importnow.php | 3 +-- lib/adminlib.php | 8 ++++---- lib/environmentlib.php | 2 +- lib/moodlelib.php | 2 +- user/index.php | 4 ++-- user/tabs.php | 6 +++--- 17 files changed, 29 insertions(+), 30 deletions(-) diff --git a/admin/index.php b/admin/index.php index 0373318615..aeed1b7ec5 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 2e103ff88a..563ef9aabd 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 7d715d2be1..a39e1b9daf 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 893340f5e4..b1b0edcbaf 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 1bb29e77c1..025997b8da 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 ecafad4d43..abf86cd597 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 16cae5466f..46001a8c13 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 ee35ca7b08..a7a41c3b26 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 .= '' . ''.$this->str->assignroles.''; $movebuttons .= '' . diff --git a/course/category.php b/course/category.php index 9d1206e9d7..6c91af525f 100644 --- a/course/category.php +++ b/course/category.php @@ -107,7 +107,7 @@ } /// Print link to roles - print(''.get_string('roles').''); + print(''.get_string('roles').''); /// Print the category selector diff --git a/course/edit2.php b/course/edit2.php index 8cfa2160e7..5c15b6c170 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 d1427c545c..fa993819af 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 776383a4aa..b04bc5c51d 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 c87ffc48d4..0d2e88d4cc 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 09f5d1178c..515d4c56ed 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 cde2f68d3a..a6b1d975c7 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 754d3b341e..9accbcaac3 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 '

'.get_string('counteditems', '', $a); if (user_can_assign($context, $roleid)) { - echo ' '; + echo ' '; echo ''; } echo '

'; diff --git a/user/tabs.php b/user/tabs.php index d2a90a7b82..df2908c6ee 100644 --- a/user/tabs.php +++ b/user/tabs.php @@ -176,7 +176,7 @@ 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'))) { @@ -184,9 +184,9 @@ $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')); } -- 2.39.5