navigation MDL-14632 Added pagelayout calls to set more appropriate page layouts

This commit is contained in:
Sam Hemelryk 2010-05-14 07:07:15 +00:00
parent abf63f981b
commit c07dfe7021
3 changed files with 9 additions and 0 deletions

View File

@ -42,6 +42,7 @@ $systemcontext = get_context_instance(CONTEXT_SYSTEM);
$PAGE->set_url('/course/index.php'); $PAGE->set_url('/course/index.php');
$PAGE->set_context($systemcontext); $PAGE->set_context($systemcontext);
$PAGE->set_pagelayout('admin');
if (can_edit_in_category()) { if (can_edit_in_category()) {
if ($categoryedit !== -1) { if ($categoryedit !== -1) {

View File

@ -55,8 +55,10 @@
$frontpagectx = get_context_instance(CONTEXT_COURSE, SITEID); $frontpagectx = get_context_instance(CONTEXT_COURSE, SITEID);
if ($isfrontpage) { if ($isfrontpage) {
$PAGE->set_pagelayout('admin');
require_capability('moodle/site:viewparticipants', $systemcontext); require_capability('moodle/site:viewparticipants', $systemcontext);
} else { } else {
$PAGE->set_pagelayout('incourse');
require_capability('moodle/course:viewparticipants', $context); require_capability('moodle/course:viewparticipants', $context);
} }

View File

@ -108,6 +108,12 @@ $PAGE->set_subpage($currentpage->id);
$PAGE->set_title("$SITE->shortname: $strpublicprofile"); $PAGE->set_title("$SITE->shortname: $strpublicprofile");
$PAGE->set_heading("$SITE->shortname: $strpublicprofile"); $PAGE->set_heading("$SITE->shortname: $strpublicprofile");
$PAGE->navigation->extend_for_user($user); $PAGE->navigation->extend_for_user($user);
if ($node = $PAGE->settingsnav->get('userviewingsettings')) {
$node->forceopen = true;
if ($node = $PAGE->settingsnav->get('root')) {
$node->forceopen = false;
}
}
// Toggle the editing state and switches // Toggle the editing state and switches