mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Now the glossary->allowcoments setting is respected. MDL-8056
Credit goes to Matt Clarkson. Thanks. Merged from MOODLE_18_STABLE
This commit is contained in:
parent
8ce0363638
commit
ea16f9b2dc
2 changed files with 3 additions and 2 deletions
|
@ -47,7 +47,8 @@ function glossary_comment_add() {
|
||||||
|
|
||||||
require_login($course->id, false, $cm);
|
require_login($course->id, false, $cm);
|
||||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
$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!');
|
error('You can\'t add comments to this glossary!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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');
|
$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;
|
$output = true;
|
||||||
$return .= ' <a title="' . get_string('addcomment','glossary') . '" href="comment.php?action=add&eid='.$entry->id.'"><img src="comment.gif" class="iconsmall" alt="'.get_string('addcomment','glossary').'" /></a>';
|
$return .= ' <a title="' . get_string('addcomment','glossary') . '" href="comment.php?action=add&eid='.$entry->id.'"><img src="comment.gif" class="iconsmall" alt="'.get_string('addcomment','glossary').'" /></a>';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue