]> git.mjollnir.org Git - moodle.git/commitdiff
Simplification of the comments page and more forum-like comments
authormoodler <moodler>
Wed, 10 Dec 2003 16:06:06 +0000 (16:06 +0000)
committermoodler <moodler>
Wed, 10 Dec 2003 16:06:06 +0000 (16:06 +0000)
mod/glossary/comments.php
mod/glossary/lib.php

index b3c22b00745cef40fa4fe71902f589bda265f976..8597bc2d5c56e9e388c94c3285b450fe9dbeccfb 100644 (file)
     $strsearch = get_string("search");
     
     print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname",
-        "$navigation <A HREF=index.php?id=$course->id>$strglossaries</A> -> <A HREF=view.php?id=$cm->id>$glossary->name</a> -> " . get_string("comments","glossary"),
+        "$navigation <A HREF=index.php?id=$course->id>$strglossaries</A> -> <A HREF=view.php?id=$cm->id>$glossary->name</a> -> $entry->concept",
         "", "", true, update_module_button($cm->id, $course->id, $strglossary),
         navmenu($course, $cm));
     
-    print_heading($glossary->name);
+/// original glossary entry
 
-/// Info boxes
+    echo "<center>";
+    glossary_print_entry($course, $cm, $glossary, $entry, "", "", false);
+    echo "</center>";
 
-    if ( $glossary->intro ) {
-           print_simple_box_start("center","70%");
-        echo '<p>';
-        echo $glossary->intro;
-        echo '</p>';
-        print_simple_box_end();
-    }
+/// comments
 
-    echo "<p align=center>";
-    echo "<table class=\"generalbox\" width=\"70%\" align=\"center\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">";
-       echo "<tr bgcolor=$THEME->cellheading2><td align=center>";
-           echo "<table border=0 width=100%><tr><td width=33%></td><td width=33% align=center>";
-           echo get_string("commentson","glossary") . ' <b>' . glossary_print_entry_concept($entry) . '</b></td>';
-           echo "<td width=33% align=right>";  
-        if ( $glossary->allowcomments ) {      
-            echo "<a href=\"comment.php?id=$cm->id&eid=$entry->id\"><img  alt=\"" . get_string("addcomment","glossary") . "\" src=\"comment.gif\" height=11 width=11 border=0></a> ";
-        }
-           echo "</td></tr></table>";
-                       
-       echo "</td></tr>";
-    echo "<tr><TD WIDTH=100% BGCOLOR=\"#FFFFFF\">";
-    if ($entry->attachment) {
-          $entry->course = $course->id;
-          echo "<table border=0 align=right><tr><td>";
-          echo glossary_print_attachments($entry,"html");
-          echo "</td></tr></table>";
+    $strheading = get_string('commentson','glossary')." <b>\"$entry->concept\"</b>";
+    if ($glossary->allowcomments) {    
+        $strheading .= "&nbsp;&nbsp;<a href=\"comment.php?id=$cm->id&eid=$entry->id\"><img title=\"" . get_string("addcomment","glossary") . "\" src=\"comment.gif\" height=11 width=11 border=0></a> ";
     }
-    echo "<b>$entry->concept</b>: ";
-    glossary_print_entry_definition($entry);
-    echo "</td>";
-    echo "</TR></table>";
 
-/// comments
-    $comments = get_records("glossary_comments","entryid",$entry->id,"timemodified ASC");
-    if ( !$comments ) {
-        echo "<p align=center><strong>" .  get_string("nocomments","glossary") . "</string>";
-    } else {
+    print_heading($strheading);
+
+    if ($comments = get_records("glossary_comments","entryid",$entry->id,"timemodified ASC")) {
         foreach ($comments as $comment) {
-                   echo "<p align=center>";
                    glossary_print_comment($course, $cm, $glossary, $entry, $comment);
+            echo '<br />';
         }
+    } else {
+        print_heading(get_string("nocomments","glossary"));
     }
 
 /// Finish the page
+
     print_footer($course);
+
 ?>
index dd862ce1566aed9eef6bb16e10520377cac75a37..ee26b9db8632db838d99dba6c941f1c51df93566 100644 (file)
@@ -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 '<table border="0" width="70%" cellpadding="3" cellspacing="0" class="forumpost">';
-    echo "<tr>";
-
     $fullname = fullname($user, isteacher($course->id));
 
+    echo '<table align="center" border="0" width="70%" cellpadding="3" cellspacing="0" class="forumpost">';
+    echo "<tr>";
+    echo "<tr><td bgcolor=\"$THEME->cellcontent2\" class=\"forumpostpicture\" width=\"35\" valign=\"top\">";
+    print_user_picture($user->id, $course->id, $user->picture);
+    echo "</td>";
     echo "<td bgcolor=\"$THEME->cellheading\" class=\"forumpostheader\" width=\"100%\">";
     echo "<p>";
-    print_user_picture($user->id, $course->id, $user->picture);
-    echo "<font size=3>&nbsp;<b>$fullname</b></font><br \>";
-    echo "<FONT SIZE=1>&nbsp;&nbsp;&nbsp;(".get_string("lastedited").": ".userdate($comment->timemodified).")</FONT></small>";
-    echo "<font size=2>";
-
+    echo "<font size=2><a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id\">$fullname</a></font><br \>";
+    echo "<font size=1>".get_string("lastedited").": ".userdate($comment->timemodified)."</font>";
+    echo "</p></td></tr>";
 
-    echo "</font></p></td></tr>";
-    echo "<tr><td bgcolor=\"$THEME->cellcontent\" class=\"forumpostmessage\">\n";
+    echo "<tr><td bgcolor=\"$THEME->cellcontent2\" class=\"forumpostside\" width=\"10\">";
+    echo "&nbsp;";
+    echo "</td><td bgcolor=\"$THEME->cellcontent\" class=\"forumpostmessage\">\n";
 
     echo format_text($comment->comment, $comment->format);
 
-    echo "<p align=right><font size=-1>";
-
-    echo "</p>";
-
     echo "<div align=right><p align=right>";
     if ( (time() - $comment->timemodified <  $CFG->maxeditingtime and $USER->id == $comment->userid)  or isteacher($course->id) ) {
-        echo "<a href=\"comment.php?id=$cm->id&eid=$entry->id&cid=$comment->id&action=edit\"><img  alt=\"" . get_string("edit") . "\" src=\"../../pix/t/edit.gif\" height=11 width=11 border=0></a> ";
+        echo "<a href=\"comment.php?id=$cm->id&eid=$entry->id&cid=$comment->id&action=edit\"><img  
+               alt=\"" . get_string("edit") . "\" src=\"../../pix/t/edit.gif\" height=11 width=11 border=0></a> ";
     }
     if ( $USER->id == $comment->userid or isteacher($course->id) ) {
-        echo "<a href=\"comment.php?id=$cm->id&eid=$entry->id&cid=$comment->id&action=delete\"><img  alt=\"" . get_string("delete") . "\" src=\"../../pix/t/delete.gif\" height=11 width=11 border=0></a>";
+        echo "<a href=\"comment.php?id=$cm->id&eid=$entry->id&cid=$comment->id&action=delete\"><img  
+               alt=\"" . get_string("delete") . "\" src=\"../../pix/t/delete.gif\" height=11 width=11 border=0></a>";
     }
     
     echo "</p>";