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:
@@ -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",
|
||||
|
||||
@@ -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,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'));
|
||||
|
||||
Reference in New Issue
Block a user