Skip to content

Commit

Permalink
replacing studentcanpost with proper capability
Browse files Browse the repository at this point in the history
  • Loading branch information
toyomoyo committed Oct 23, 2006
1 parent 1752044 commit 9fc4804
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions blocks/glossary_random/block_glossary_random.php
Expand Up @@ -169,7 +169,6 @@ function get_content() {
// 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;
Expand All @@ -178,7 +177,7 @@ function get_content() {
//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 = '<a href="'.$CFG->wwwroot.'/mod/glossary/edit.php?id='.$cm->id
.'" title="'.$this->config->addentry.'">'.$this->config->addentry.'</a><br />';
} else {
Expand Down

0 comments on commit 9fc4804

Please sign in to comment.