Upgrading table to rename the context->aggregatelevel field which was

really bugging me.   Code should be a little bit more readable now.

Apologies to those with non-core code already using this field.
This commit is contained in:
moodler
2006-09-22 06:19:32 +00:00
parent b988fe5f94
commit aad2ba95d1
12 changed files with 83 additions and 71 deletions
+2 -2
View File
@@ -28,7 +28,7 @@
$inmeta = 0;
if ($context->aggregatelevel == CONTEXT_COURSE) {
if ($context->contextlevel == CONTEXT_COURSE) {
$courseid = $context->instanceid;
if ($course = get_record('course', 'id', $courseid)) {
$inmeta = $course->metacourse;
@@ -79,7 +79,7 @@
/// Print the header and tabs
if ($context->aggregatelevel == CONTEXT_USER) {
if ($context->contextlevel == CONTEXT_USER) {
/// course header
if ($courseid!= SITEID) {
print_header("$fullname", "$fullname",
+1 -1
View File
@@ -49,7 +49,7 @@
/// Print the header and tabs
if ($context->aggregatelevel == CONTEXT_USER) {
if ($context->contextlevel == CONTEXT_USER) {
/// course header
if ($course->id != SITEID) {
+3 -3
View File
@@ -3,7 +3,7 @@
// Handles headers and tabs for the roles control at any level apart from SYSTEM level
if ($currenttab != 'update') {
switch ($context->aggregatelevel) {
switch ($context->contextlevel) {
case CONTEXT_SYSTEM:
$stradministration = get_string('administration');
@@ -104,9 +104,9 @@ if ($currenttab != 'update') {
}
if ($context->aggregatelevel != CONTEXT_SYSTEM) { // Print tabs for anything except SYSTEM context
if ($context->contextlevel != CONTEXT_SYSTEM) { // Print tabs for anything except SYSTEM context
if ($context->aggregatelevel == CONTEXT_MODULE) { // only show update button if module?
if ($context->contextlevel == CONTEXT_MODULE) { // only show update button if module?
$toprow[] = new tabobject('update', $CFG->wwwroot.'/course/mod.php?update='.
$context->instanceid.'&return=true&sesskey='.sesskey(), get_string('update'));