id; } else { $filtertype = 'course'; $filterselect = $course->id; } // require login to access notes require_login($course->id); $strnotes = get_string('notes', 'notes'); $crumbs = array(array('name' => $strnotes, 'link' => '', 'type' => 'activity')); $currenttab = 'notes'; // output HTML print_header($course->shortname . ': ' . $strnotes, $course->fullname, build_navigation($crumbs)); require_once($CFG->dirroot .'/user/tabs.php'); if($courseid != SITEID) { $context = get_context_instance(CONTEXT_COURSE, $courseid); if (has_capability('moodle/notes:manage', $context)) { $addlink = $CFG->wwwroot .'/notes/add.php?course=' . $courseid . '&user=' . $userid; echo '

' . get_string('addnewnote', 'notes') . '

'; } note_print_notes(get_string('sitenotes', 'notes'), $context, 0, $userid, NOTES_STATE_SITE, 0); note_print_notes(get_string('coursenotes', 'notes'), $context, $courseid, $userid, NOTES_STATE_PUBLIC, 0); note_print_notes(get_string('personalnotes', 'notes'), $context, $courseid, $userid, NOTES_STATE_DRAFT, $USER->id); } else { $context = get_context_instance(CONTEXT_SYSTEM); note_print_notes(get_string('sitenotes', 'notes'), $context, 0, $userid, NOTES_STATE_SITE, 0); if($userid) { $courses = get_my_courses($userid); foreach($courses as $c) { $header = '' . $c->fullname . ''; note_print_notes($header, $context, $c->id, $userid, NOTES_STATE_PUBLIC, 0); } } } add_to_log($courseid, 'notes', 'view', 'index.php?course='.$courseid.'&user='.$userid, 'view notes'); print_footer($course);