Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

- Adding two more display formats: Continuous and FAQ

- Fixed bug 818: Adding a new view: Sorted (by creation date or by last modified.
  • Loading branch information...
commit 767a31c3bc21adb239e2ac891ea202d1c20c6467 1 parent 7069af6
authored October 19, 2003
11  lang/en/glossary.php
@@ -8,8 +8,10 @@
8 8
 $string['allowcomments'] = "Allow comments on entries";
9 9
 $string['allowduplicatedentries'] = "Duplicated entries allowed";
10 10
 $string['alphabet'] = "A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z";
  11
+$string['answer'] = "Answer";
11 12
 $string['areyousuredelete'] = "Are you sure you want to delete this entry?";
12 13
 $string['areyousuredeletecomment'] = "Are you sure you want to delete this comment?";
  14
+$string['ascending'] = "(ascending)";
13 15
 $string['attachment'] = "Attachment";
14 16
 $string['back'] = "Back";
15 17
 $string['casesensitive'] = "This entry is<br>case sensitive";
@@ -29,11 +31,14 @@
29 31
 $string['definitions'] = "Definitions";
30 32
 $string['deleteentry'] = "Delete entry";
31 33
 $string['deletingnoneemptycategory'] = "Deleting this category will not delete the entries it contains - they will be marked as uncategorised.";
  34
+$string['descending'] = "(descending)";
32 35
 $string['displayformat'] = "Display format";
33 36
 $string['displayformatdefault'] = "Simple, dictionary style";
34  
-$string['displayformat1'] = "Full without author";
  37
+$string['displayformatcontinuous']  = "Continuous without author";
35 38
 $string['displayformat2']  = "Full with author";
36 39
 $string['displayformat3']  = "Encyclopedia";
  40
+$string['displayformat4']  = "FAQ";
  41
+$string['displayformat5'] = "Full without author";
37 42
 $string['editcategories'] = "Edit categories";
38 43
 $string['editentry'] = "Edit entry";
39 44
 $string['editingcomment'] = "Editing comment";
@@ -61,12 +66,16 @@
61 66
 $string['nocomments'] = "(No comments found on this entry)";
62 67
 $string['noentries'] = "No entries found in this section";
63 68
 $string['noentry'] = "No entry found.";
  69
+$string['question'] = "Question";
64 70
 $string['searchindefinition'] = "Search definitions too";
65 71
 $string['secondaryglossary'] = "Secondary glossary";
66 72
 $string['showspecial'] = "Show 'Special' link";
67 73
 $string['showalphabet'] = "Show alphabet";
68 74
 $string['showall'] = "Show 'ALL' link";
69 75
 $string['special'] = "Special";
  76
+$string['sortchronogically'] = "Sort chronologically";
  77
+$string['sortbycreation'] = "By creation date";
  78
+$string['sortbylastupdate'] = "By last update";
70 79
 $string['standardview'] = "Browse by alphabet";
71 80
 $string['studentcanpost'] = "Students can add entries";
72 81
 $string['usedynalink'] = "Link this glossary with other modules automatically";
23  lang/en/help/glossary/displayformat.html
... ...
@@ -1,10 +1,19 @@
1 1
 <P ALIGN=CENTER><B>Display format</B></P>
2 2
 
3  
-<P>The system has three built-in formats to display entries. You can create your own format if you want.
4  
-<p>The default view is quite simple. It looks like a conventional dictionary.
5  
-<p>The second view shows the entry in a forum-like format, without the author's data.
6  
-<p>And the third one shows the entry also in a forum-like format but with the author's data.
  3
+<P>This setting specify the way the entries will be shown within the glossary. The system has two built-in formats: Default and continuous. 
  4
+<ul>
  5
+<il>The default view is simple. It looks like a conventional dictionary. No author. Attachment are shown as links.</il>
  6
+<il>Continuous shows the entries one after other without any kind of separation but the editing icons.</il>
  7
+</ul>
  8
+<p>Also, there are three more display formats:
  9
+<ul>
  10
+<il>Full with Author: A forum-like display format showing author's data. Attachments are shown as links.</il>
  11
+<il>Encyclopedia: Quite like Full with Author but shows the attached images inline.</il>
  12
+<il>FAQ: A sort of FAQ. It automatically appends the words QUESTION and ANSWER in the concepto and definition respectivelly.</il>
  13
+<il>Full without Author: A forum-like display format that does not show author's data. Attachments are shown as links.</il>
  14
+</ul>
  15
+
7 16
 <hr>
8  
-<p>If you want to create your own format, you should create a .PHP file and give it a number as its name. See into mod/glossary/formats which should be the next number.
9  
-<p>Then, create a funcion called <b>glossary_print_entry_by_format($course, $cm, $glossary, $entry)</b> and dump all your creativity.
10  
-<p>The last stemp is to insert a new entry in every language pack you use called <b>displayformat[number]</b>, and give it a meaningful description.
  17
+<p>If you want to create your own format, you should create a .PHP file and give it a number as its name. See into mod/glossary/formats which should be the next number. Note that numbers 0 and 1 are reserved.
  18
+<p>Then, create a function called <b>glossary_print_entry_by_format($course, $cm, $glossary, $entry)</b> and dump all your creativity on it.
  19
+<p>The last step is to insert a new entry in every language pack you use called <b>displayformat[number]</b>, and give it a short but meaningful description.
5  mod/glossary/db/mysql.php
@@ -104,6 +104,11 @@ function glossary_upgrade($oldversion) {
104 104
         execute_sql( "ALTER TABLE `{$CFG->prefix}glossary_entries` " .
105 105
                     "ADD `fullmatch`  TINYINT(2) UNSIGNED NOT NULL DEFAULT '1' AFTER `casesensitive` ");
106 106
     }
  107
+
  108
+    if ( $oldversion < 2003101800 ) {
  109
+        execute_sql( "UPDATE `{$CFG->prefix}glossary`" .
  110
+                    " SET displayformat = 5 WHERE displayformat = 1");
  111
+    }
107 112
     return true;
108 113
 }
