diff --git a/mod/glossary/filter.php b/mod/glossary/filter.php index c6db911f3f7..a812b6c8112 100644 --- a/mod/glossary/filter.php +++ b/mod/glossary/filter.php @@ -1,7 +1,15 @@ glossaryid]; - if ($concept->category) { // Link to a category $title = strip_tags($glossaryname.': '.$strcategory.' '.$concept->concept); $href_tag_begin = 'concept); $title = str_replace('"', "'", strip_tags($glossaryname.': '.$concept->concept)); } - $randid = html_writer::random_id($title); - $href_tag_begin = ''; - - //attach the onclick event - $link = '/mod/glossary/showentry.php?courseid='.$courseid.'\&concept='.$encodedconcept; - $action = new popup_action('click', $link.'&popup=1', 'entry', array('height'=>600,'width'=>450)); - $OUTPUT->add_action_handler($action, $randid); + $randid = html_writer::random_id('glossary'); + $link = new moodle_url('/mod/glossary/showentry.php', array('courseid'=>$courseid, 'concept'=>$encodedconcept)); + $href_tag_begin = html_writer::start_tag('a', array( + 'href'=>$link, + 'id'=>$randid, + 'title'=>$title, + 'class'=>'glossary autolink glossaryid'.$concept->glossaryid)); + //attach the onclick events + $OUTPUT->add_action_handler(new popup_action('click', new moodle_url($link, array('popup'=>'1')), 'entry', array('height'=>600,'width'=>450)), $randid); } - - $conceptlist[] = new filterobject($concept->concept, $href_tag_begin, '', $concept->casesensitive, $concept->fullmatch); } @@ -147,7 +152,6 @@ function glossary_filter($courseid, $text) { $conceptlist = filter_remove_duplicates($conceptlist); } - global $GLOSSARY_EXCLUDECONCEPTS; if(!empty($GLOSSARY_EXCLUDECONCEPTS)) { $reducedconceptlist=array(); foreach($conceptlist as $concept) {