Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

- Implementing output text filters for glossary entries

    dynalink.php::glossary_dynamic_link($courseid, $text, $glossaryid = NULL)
  • Loading branch information...
commit 466ea2349aceb6905618d875776696c1172e1be0 1 parent 0585509
authored September 29, 2003
66  mod/glossary/dynalink.php
... ...
@@ -0,0 +1,66 @@
38  mod/glossary/showentry.php
... ...
@@ -0,0 +1,38 @@
  1
+<?PHP
  2
+    require_once("../../config.php");
  3
+    require_once("lib.php");
  4
+
  5
+    require_variable($courseid);
  6
+    require_variable($eid);  // entry id
  7
+
  8
+    $entry = get_record("glossary_entries","id",$eid);
  9
+
  10
+    print_header();
  11
+    
  12
+    glossary_show_entry($courseid, $entry);
  13
+    
  14
+    close_window_button();
  15
+
  16
+    function glossary_show_entry($courseid, $entry) {
  17
+        global $THEME, $USER;
  18
+
  19
+        $colour = $THEME->cellheading2;
  20
+
  21
+        echo "\n<center><table width=95% border=0><TR>";
  22
+        echo "<TD WIDTH=100% BGCOLOR=\"#FFFFFF\">";
  23
+        if ($entry->attachment) {
  24
+            $entry->course = $courseid;
  25
+            echo "<table border=0 align=right><tr><td>";
  26
+            echo glossary_print_attachments($entry,"html");
  27
+            echo "</td></tr></table>";
  28
+        }
  29
+        echo "<b>$entry->concept</b>: ";
  30
+        echo format_text($entry->definition, $entry->format);
  31
+        echo "</td>";
  32
+        echo "</TR></table></center>";
  33
+    }
  34
+
  35
+?>
  36
+</body>
  37
+</html>
  38
+
9  mod/glossary/view.php
@@ -4,6 +4,7 @@
4 4
 
5 5
     require_once("../../config.php");
6 6
     require_once("lib.php");
  7
+    require_once("dynalink.php");
7 8
 
8 9
     require_variable($id);    // Course Module ID, or
9 10
 
@@ -242,9 +243,13 @@
242 243
 	                 }
243 244
                  }
244 245
                  if ($search) {
245  
-                       $entry->concept = highlight($search,$concept);
246  
-                       $entry->definition = highlight($search,$definition);
  246
+                     $entry->concept = highlight($search,$concept);
  247
+                     $entry->definition = highlight($search,$definition);
247 248
                  }
  249
+                 if ( !glossary->mainglossary ) {
  250
+                     $entry->definition = glossary_dynamic_link($course->id,$definition);
  251
+                 }
  252
+                 
248 253
 	             glossary_print_entry($course, $cm, $glossary, $entry,$currentview,$cat);
249 254
 
250 255
                  if ( $glossary->displayformat != 0 ) {

0 notes on commit 466ea23

Please sign in to comment.
Something went wrong with that request. Please try again.