From 79be5e9a4109287925e0bc493ae99923a2bc0601 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 10 Dec 2003 16:06:06 +0000 Subject: [PATCH] Simplification of the comments page and more forum-like comments --- mod/glossary/comments.php | 55 ++++++++++++--------------------------- mod/glossary/lib.php | 32 +++++++++++------------ 2 files changed, 32 insertions(+), 55 deletions(-) diff --git a/mod/glossary/comments.php b/mod/glossary/comments.php index b3c22b0074..8597bc2d5c 100644 --- a/mod/glossary/comments.php +++ b/mod/glossary/comments.php @@ -49,57 +49,36 @@ $strsearch = get_string("search"); print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname", - "$navigation id>$strglossaries -> id>$glossary->name -> " . get_string("comments","glossary"), + "$navigation id>$strglossaries -> id>$glossary->name -> $entry->concept", "", "", true, update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm)); - print_heading($glossary->name); +/// original glossary entry -/// Info boxes + echo "
"; + glossary_print_entry($course, $cm, $glossary, $entry, "", "", false); + echo "
"; - if ( $glossary->intro ) { - print_simple_box_start("center","70%"); - echo '

'; - echo $glossary->intro; - echo '

'; - print_simple_box_end(); - } +/// comments - echo "

"; - echo ""; - echo "cellheading2>"; - echo ""; - echo "
"; - echo "'; - echo "
"; - echo get_string("commentson","glossary") . ' ' . glossary_print_entry_concept($entry) . '"; - if ( $glossary->allowcomments ) { - echo "id&eid=$entry->id\">\"" "; - } - echo "
"; - - echo "
"; - if ($entry->attachment) { - $entry->course = $course->id; - echo "
"; - echo glossary_print_attachments($entry,"html"); - echo "
"; + $strheading = get_string('commentson','glossary')." \"$entry->concept\""; + if ($glossary->allowcomments) { + $strheading .= "  id&eid=$entry->id\"> "; } - echo "$entry->concept: "; - glossary_print_entry_definition($entry); - echo "
"; -/// comments - $comments = get_records("glossary_comments","entryid",$entry->id,"timemodified ASC"); - if ( !$comments ) { - echo "

" . get_string("nocomments","glossary") . ""; - } else { + print_heading($strheading); + + if ($comments = get_records("glossary_comments","entryid",$entry->id,"timemodified ASC")) { foreach ($comments as $comment) { - echo "

"; glossary_print_comment($course, $cm, $glossary, $entry, $comment); + echo '
'; } + } else { + print_heading(get_string("nocomments","glossary")); } /// Finish the page + print_footer($course); + ?> diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index dd862ce156..ee26b9db86 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -1418,35 +1418,33 @@ function glossary_print_comment($course, $cm, $glossary, $entry, $comment) { $user = get_record("user", "id", $comment->userid); $strby = get_string("writtenby","glossary"); - - echo ''; - echo ""; - $fullname = fullname($user, isteacher($course->id)); + echo '
'; + echo ""; + echo ""; echo ""; - echo "

"; - echo "
cellcontent2\" class=\"forumpostpicture\" width=\"35\" valign=\"top\">"; + print_user_picture($user->id, $course->id, $user->picture); + echo "cellheading\" class=\"forumpostheader\" width=\"100%\">"; echo "

"; - print_user_picture($user->id, $course->id, $user->picture); - echo " $fullname
"; - echo "   (".get_string("lastedited").": ".userdate($comment->timemodified).")"; - echo ""; - + echo "wwwroot/user/view.php?id=$user->id&course=$course->id\">$fullname
"; + echo "".get_string("lastedited").": ".userdate($comment->timemodified).""; + echo "

cellcontent\" class=\"forumpostmessage\">\n"; + echo "
cellcontent2\" class=\"forumpostside\" width=\"10\">"; + echo " "; + echo "cellcontent\" class=\"forumpostmessage\">\n"; echo format_text($comment->comment, $comment->format); - echo "

"; - - echo "

"; - echo "

"; if ( (time() - $comment->timemodified < $CFG->maxeditingtime and $USER->id == $comment->userid) or isteacher($course->id) ) { - echo "id&eid=$entry->id&cid=$comment->id&action=edit\">\"" "; + echo "id&eid=$entry->id&cid=$comment->id&action=edit\">\"" "; } if ( $USER->id == $comment->userid or isteacher($course->id) ) { - echo "id&eid=$entry->id&cid=$comment->id&action=delete\">\"""; + echo "id&eid=$entry->id&cid=$comment->id&action=delete\">\"""; } echo "

"; -- 2.39.5