MDL-49845 notes: Changed headers for notes index
This commit is contained in:
+27
-2
@@ -91,13 +91,28 @@ $systemcontext = context_system::instance();
|
||||
note_view($coursecontext, $userid);
|
||||
|
||||
$strnotes = get_string('notes', 'notes');
|
||||
if ($userid) {
|
||||
if ($userid && $course->id == SITEID) {
|
||||
$PAGE->set_context(context_user::instance($user->id));
|
||||
$PAGE->navigation->extend_for_user($user);
|
||||
// If we are looking at our own notes, then change focus to 'my notes'.
|
||||
if ($userid == $USER->id) {
|
||||
$notenode = $PAGE->navigation->find('notes', null)->make_inactive();
|
||||
}
|
||||
|
||||
$notesurl = new moodle_url('/notes/index.php', array('user' => $userid));
|
||||
$PAGE->navbar->add(get_string('notes', 'notes'), $notesurl);
|
||||
} else if ($course->id != SITEID) {
|
||||
$notenode = $PAGE->navigation->find('currentcoursenotes', null)->make_inactive();
|
||||
$participantsurl = new moodle_url('/user/view.php', array('id' => $userid, 'course' => $course->id));
|
||||
$currentcoursenode = $PAGE->navigation->find('currentcourse', null);
|
||||
$participantsnode = $currentcoursenode->find('participants', null);
|
||||
$usernode = $participantsnode->add(fullname($user), $participantsurl);
|
||||
$usernode->make_active();
|
||||
|
||||
$notesurl = new moodle_url('/notes/index.php', array('user' => $userid, 'course' => $courseid));
|
||||
$PAGE->navbar->add(get_string('notes', 'notes'), $notesurl);
|
||||
|
||||
$PAGE->set_context(context_course::instance($courseid));
|
||||
} else {
|
||||
$link = null;
|
||||
if (has_capability('moodle/course:viewparticipants', $coursecontext)
|
||||
@@ -109,9 +124,19 @@ if ($userid) {
|
||||
|
||||
$PAGE->set_pagelayout('incourse');
|
||||
$PAGE->set_title($course->fullname);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
if ($course->id == SITEID) {
|
||||
$PAGE->set_heading(fullname($user));
|
||||
} else {
|
||||
$PAGE->set_heading($course->fullname);
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if ($course->id != SITEID) {
|
||||
$headerinfo = array('heading' => fullname($user), 'user' => $user);
|
||||
echo $OUTPUT->context_header($headerinfo, 2);
|
||||
}
|
||||
|
||||
echo $OUTPUT->heading($strnotes);
|
||||
|
||||
$strsitenotes = get_string('sitenotes', 'notes');
|
||||
|
||||
Reference in New Issue
Block a user