Skip to content

Commit

Permalink
MOre cleanups for notes interface
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Aug 31, 2007
1 parent ebbf8c1 commit 9f26cce
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lang/en_utf8/notes.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
$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';
Expand All @@ -21,4 +22,4 @@
$string['course'] = 'course';
$string['site'] = 'site';
$string['editnote'] = 'Edit note';
?>
?>
1 change: 1 addition & 0 deletions notes/add.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions notes/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
7 changes: 5 additions & 2 deletions notes/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion notes/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9f26cce

Please sign in to comment.