$mod_glossary_capabilities = array(
- 'mod/glossary:view' => array(
-
- 'captype' => 'read',
- 'contextlevel' => CONTEXT_MODULE,
- 'legacy' => array(
- 'guest' => CAP_ALLOW,
- 'student' => CAP_ALLOW,
- 'teacher' => CAP_ALLOW,
- 'editingteacher' => CAP_ALLOW,
- 'coursecreator' => CAP_ALLOW,
- 'admin' => CAP_ALLOW
- )
- ),
-
'mod/glossary:write' => array(
'riskbitmask' => RISK_SPAM,
require_login($course->id, false, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
- require_capability('mod/glossary:view', $context);
$manageentries = has_capability('mod/glossary:manageentries', $context);
if (! $glossary = get_record("glossary", "id", $cm->instance)) {
$table->align = array ("LEFT", "CENTER");
}
- $can_subscribe = has_capability('mod/glossary:view', $context);
-
- if ($show_rss = (($can_subscribe || $course->id == SITEID) &&
- isset($CFG->enablerssfeeds) && isset($CFG->glossary_enablerssfeeds) &&
+ if ($show_rss = (isset($CFG->enablerssfeeds) && isset($CFG->glossary_enablerssfeeds) &&
$CFG->enablerssfeeds && $CFG->glossary_enablerssfeeds)) {
$table->head[] = $strrss;
$table->align[] = "CENTER";
$currentsection = "";
foreach ($glossarys as $glossary) {
- if (!$glossary->visible) {
- //Show dimmed if the mod is hidden
+ if (!$glossary->visible && has_capability('moodle/course:viewhiddenactivities', $context)) {
+ // Show dimmed if the mod is hidden.
$link = "<a class=\"dimmed\" href=\"view.php?id=$glossary->coursemodule\">".format_string($glossary->name,true)."</a>";
- } else {
- //Show normal if the mod is visible
+ } else if ($glossary->visible) {
+ // Show normal if the mod is visible.
$link = "<a href=\"view.php?id=$glossary->coursemodule\">".format_string($glossary->name,true)."</a>";
+ } else {
+ // Don't show the glossary.
+ continue;
}
$printsection = "";
if ($glossary->section !== $currentsection) {
print_footer($course);
-?>
+?>
\ No newline at end of file
}
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
- require_capability('mod/glossary:view', $context); // kill the page if user can't even read
if ($CFG->forcelogin) {
require_login();
print_footer($course);
-?>
+?>
\ No newline at end of file