From e73bfa2d73ed7162de210c5ef4fe291136c55e1b Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Mon, 23 Oct 2006 03:23:09 +0000 Subject: [PATCH] merged replacing studentcanpost with proper capability --- blocks/glossary_random/block_glossary_random.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blocks/glossary_random/block_glossary_random.php b/blocks/glossary_random/block_glossary_random.php index eb2dbb55a1..8aed12eb66 100644 --- a/blocks/glossary_random/block_glossary_random.php +++ b/blocks/glossary_random/block_glossary_random.php @@ -169,7 +169,6 @@ class block_glossary_random extends block_base { // place link to glossary in the footer if the glossary is visible $glossaryid = $this->config->glossary; $glossary=get_record('glossary', 'id', $glossaryid); - $studentcanpost = $glossary->studentcanpost; //needed to decide on which footer //Create a temp valid module structure (course,id) $tempmod->course = $this->course->id; @@ -178,7 +177,7 @@ class block_glossary_random extends block_base { //Obtain the visible property from the instance if (instance_is_visible('glossary', $tempmod)) { $cm = get_coursemodule_from_instance('glossary',$glossaryid, $this->course->id) ; - if ($studentcanpost) { + if (has_capability('mod/glossary:write', get_context_instance(CONTEXT_MODULE, $cm->id))) { $this->content->footer = ''.$this->config->addentry.'
'; } else { -- 2.39.5