109 114
 
104  mod/glossary/lib.php
@@ -10,6 +10,9 @@
10 10
 define("GLOSSARY_STANDARD_VIEW", 0);
11 11
 define("GLOSSARY_CATEGORY_VIEW", 1);
12 12
 
  13
+define("GLOSSARY_FORMAT_SIMPLE", 0);
  14
+define("GLOSSARY_FORMAT_CONTINUOUS", 1);
  15
+
13 16
 function glossary_add_instance($glossary) {
14 17
 /// Given an object containing all the necessary data,
15 18
 /// (defined by the form in mod.html) this function
@@ -189,7 +192,9 @@ function glossary_print_entry($course, $cm, $glossary, $entry, $currentview="",$
189 192
     $formatfile = "$CFG->dirroot/mod/glossary/formats/$glossary->displayformat.php";
190 193
     $functionname = "glossary_print_entry_by_format";
191 194
 
192  
-    if ( $glossary->displayformat > 0 ) {
  195
+    $basicformat = ($glossary->displayformat == GLOSSARY_FORMAT_SIMPLE or
  196
+                    $glossary->displayformat == GLOSSARY_FORMAT_CONTINUOUS);
  197
+    if ( !$basicformat ) {
193 198
         if ( file_exists($formatfile) ) {
194 199
            include_once($formatfile);
195 200
            if (function_exists($functionname) ) {
@@ -200,10 +205,17 @@ function glossary_print_entry($course, $cm, $glossary, $entry, $currentview="",$
200 205
        $permissiongranted = 1;
201 206
     }
202 207
     
203  
-    if ( $glossary->displayformat > 0 and $permissiongranted ) {
  208
+    if ( !$basicformat and $permissiongranted ) {
204 209
         glossary_print_entry_by_format($course, $cm, $glossary, $entry,$currentview,$cat);
205 210
     } else {
206  
-        glossary_print_entry_by_default($course, $cm, $glossary, $entry,$currentview,$cat);
  211
+        switch ( $glossary->displayformat ) {
  212
+            case GLOSSARY_FORMAT_SIMPLE:
  213
+                glossary_print_entry_by_default($course, $cm, $glossary, $entry,$currentview,$cat);
  214
+            break;
  215
+            case GLOSSARY_FORMAT_CONTINUOUS:
  216
+                glossary_print_entry_continuous($course, $cm, $glossary, $entry,$currentview,$cat);
  217
+            break;
  218
+        }
207 219
     }
208 220
 
209 221
 }
@@ -228,6 +240,21 @@ function glossary_print_entry_by_default($course, $cm, $glossary, $entry,$curren
228 240
     echo "</TR>";
229 241
 }
230 242
 
  243
+function glossary_print_entry_continuous($course, $cm, $glossary, $entry,$currentview="",$cat="") {
  244
+    global $THEME, $USER;
  245
+    if ($entry) {
  246
+        if ($entry->attachment) {
  247
+            $entry->course = $course->id;
  248
+            echo "<table border=0 align=right><tr><td>";
  249
+            echo glossary_print_attachments($entry, "html");
  250
+            echo "</td></tr></table>";
  251
+        }
  252
+        echo " $entry->concept ";
  253
+        echo format_text($entry->definition, $entry->format);
  254
+
  255
+        glossary_print_entry_icons($course, $cm, $glossary, $entry, $currentview, $cat);
  256
+    }
  257
+}
231 258
 function glossary_print_entry_icons($course, $cm, $glossary, $entry,$currentview="",$cat="") {
232 259
     global $THEME, $USER;
233 260
 
@@ -679,11 +706,14 @@ function glossary_print_tabbed_table_end() {
679 706
      echo "</center><p></td></tr></table></center>";
680 707
 }
681 708
 
682  
-function glossary_print_alphabet_menu($cm, $glossary, $l) {
  709
+function glossary_print_alphabet_menu($cm, $glossary, $l, $sortkey, $sortorder = "") {
683 710
 global $CFG, $THEME;
684  
-     $strselectletter = get_string("selectletter", "glossary");
685  
-     $strspecial      = get_string("special", "glossary");
686  
-     $strallentries   = get_string("allentries", "glossary");
  711
+     $strselectletter     = get_string("selectletter", "glossary");
  712
+     $strspecial          = get_string("special", "glossary");
  713
+     $strallentries       = get_string("allentries", "glossary");
  714
+     $strsort             = get_string("sortchronogically", "glossary");
  715
+     $strsortbycreation   = get_string("sortbycreation", "glossary");
  716
+     $strsortbylastupdate = get_string("sortbylastupdate", "glossary");
687 717
 
688 718
      if ($glossary->showalphabet) {
689 719
          $output .= get_string("explainalphabet","glossary").'<br />';
@@ -695,7 +725,7 @@ function glossary_print_alphabet_menu($cm, $glossary, $l) {
695 725
           if ( $l == "SPECIAL" ) {
696 726
                echo "<b>$strspecial</b> | ";
697 727
           } else {
698  
-               $strexplainspecial = get_string("explainspecial","glossary");
  728
+               $strexplainspecial = strip_tags(get_string("explainspecial","glossary"));
699 729
                echo "<a title=\"$strexplainspecial\" href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&l=SPECIAL\">$strspecial</a> | ";
700 730
           }
701 731
       }
@@ -704,7 +734,7 @@ function glossary_print_alphabet_menu($cm, $glossary, $l) {
704 734
            $alphabet = explode("|", get_string("alphabet","glossary"));
705 735
            $letters_by_line = 14;
706 736
            for ($i = 0; $i < count($alphabet); $i++) {
707  
-               if ( $l == $alphabet[$i] ) {
  737
+               if ( $l == $alphabet[$i] and $l) {
708 738
                     echo "<b>$alphabet[$i]</b>";
709 739
                } else {
710 740
                     echo "<a href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&l=$alphabet[$i]\">$alphabet[$i]</a>";
@@ -719,12 +749,62 @@ function glossary_print_alphabet_menu($cm, $glossary, $l) {
719 749
 
720 750
       if ( $glossary->showall ) {
721 751
           if ( $l == "ALL" ) {
722  
-               echo "<b>$strallentries</b></p>";
  752
+               echo "<b>$strallentries</b>";
723 753
           } else {
724  
-               $strexplainall = get_string("explainall","glossary");
725  
-               echo "<a title=\"$strexplainall\" href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&l=ALL\">$strallentries</a></p>";
  754
+               $strexplainall = strip_tags(get_string("explainall","glossary"));
  755
+               echo "<a title=\"$strexplainall\" href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&l=ALL\">$strallentries</a>";
726 756
           }
727 757
       }
  758
+      $neworder = "";
  759
+      if ( $sortorder ) {
  760
+          if ( $sortorder == "asc" ) {
  761
+              $neworder = "&sortorder=desc";
  762
+              $ordertitle = get_string("descending","glossary");
  763
+          } else {
  764
+              $neworder = "&sortorder=asc";
  765
+              $ordertitle = get_string("ascending","glossary");
  766
+          }
  767
+          $icon = " <img src=\"$sortorder.gif\" border=0 width=16 height=16>";
  768
+      } else {
  769
+          if ( $sortkey != "CREATION" and $sortkey != "UPDATE" ) {
  770
+              $icon = "";
  771
+              $ordertitle = get_string("ascending","glossary");
  772
+          } else {
  773
+              $ordertitle = get_string("descending","glossary");
  774
+              $neworder = "&sortorder=desc";
  775
+              $icon = " <img src=\"asc.gif\" border=0 width=16 height=16>";
  776
+          }
  777
+      }
  778
+      $cicon = "";
  779
+      $cneworder = "";
  780
+      $cbtag = "";
  781
+      $cendbtag = "";
  782
+
  783
+      $uicon = "";
  784
+      $uneworder = "";
  785
+      $ubtag = "";
  786
+      $uendbtag = "";
  787
+
  788
+      if ( $sortkey == "CREATION" ) {
  789
+          $cicon = $icon;
  790
+          $cneworder = $neworder;
  791
+          $cordertitle = $ordertitle;
  792
+          $uordertitle = get_string("ascending","glossary");
  793
+          $cbtag = "<b>";
  794
+          $cendbtag = "</b>";
  795
+      } elseif ($sortkey == "UPDATE") {
  796
+          $uicon = $icon;
  797
+          $uneworder = $neworder;
  798
+          $cordertitle = get_string("ascending","glossary");
  799
+          $uordertitle = $ordertitle;
  800
+          $ubtag = "<b>";
  801
+          $uendbtag = "</b>";
  802
+      } else {
  803
+          $cordertitle = get_string("ascending","glossary");
  804
+          $uordertitle = get_string("ascending","glossary");
  805
+      }
  806
+      echo "<br>$strsort: $ubtag<a title=\"$strsortbylastupdate $uordertitle\" href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&sortkey=UPDATE$uneworder\">$strsortbylastupdate$uicon</a>$uendbtag | ".
  807
+                           "$cbtag<a title=\"$strsortbycreation $cordertitle\" href=\"$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&sortkey=CREATION$cneworder\">$strsortbycreation$cicon</a>$cendbtag</p>";
728 808
 }
729 809
 function glossary_print_categories_menu($course, $cm, $glossary, $cat, $category) {
730 810
 global $CFG, $THEME;
29  mod/glossary/mod.html
@@ -144,6 +144,11 @@
144 144
       echo "selected";
145 145
    }
146 146
   ?>><?php echo get_string("displayformatdefault", "glossary") ?></option>
  147
+  <option value="1" <?php
  148
+   if ( $form->displayformat == 1) {
  149
+      echo "selected";
  150
+   }
  151
+  ?>><?php echo get_string("displayformatcontinuous", "glossary") ?></option>
147 152
 
148 153
 <?php
149 154
     global $CFG;
@@ -157,19 +162,19 @@
157 162
         if (filetype("$CFG->dirroot/mod/glossary/formats/$dir") == "dir") {
158 163
             continue;
159 164
         }
160  
-	  if ( $pos = strpos($dir, ".") ) {
161  
-		$dir = substr($dir, 0, $pos );
162  
-
163  
-	  	echo "<option value=\"$dir\" ";
164  
-	  	if ( $form->displayformat == $dir) {
165  
-      		echo "selected ";
166  
-	  	}
167  
-  	  	echo ">";
168  
-
169  
-	  	echo get_string("displayformat$dir", "glossary")."</option>";	
170  
-	  }
  165
+        if ( $pos = strpos($dir, ".") ) {
  166
+            $dir = substr($dir, 0, $pos );
  167
+            if ($dir != 0 and $dir != 1) {  // excluding basic formats
  168
+                echo "<option value=\"$dir\" ";
  169
+                if ( $form->displayformat == $dir) {
  170
+                    echo "selected ";
  171
+                }
  172
+                echo ">";
  173
+                echo get_string("displayformat$dir", "glossary")."</option>";	
  174
+            }
  175
+        }
171 176
     }
172  
-	
  177
+
173 178
 ?>
174 179
 
175 180
     </select> <?php helpbutton("displayformat", get_string("displayformat", "glossary"), "glossary") ?>
2  mod/glossary/version.php
@@ -5,7 +5,7 @@
5 5
 ///  This fragment is called by moodle_needs_upgrading() and /admin/index.php
6 6
 /////////////////////////////////////////////////////////////////////////////////
7 7
 
8  
-$module->version  = 2003101601;  // The current module version (Date: YYYYMMDDXX)
  8
+$module->version  = 2003101800;  // The current module version (Date: YYYYMMDDXX)
9 9
 $module->cron     = 0;           // Period for cron to check this module (secs)
10 10
 
11 11
 $release = "0.5 development";   // User-friendly version number
94  mod/glossary/view.php
@@ -5,14 +5,17 @@
5 5
     require_once("lib.php");
6 6
     
7 7
     require_variable($id);           // Course Module ID
8  
-    optional_variable($l);           // letter to look for
  8
+    optional_variable($l,"");           // letter to look for
9 9
     optional_variable($eid);         // Entry ID
10 10
     optional_variable($search, "");  // search string
11 11
     optional_variable($includedefinition); // include definition in search function?
12 12
     
13  
-    optional_variable($currentview); // browsing entries by categories?
  13
+    optional_variable($currentview,""); // browsing entries by categories?
14 14
     optional_variable($cat);         // categoryID
15  
-    
  15
+
  16
+    optional_variable($sortkey,"");  // Sorted view: CREATION or UPDATE
  17
+    optional_variable($sortorder,"");  // it define the order of the sorting (ASC or DESC)
  18
+
16 19
     if (! $cm = get_record("course_modules", "id", $id)) {
17 20
         error("Course Module ID was incorrect");
18 21
     } 
@@ -33,6 +36,17 @@
33 36
     
34 37
     add_to_log($course->id, "glossary", "view", "view.php?id=$cm->id", "$glossary->id");
35 38
     
  39
+    if ( $sortorder ) {
  40
+        $sortorder = strtolower($sortorder);
  41
+        if ($sortorder != "asc" and $sortorder != "desc") {
  42
+            $sortorder = "";
  43
+        }
  44
+    }
  45
+    if ( $sortorder ) {
  46
+        $l = "";
  47
+        $search ="";
  48
+    }
  49
+
36 50
 	$search = trim(strip_tags($search));
37 51
     if ($search and !$entryid) {
38 52
         $l = "";
@@ -49,7 +63,7 @@
49 63
     } 
50 64
     
51 65
     $alphabet = explode("|", get_string("alphabet","glossary"));
52  
-    if ($l == "" and $search == "" and ($eid == "" or $eid == 0)) {
  66
+    if ($l == "" and $search == "" and $sortkey == "" and ($eid == "" or $eid == 0)) {
53 67
         $l = $alphabet[0];
54 68
     } elseif ($eid) {
55 69
         $l = "";
@@ -94,7 +108,7 @@
94 108
 
95 109
     if ( $glossary->intro ) {
96 110
 	    print_simple_box_start("center","70%");
97  
-        echo '<p>';
  111
+        echo '<p align="center">';
98 112
         echo $glossary->intro;
99 113
         echo '</p>';
100 114
         print_simple_box_end();
@@ -155,8 +169,8 @@
155 169
         $currentcategory = "";
156 170
 
157 171
     } else {
158  
-        glossary_print_alphabet_menu($cm, $glossary, $l);
159  
-        if ($l) {
  172
+        glossary_print_alphabet_menu($cm, $glossary, $l, $sortkey, $sortorder);
  173
+        if ($l or $sortkey) {
160 174
             $currentletter = "";
161 175
         } elseif ($search) {
162 176
             echo "<h3>$strsearch: $search</h3>";
@@ -177,12 +191,32 @@
177 191
                         {$CFG->prefix}glossary_categories gc
178 192
                     WHERE (ge.glossaryid = '$glossary->id' or ge.sourceglossaryid = '$glossary->id') AND
179 193
                         gec.entryid = ge.id AND
180  
-                        gc.id = gec.categoryid
181  
-                    ORDER BY gc.name, ge.concept";
  194
+                        gc.id = gec.categoryid ";
  195
+        if ( $glossary->displayformat == GLOSSARY_FORMAT_CONTINUOUS ) {
  196
+            $sql .= "ORDER BY gc.name, ge.timecreated";
  197
+        } else {
  198
+            $sql .= "ORDER BY gc.name, ge.concept";
  199
+        }
182 200
         $allentries = get_records_sql($sql);
183 201
     } else { // looking for terms that begin with a specify letter or entries with no category associated
184  
-        $ownentries = get_records("glossary_entries", "glossaryid", $glossary->id, "concept ASC");
185  
-        $importedentries = get_records("glossary_entries", "sourceglossaryid", $glossary->id, "concept ASC");
  202
+        if ( $sortkey == "CREATION" or $sortkey == "UPDATE" or $glossary->displayformat == GLOSSARY_FORMAT_CONTINUOUS) {
  203
+            if ( !$sortkey and $glossary->displayformat == GLOSSARY_FORMAT_CONTINUOUS) {
  204
+                $sortkey = "CREATION";
  205
+                $sortorder = "asc";
  206
+            } 
  207
+            if ( !$sortorder ) {
  208
+                $sortorder = "asc";
  209
+            }
  210
+            if ($sortkey == "CREATION") {
  211
+                $orderby = "timecreated $sortorder";
  212
+           } else {
  213
+                $orderby = "timemodified $sortorder";
  214
+           }
  215
+        } else {
  216
+            $orderby = "concept ASC";
  217
+        }
  218
+        $ownentries = get_records("glossary_entries", "glossaryid", $glossary->id, $orderby);
  219
+        $importedentries = get_records("glossary_entries", "sourceglossaryid", $glossary->id, $orderby);
186 220
     
187 221
         if ($ownentries and $importedentries) {
188 222
             $allentries = array_merge($ownentries, $importedentries);
@@ -195,29 +229,32 @@
195 229
     } 
196 230
     
197 231
     if ($allentries) {
  232
+        if ($glossary->displayformat == GLOSSARY_FORMAT_CONTINUOUS) {
  233
+            echo "<table border=0 cellspacing=0 width=95% valign=top cellpadding=5><tr><td align=left bgcolor=\"#FFFFFF\">";
  234
+        }
198 235
         $dumpeddefinitions = 0;
199 236
         foreach ($allentries as $entry) {
200 237
             $dumptoscreen = 0;
201 238
             $firstletter = strtoupper(substr(ltrim($entry->concept), 0, strlen($l)));
202 239
             if ($l) {
203  
-                if ($l == "ALL" or $firstletter == $l) {
  240
+                if ($l == "ALL" or $sortkey == "CREATION" or $sortkey == "UPDATE" or $firstletter == $l) {
204 241
                     if ($currentletter != $firstletter[0]) {
205 242
                         $currentletter = $firstletter[0];
206 243
     
207  
-                        if ($glossary->displayformat == 0) {
  244
+                        if ($glossary->displayformat == GLOSSARY_FORMAT_SIMPLE) {
208 245
                             if ($dumpeddefinitions > 0) {
209 246
                                 echo "</table></center><p>";
210 247
                             } 
211  
-                            echo "\n<center><table border=0 cellspacing=0 width=95% valign=top cellpadding=10><tr><td align=center bgcolor=\"$THEME->cellheading2\">";
212  
-                        } 
213  
-                        if ($l == "ALL") {
  248
+                            echo "\n<center><table border=0 cellspacing=0 width=95% valign=top cellpadding=5><tr><td align=center bgcolor=\"$THEME->cellheading2\">";
  249
+                        }
  250
+                        if ($l == "ALL" and $glossary->displayformat != GLOSSARY_FORMAT_CONTINUOUS) {
214 251
                             echo "<b>$currentletter</b>";
215 252
                         } 
216 253
     
217  
-                        if ($glossary->displayformat == 0) {
  254
+                        if ($glossary->displayformat == GLOSSARY_FORMAT_SIMPLE) {
218 255
                             echo "\n</center></td></tr></table></center>";
219 256
                             if ($dumpeddefinitions > 0) {
220  
-                                echo "\n<center><table border=1 cellspacing=0 width=95% valign=top cellpadding=10>";
  257
+                                echo "\n<center><table border=0 cellspacing=0 width=95% valign=top cellpadding=5>";
221 258
                             } 
222 259
                         } 
223 260
                     } 
@@ -240,16 +277,22 @@
240 277
                         } else { // All categories
241 278
                             if ($currentcategory != $entry->CID) {
242 279
                                 $currentcategory = $entry->CID;
243  
-                                if ($glossary->displayformat == 0) {
  280
+                                if ($glossary->displayformat == GLOSSARY_FORMAT_SIMPLE) {
244 281
                                     if ($dumpeddefinitions > 0) {
245 282
                                         echo "</table></center><p>";
246 283
                                     } 
247 284
                                     echo "\n<center><table border=0 cellspacing=0 width=95% valign=top cellpadding=10><tr><td align=center bgcolor=\"$THEME->cellheading2\">";
248 285
                                 } 
  286
+                                if ( $glossary->displayformat == GLOSSARY_FORMAT_CONTINUOUS ) {
  287
+                                    echo "<center>";
  288
+                                }
249 289
                                 echo "<b>$entry->name</b>";
  290
+                                if ( $glossary->displayformat == GLOSSARY_FORMAT_CONTINUOUS ) {
  291
+                                    echo "</center><p>";
  292
+                                }
250 293
                             } 
251 294
     
252  
-                            if ($glossary->displayformat == 0) {
  295
+                            if ($glossary->displayformat == GLOSSARY_FORMAT_SIMPLE) {
253 296
                                 echo "\n</center></td></tr></table></center>";
254 297
                                 if ($dumpeddefinitions > 0) {
255 298
                                     echo "\n<center><table border=1 cellspacing=0 width=95% valign=top cellpadding=10>";
@@ -271,7 +314,7 @@
271 314
                 $definition = $entry->definition;
272 315
     
273 316
                 if ($dumpeddefinitions == 1) {
274  
-                    if ($glossary->displayformat == 0) {
  317
+                    if ($glossary->displayformat == GLOSSARY_FORMAT_SIMPLE) {
275 318
                         echo "\n<center><table border=1 cellspacing=0 width=95% valign=top cellpadding=10>";
276 319
                     } 
277 320
                 } 
@@ -282,14 +325,14 @@
282 325
     
283 326
                 glossary_print_entry($course, $cm, $glossary, $entry, $currentview, $cat);
284 327
     
285  
-                if ($glossary->displayformat != 0) {
  328
+                if ($glossary->displayformat != GLOSSARY_FORMAT_SIMPLE) {
286 329
                     echo "<p>";
287 330
                 } 
288 331
             } 
289 332
         } 
290 333
     } 
291 334
     if (! $dumpeddefinitions) {
292  
-        print_simple_box_start("center", "70%", "$THEME->cellheading");
  335
+        print_simple_box_start("center", "70%", "$THEME->cellheading2");
293 336
         if (!$search) {
294 337
             echo "<center>$strnoentries</center>";
295 338
         } else {
@@ -299,7 +342,10 @@
299 342
         } 
300 343
         print_simple_box_end();
301 344
     } else {
302  
-        if ($glossary->displayformat == 0) {
  345
+        if ($glossary->displayformat == GLOSSARY_FORMAT_CONTINUOUS) {
  346
+            echo "</td></tr></table>";
  347
+        }
  348
+        if ($glossary->displayformat == GLOSSARY_FORMAT_SIMPLE) {
303 349
             echo "\n</table></center>";
304 350
         } 
305 351
     } 

0 notes on commit 767a31c

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