diff --git a/mod/glossary/comment.html b/mod/glossary/comment.html index 922baab32bb..e8571c6e1aa 100644 --- a/mod/glossary/comment.html +++ b/mod/glossary/comment.html @@ -1,9 +1,4 @@ - -
- - - diff --git a/mod/glossary/comment.php b/mod/glossary/comment.php index 67a14bbe8ea..7f57a2df00d 100644 --- a/mod/glossary/comment.php +++ b/mod/glossary/comment.php @@ -3,39 +3,39 @@ /// This page prints a particular instance of glossary require_once("../../config.php"); require_once("lib.php"); - + require_variable($id); // Course Module ID require_variable($eid); // Entry ID optional_variable($cid,0); // Comment ID optional_variable($action,"add"); // Action to perform optional_variable($confirm,0); // Confirm the action - + $action = strtolower($action); - - global $THEME, $USER, $CFG; - + + global $THEME, $USER, $CFG; + if (! $cm = get_record("course_modules", "id", $id)) { error("Course Module ID was incorrect"); } - + if (! $course = get_record("course", "id", $cm->course)) { error("Course is misconfigured"); } - + if (! $glossary = get_record("glossary", "id", $cm->instance)) { error("Course module is incorrect"); } - - if (! $entry = get_record("glossary_entries", "id", $eid)) { - error("Entry is incorrect"); - } - - if ( $cid ) { - if (! $comment = get_record("glossary_comments", "id", $cid)) { - error("Comment is incorrect"); - } - } + + if (! $entry = get_record("glossary_entries", "id", $eid)) { + error("Entry is incorrect"); + } + + if ( $cid ) { + if (! $comment = get_record("glossary_comments", "id", $cid)) { + error("Comment is incorrect"); + } + } require_login($course->id); if (!$cm->visible and !isteacher($course->id)) { @@ -45,12 +45,12 @@ error("Guests are not allowed to post comments", $_SERVER["HTTP_REFERER"]); } add_to_log($course->id, "glossary", "view", "view.php?id=$cm->id", "$glossary->id"); - -/// Printing the page header + + /// Printing the page header if ($course->category) { $navigation = "id\">$course->shortname ->"; } - + switch ( $action ){ case "add": $straction = get_string("addingcomment","glossary"); @@ -61,51 +61,20 @@ case "delete": $straction = get_string("deletingcomment","glossary"); break; - } + } $strglossaries = get_string("modulenameplural", "glossary"); $strglossary = get_string("modulename", "glossary"); $strcomments = get_string("comments", "glossary"); print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname", - "$navigation id>$strglossaries -> id>$glossary->name -> id&eid=$entry->id>$strcomments -> " . $straction, - "", "", true, update_module_button($cm->id, $course->id, $strglossary), - navmenu($course, $cm)); - - print_heading($glossary->name); - -/// Info boxes - - if ( $glossary->intro ) { - print_simple_box(format_text($glossary->intro), "center","70%"); - echo ""; - echo "
";
- echo "
| |||
";
- if ($entry->attachment) {
- $entry->course = $course->id;
- echo "
| ";
- echo "
"; - echo "
| cellheading\">";
- $user = get_record("user", "id", $comment->userid);
- $strby = get_string("writtenby","glossary");
+ glossary_print_comment($course, $cm, $glossary, $entry, $comment);
- print_user_picture($user->id, $course->id, $user->picture);
- echo " $strby $user->firstname $user->lastname"; - echo " (".get_string("lastedited").": ".userdate($comment->timemodified).")"; + print_simple_box_start("center","40%", "#FFBBBB"); + echo " " . get_string("areyousuredeletecomment","glossary"); + ?> + | cellcontent\">"; - echo format_text($comment->comment, $comment->format); - echo " |
"; - - print_simple_box_start("center","40%", "#FFBBBB"); - echo "