# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/mod/glossary/filter.php
--- moodle/mod/glossary/filter.php Base (1.41)
+++ moodle/mod/glossary/filter.php Locally Modified (Based On 1.41)
@@ -135,7 +135,7 @@
 
                 //attach the onclick event
                 $link = '/mod/glossary/showentry.php?courseid='.$courseid.'\&amp;concept='.$encodedconcept;
-                $action = new popup_action('click', $link, 'entry', array('height'=>600,'width'=>450));
+                $action = new popup_action('click', $link.'&popup=1', 'entry', array('height'=>600,'width'=>450));
                 $OUTPUT->add_action_handler($action, $randid);
             }
 
Index: moodle/mod/glossary/formats/entrylist/entrylist_format.php
--- moodle/mod/glossary/formats/entrylist/entrylist_format.php Base (1.22)
+++ moodle/mod/glossary/formats/entrylist/entrylist_format.php Locally Modified (Based On 1.22)
@@ -12,10 +12,10 @@
     if ($entry) {
         glossary_print_entry_approval($cm, $entry, $mode);
 
-        $anchortagcontents = glossary_print_entry_concept($entry);
+        $anchortagcontents = glossary_print_entry_concept($entry, true);
 
         $link = "/mod/glossary/showentry.php?courseid={$course->id}&eid={$entry->id}&displayformat=dictionary";
-        $action = new popup_action('click', $link, 'entry',array('title'=>'entry','width'=>600,'height'=>450));
+        $action = new popup_action('click', $link.'&popup=1', 'entry',array('title'=>'entry','width'=>600,'height'=>450));
 
         $anchor = $OUTPUT->action_link($link, $anchortagcontents, $action);
 
Index: moodle/mod/glossary/lib.php
--- moodle/mod/glossary/lib.php Base (1.305)
+++ moodle/mod/glossary/lib.php Locally Modified (Based On 1.305)
@@ -862,7 +862,7 @@
  * Print glossary concept/term as a heading &lt;h3>
  * @param object $entry
  */
-function  glossary_print_entry_concept($entry) {
+function  glossary_print_entry_concept($entry, $return=false) {
     global $OUTPUT;
     $options = new object();
     $options->para = false;
@@ -870,8 +870,13 @@
     if (!empty($entry->highlight)) {
         $text = highlight($entry->highlight, $text);
     }
+
+    if ($return) {
+        return $text;
+    } else {
     echo $text;
 }
+}
 
 /**
  *
Index: moodle/mod/glossary/showentry.php
--- moodle/mod/glossary/showentry.php Base (1.53)
+++ moodle/mod/glossary/showentry.php Locally Modified (Based On 1.53)
@@ -7,6 +7,7 @@
 $courseid = optional_param('courseid', 0, PARAM_INT);
 $eid      = optional_param('eid', 0, PARAM_INT); // glossary entry id
 $displayformat = optional_param('displayformat',-1, PARAM_SAFEDIR);
+$popup = optional_param('popup',0, PARAM_INT);
 
 $url = new moodle_url('/mod/glossary/showentry.php');
 $url->param('concept', $concept);
@@ -21,7 +22,7 @@
 
 if ($eid) {
     $entry = $DB->get_record('glossary_entries', array('id'=>$eid), '*', MUST_EXIST);
-    $glossary = $DB->get_record('glossary', 'id', array($entry->glossaryid), '*', MUST_EXIST);
+    $glossary = $DB->get_record('glossary', array('id'=>$entry->glossaryid), '*', MUST_EXIST);
     $cm = get_coursemodule_from_instance('glossary', $glossary->id, 0, false, MUST_EXIST);
     $course = $DB->get_record('course', array('id'=>$cm->course), '*', MUST_EXIST);
     require_course_login($course, true, $cm);
@@ -82,7 +83,9 @@
     glossary_print_dynaentry($courseid, $entries, $displayformat);
 }
 
+if ($popup) {
 echo $OUTPUT->close_window_button();
+}
 
 /// Show one reduced footer
 echo $OUTPUT->footer();
Index: moodle/mod/glossary/view.php
--- moodle/mod/glossary/view.php Base (1.170)
+++ moodle/mod/glossary/view.php Locally Modified (Based On 1.170)
@@ -466,9 +466,6 @@
             }
         }
 
-        $concept = $entry->concept;
-        $definition = $entry->definition;
-
         /// highlight the term if necessary
         if ($mode == 'search') {
             //We have to strip any word starting by + and take out words starting by -
