From ea16f9b2dc9ba52193f1691a18c3157d3ae40382 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sun, 15 Jul 2007 22:27:16 +0000 Subject: [PATCH] Now the glossary->allowcoments setting is respected. MDL-8056 Credit goes to Matt Clarkson. Thanks. Merged from MOODLE_18_STABLE --- mod/glossary/comment.php | 3 ++- mod/glossary/lib.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/glossary/comment.php b/mod/glossary/comment.php index 99c423a868..3a0f76249c 100644 --- a/mod/glossary/comment.php +++ b/mod/glossary/comment.php @@ -47,7 +47,8 @@ function glossary_comment_add() { require_login($course->id, false, $cm); $context = get_context_instance(CONTEXT_MODULE, $cm->id); - if (!$glossary->allowcomments and !has_capability('mod/glossary:comment', $context)) { + /// Both the configuration and capability must allow comments + if (!$glossary->allowcomments or !has_capability('mod/glossary:comment', $context)) { error('You can\'t add comments to this glossary!'); } diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 07b5a21651..2793d9ba14 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -833,7 +833,7 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h } $return .= glossary_print_entry_commentslink($course, $cm, $glossary, $entry,$mode,$hook,'html'); - if (has_capability('mod/glossary:comment', $context)) { + if (has_capability('mod/glossary:comment', $context) and $glossary->allowcomments) { $output = true; $return .= ' '.get_string('addcomment','glossary').''; } -- 2.39.5