From dbed4286da13ecff63e20c5d0cc150620f405593 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 5 Sep 2006 09:15:52 +0000 Subject: [PATCH] Cleaned up headers when editing roles for blocks --- admin/roles/assign.php | 2 +- admin/roles/tabs.php | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/admin/roles/assign.php b/admin/roles/assign.php index 6df2a7361f..92983cbcbd 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -69,7 +69,7 @@ if ($courseid!= SITEID) { print_header("$fullname", "$fullname", "id\">$course->shortname -> - wwwroot."/user/index.php?id=$course->id\">$participants -> wwwroot."/user/view.php?id=".$userid."&course=".$courseid."\">$fullname ->".get_string('assign', 'roles'), + wwwroot."/user/index.php?id=$course->id\">$participants -> wwwroot."/user/view.php?id=".$userid."&course=".$courseid."\">$fullname ->".$straction, "", "", true, " ", navmenu($course)); /// site header diff --git a/admin/roles/tabs.php b/admin/roles/tabs.php index d3b0a82aae..b72402af87 100755 --- a/admin/roles/tabs.php +++ b/admin/roles/tabs.php @@ -65,7 +65,34 @@ if ($currenttab != 'update') { break; case CONTEXT_BLOCK: - print_header(); + if ($blockinstance = get_record('block_instance', 'id', $context->instanceid)) { + if ($block = get_record('block', 'id', $blockinstance->blockid)) { + $blockname = print_context_name($context); + $navigation = $blockname. ' -> '.$straction; + + switch ($blockinstance->pagetype) { + case 'course-view': + if ($course = get_record('course', 'id', $blockinstance->pageid)) { + if ($course->id != SITEID) { + $navigation = "wwwroot/course/view.php?id=$course->id\">$course->shortname -> $navigation"; + } + print_header("$straction: $blockname", $course->fullname, $navigation); + } + break; + + case 'blog-view': + $strblogs = get_string('blogs','blog'); + $navigation = ''. + $strblogs.' -> '.$navigation; + print_header("$straction: $strblogs", $SITE->fullname, $navigation); + break; + + default: + print_header("$straction: $blockname", $SITE->fullname, $navigation); + break; + } + } + } break; default: @@ -83,7 +110,7 @@ if ($currenttab != 'update') { } - $toprow[] = new tabobject('roles', $CFG->wwwroot.'/admin/roles/assign.php?contextid='.$context->id, get_string('roles')); + $toprow[] = new tabobject('roles', $CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id, get_string('roles')); if (isset($tabsmode)) { @@ -97,14 +124,14 @@ if ($currenttab != 'update') { $inactive[] = 'roles'; if (!empty($assignableroles)) { - $secondrow[] = new tabobject('assign', $CFG->wwwroot.'/admin/roles/assign.php?contextid='.$context->id, get_string('assignroles', 'role')); + $secondrow[] = new tabobject('assign', $CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id, get_string('assignroles', 'role')); } if (!empty($overridableroles)) { if ($context->aggregatelevel == CONTEXT_SYSTEM) { $secondrow[] = new tabobject('override', '', get_string('overrideroles', 'role')); } else { - $secondrow[] = new tabobject('override', $CFG->wwwroot.'/admin/roles/override.php?contextid='.$context->id, + $secondrow[] = new tabobject('override', $CFG->wwwroot.'/'.$CFG->admin.'/roles/override.php?contextid='.$context->id, get_string('overrideroles', 'role')); } } -- 2.39.5