removed unnecessary calls to get_site()

This commit is contained in:
gustav_delius 2004-08-29 14:15:40 +00:00
parent afd97e8449
commit 222ac91bc9
26 changed files with 219 additions and 415 deletions

View file

@ -1252,11 +1252,6 @@ function print_course($course, $width="100%") {
$enrol = new enrolment_plugin;
}
if (! $site = get_site()) {
error("Could not find a site!");
}
print_simple_box_start("center", "$width", $THEME->cellcontent, 5, "coursebox");
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
@ -1274,7 +1269,7 @@ function print_course($course, $width="100%") {
$teacher->role = $course->teacher;
}
$fullname = fullname($teacher, isteacher($course->id)); // is the USER a teacher of that course
echo "$teacher->role: <a href=\"$CFG->wwwroot/user/view.php?id=$teacher->id&course=$site->id\">$fullname</a><br />";
echo "$teacher->role: <a href=\"$CFG->wwwroot/user/view.php?id=$teacher->id&course=".SITEID."\">$fullname</a><br />";
}
}
echo "</font></p>";

View file

@ -179,8 +179,7 @@
rebuild_course_cache($cm->course);
$site = get_site();
if ($site->id == $cm->course) {
if (SITEID == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");
@ -224,8 +223,7 @@
rebuild_course_cache($section->course);
$site = get_site();
if ($site->id == $section->course) {
if (SITEID == $section->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$section->course");
@ -249,8 +247,7 @@
error("Could not update the indent level on that course module");
}
$site = get_site();
if ($site->id == $cm->course) {
if (SITEID == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");
@ -271,8 +268,7 @@
rebuild_course_cache($cm->course);
$site = get_site();
if ($site->id == $cm->course) {
if (SITEID == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");
@ -297,14 +293,12 @@
error("This module doesn't exist");
}
$site = get_site();
if ($module->visible and ($section->visible or ($site->id == $cm->course))) {
if ($module->visible and ($section->visible or (SITEID == $cm->course))) {
show_course_module($cm->id);
rebuild_course_cache($cm->course);
}
if ($site->id == $cm->course) {
if (SITEID == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");
@ -325,8 +319,7 @@
rebuild_course_cache($cm->course);
$site = get_site();
if ($site->id == $cm->course) {
if (SITEID == $cm->course) {
redirect($CFG->wwwroot);
} else {
redirect("view.php?id=$cm->course");