From: willcast Date: Tue, 18 Nov 2003 03:25:28 +0000 (+0000) Subject: - Adding View comments link to the new display format X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a0d1e2bba7354631771012c08f47cb12ced4cc1f;p=moodle.git - Adding View comments link to the new display format --- diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index e5ac29b965..7a7a2b479e 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -403,21 +403,14 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry,$mode="",$ho $ismainglossary = $glossary->mainglossary; $return = ""; - if (!$entry->approved) { $return .= get_string("entryishidden","glossary"); } - $count = count_records("glossary_comments","entryid",$entry->id); - if ($count) { - $return .= " id&eid=$entry->id\">$count "; - if ($count == 1) { - $return .= get_string("comment", "glossary"); - } else { - $return .= get_string("comments", "glossary"); - } - $return .= ""; - } - $return .= ""; + $return .= " "; + + $return .= glossary_print_entry_commentslink($course, $cm, $glossary, $entry,$mode,$hook); + + if ( $glossary->allowcomments and !isguest()) { $return .= " id&eid=$entry->id\"> "; } @@ -458,6 +451,29 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry,$mode="",$ho } } +function glossary_print_entry_commentslink($course, $cm, $glossary, $entry,$mode,$hook, $type = 'print') { + $return = ''; + + $count = count_records("glossary_comments","entryid",$entry->id); + if ($count) { + $return = ""; + $return .= "id&eid=$entry->id\">$count "; + if ($count == 1) { + $return .= get_string("comment", "glossary"); + } else { + $return .= get_string("comments", "glossary"); + } + $return .= ""; + $return .= ""; + } + + if ($type == 'print') { + echo $return; + } else { + return $return; + } +} + function glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook,$printicons) { $aliases = glossary_print_entry_aliases($course, $cm, $glossary, $entry, $mode, $hook,"html");