MOre cleanups for notes interface

This commit is contained in:
moodler 2007-08-31 05:22:44 +00:00
parent ebbf8c16c6
commit 9f26cce6da
5 changed files with 15 additions and 5 deletions

View File

@ -6,9 +6,10 @@ $string['sitenotes'] = 'Site notes';
$string['coursenotes'] = 'Course notes';
$string['personalnotes'] = 'Personal notes';
$string['created'] = 'created';
$string['nonotes'] = 'There are no notes.';
$string['nonotes'] = 'There are no notes of this type yet';
$string['notesnotvisible'] = 'You are not allowed to view the notes.';
$string['addnewnote'] = 'Add a new note';
$string['addnewnoteselect'] = 'Select users to write notes about';
$string['groupaddnewnote'] = 'Add a new note for all';
$string['deleteconfirm'] = 'Delete this note?';
$string['content'] = 'Content';
@ -21,4 +22,4 @@ $string['personal'] = 'personal';
$string['course'] = 'course';
$string['site'] = 'site';
$string['editnote'] = 'Edit note';
?>
?>

View File

@ -69,6 +69,7 @@
/// output HTML
$nav = array();
$nav[] = array('name' => get_string('participants'), 'link' => $CFG->wwwroot . '/user/index.php?id=' . $course->id, 'type' => 'misc');
$nav[] = array('name' => fullname($user), 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id. '&course=' . $course->id, 'type' => 'misc');
$nav[] = array('name' => get_string('notes', 'notes'), 'link' => $CFG->wwwroot . '/notes/index.php?course=' . $course->id . '&user=' . $user->id, 'type' => 'misc');
$nav[] = array('name' => $strnotes, 'link' => '', 'type' => 'activity');

View File

@ -72,6 +72,7 @@
/// output HTML
$nav = array();
$nav[] = array('name' => get_string('participants'), 'link' => $CFG->wwwroot . '/user/index.php?id=' . $course->id, 'type' => 'misc');
$nav[] = array('name' => fullname($user), 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id. '&course=' . $course->id, 'type' => 'misc');
$nav[] = array('name' => get_string('notes', 'notes'), 'link' => $CFG->wwwroot . '/notes/index.php?course=' . $course->id . '&user=' . $user->id, 'type' => 'misc');
$nav[] = array('name' => $strnotes, 'link' => '', 'type' => 'activity');

View File

@ -51,7 +51,10 @@
$strnotes = get_string('notes', 'notes');
$nav = array();
$nav[] = array('name' => fullname($user), 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id. '&course=' . $course->id, 'type' => 'misc');
$nav[] = array('name' => get_string('participants'), 'link' => $CFG->wwwroot . '/user/index.php?id=' . $course->id, 'type' => 'misc');
if ($userid) {
$nav[] = array('name' => fullname($user), 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id. '&course=' . $course->id, 'type' => 'misc');
}
$nav[] = array('name' => $strnotes, 'link' => '', 'type' => 'misc');
print_header($course->shortname . ': ' . $strnotes, $course->fullname, build_navigation($nav));
@ -72,7 +75,7 @@
$addid = has_capability('moodle/notes:manage', $context) ? $courseid : 0;
$view = has_capability('moodle/notes:view', $context);
note_print_notes('<a name="sitenotes"></a>' . $strsitenotes, $addid, $view, 0, $userid, NOTES_STATE_SITE, 0);
note_print_notes('<a name="coursenotes"></a>' . $strcoursenotes, $addid, $view, $courseid, $userid, NOTES_STATE_PUBLIC, 0);
note_print_notes('<a name="coursenotes"></a>' . $strcoursenotes. ' ('.$course->fullname.')', $addid, $view, $courseid, $userid, NOTES_STATE_PUBLIC, 0);
note_print_notes('<a name="personalnotes"></a>' . $strpersonalnotes, $addid, $view, $courseid, $userid, NOTES_STATE_DRAFT, $USER->id);
} else { // Normal course

View File

@ -235,7 +235,11 @@ function note_print_notes($header, $addcourseid = 0, $viewnotes = true, $coursei
echo '<div class="notesgroup">';
}
if ($addcourseid) {
echo '<p><a href="'. $CFG->wwwroot .'/notes/add.php?course=' . $addcourseid . '&amp;user=' . $userid . '&amp;state=' . $state . '">' . get_string('addnewnote', 'notes') . '</a></p>';
if ($userid) {
echo '<p><a href="'. $CFG->wwwroot .'/notes/add.php?course=' . $addcourseid . '&amp;user=' . $userid . '&amp;state=' . $state . '">' . get_string('addnewnote', 'notes') . '</a></p>';
} else {
echo '<p><a href="'. $CFG->wwwroot .'/user/index.php?id=' . $addcourseid. '">' . get_string('addnewnoteselect', 'notes') . '</a></p>';
}
}
if ($viewnotes) {
$notes =& note_list($courseid, $userid, $state, $author);