]> git.mjollnir.org Git - moodle.git/commitdiff
Slight change to glossary_print_entry_icons so that
authormoodler <moodler>
Thu, 16 Oct 2003 05:41:35 +0000 (05:41 +0000)
committermoodler <moodler>
Thu, 16 Oct 2003 05:41:35 +0000 (05:41 +0000)
"comments" link isn't printed if comments are disabled

mod/glossary/lib.php

index 08279b094de08769484d34635cd0a170d3713b33..c810c8dcab6c608a7b5db6f00871ede1ab21c3f0 100644 (file)
@@ -235,13 +235,16 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry,$currentview
     $isteacher = isteacher($course->id);
     $ismainglossary = $glossary->mainglossary;
     
-    echo "<table width=100% border=0><tr><td>";
+    echo "<table width=100% border=0><tr>";
         
-    $count = count_records("glossary_comments","entryid",$entry->id);
-    echo "<a href=\"comments.php?id=$cm->id&eid=$entry->id\">$count " . get_string("comments","glossary") . "</a>";
-    echo "</td><td align=\"right\">";
     if ( $glossary->allowcomments ) {
+        echo "<td>";
+        $count = count_records("glossary_comments","entryid",$entry->id);
+        echo "<a href=\"comments.php?id=$cm->id&eid=$entry->id\">$count " . get_string("comments","glossary") . "</a>";
+        echo "</td><td align=\"right\">";
         echo "<a href=\"comment.php?id=$cm->id&eid=$entry->id\"><img  alt=\"" . get_string("addcomment","glossary") . "\" src=\"comment.gif\" height=16 width=16 border=0></a> ";
+    } else {
+        echo "<td align=\"right\">";
     }
        
     if ($isteacher or $glossary->studentcanpost and $entry->userid == $USER->id) {