]> git.mjollnir.org Git - moodle.git/commitdiff
Solved bug 1086.
authorstronk7 <stronk7>
Tue, 11 May 2004 22:38:45 +0000 (22:38 +0000)
committerstronk7 <stronk7>
Tue, 11 May 2004 22:38:45 +0000 (22:38 +0000)
Please, verify (and close) it. Patch submitted by Petr Skoda. Thanks!
I've modified some lines in formats to avoid some Notices and make
everything display more consistent. Please, test it!!

mod/glossary/formats/2.php
mod/glossary/formats/3.php
mod/glossary/formats/4.php
mod/glossary/formats/5.php
mod/glossary/lib.php
mod/glossary/view.php

index 9fe1394314281659782e4b22474d815298db253e..8eb95e9343d5a4d33075095ca21e68d3a7196cfb 100644 (file)
@@ -8,7 +8,7 @@ function glossary_print_entry_by_format($course, $cm, $glossary, $entry, $mode="
     $user = get_record("user", "id", $entry->userid);
     $strby = get_string("writtenby", "glossary");
 
-    echo "\n<table border=0 width=95% cellspacing=0 valign=top cellpadding=3 class=forumpost align=center>";
+    echo "\n<br /><table border=0 width=95% cellspacing=0 valign=top cellpadding=3 class=forumpost align=center>";
 
     echo "\n<tr>";
     echo "\n<td bgcolor=\"$colour\" width=35 valign=top class=\"forumpostpicture\">";
@@ -17,7 +17,7 @@ function glossary_print_entry_by_format($course, $cm, $glossary, $entry, $mode="
         print_user_picture($user->id, $course->id, $user->picture);
 
         echo "</td>";
-        echo "<td nowrap valign=\"top\" width=100% bgcolor=\"$THEME->cellheading\" class=\"forumpostheader\">";
+        echo "<td valign=\"top\" width=100% bgcolor=\"$THEME->cellheading\" class=\"forumpostheader\">";
 
         glossary_print_entry_approval($cm, $entry, $mode);
         glossary_print_entry_attachment($entry,"html","right");
index ab1920adcb31cedd618e9c02c918749b3b049b79..9df16b24b26c233afb5547b0adcc804169fe57e1 100644 (file)
@@ -8,7 +8,7 @@ function glossary_print_entry_by_format($course, $cm, $glossary, $entry, $mode="
     $user = get_record("user", "id", $entry->userid);
     $strby = get_string("writtenby", "glossary");
 
-    echo "\n<table border=0 width=95% cellspacing=0 valign=top cellpadding=3 class=forumpost align=center>";
+    echo "\n<br /><table border=0 width=95% cellspacing=0 valign=top cellpadding=3 class=forumpost align=center>";
 
     echo "\n<tr>";
     echo "\n<td bgcolor=\"$colour\" width=35 valign=top class=\"forumpostpicture\">";
@@ -16,7 +16,7 @@ function glossary_print_entry_by_format($course, $cm, $glossary, $entry, $mode="
     if ($entry) {
         print_user_picture($user->id, $course->id, $user->picture);
         echo "</td>";
-        echo "<td align=\"top\" nowrap width=100% bgcolor=\"$THEME->cellheading\" class=\"forumpostheader\">";
+        echo "<td align=\"top\" width=100% bgcolor=\"$THEME->cellheading\" class=\"forumpostheader\">";
         glossary_print_entry_approval($cm, $entry, $mode);
         echo "<b>";
         glossary_print_entry_concept($entry);
index 0b00e13d0bd2dbdf4d8460670c31ebf26beb7b72..87bc412a9ccffbf1721269866c22529aebdfbfd8 100644 (file)
@@ -6,7 +6,7 @@ function glossary_print_entry_by_format($course, $cm, $glossary, $entry, $mode="
     if ( $entry ) {
         $colour = $THEME->cellheading2;
 
-        echo '<table border=1 cellspacing=0 width=95% valign=top cellpadding=10>';
+        echo '<br /><table border=0 cellspacing=0 width=95% valign=top cellpadding=10 class=forumpost>';
 
         echo '<tr>';
         echo "<td width=100% bgcolor=\"$colour\">";
index 13be389e88c96e56ecf3111ab693232aca5145a4..9bf3cb880a580be02fc5aed0435753e45f960abe 100644 (file)
@@ -6,17 +6,17 @@ function glossary_print_entry_by_format($course, $cm, $glossary, $entry, $mode="
     $colour = $THEME->cellheading2;
     $return = false;
 
-    echo "\n<table border=1 cellspacing=0 width=95% valign=top cellpadding=10>";
+    echo "\n<br /><table border=0 width=95% cellspacing=0 valign=top cellpadding=3 class=forumpost align=center>";
 
     echo "\n<tr>";
-    echo "<td width=100% bgcolor=\"$colour\">";
+    echo "<td width=100% bgcolor=\"$THEME->cellheading\">";
     glossary_print_entry_approval($cm, $entry, $mode);
     if ($entry) {
         glossary_print_entry_attachment($entry,"html","right");
         echo "<b>";
         glossary_print_entry_concept($entry);
         echo "</b><br />";
-        echo "&nbsp;&nbsp;<font size=1>".get_string("lastedited").": ".userdate($entry->timemodified)."</font>";
+        echo "<font size=1>".get_string("lastedited").": ".userdate($entry->timemodified)."</font>";
         echo "</tr>";
         echo "\n<tr><td width=100% bgcolor=\"$THEME->cellcontent\">";
                
index 2f9dab242099325ff04b97b3ee5bd323629d9892..80b71d7f5bd7fb642e7aba1563caecba0c1b59ea 100644 (file)
@@ -185,7 +185,7 @@ function glossary_user_complete($course, $user, $mod, $glossary) {
              $glossary->displayformat == GLOSSARY_FORMAT_CONTINUOUS ) {
             print_simple_box_start("center","70%");
         } else {
-            echo '<table width="95%" boder="0"><tr><td>';
+            echo '<table width="95%" border="0"><tr><td>';
         }
         foreach ($entries as $entry) {
             $cm = get_coursemodule_from_instance("glossary", $glossary->id, $course->id);
@@ -508,7 +508,8 @@ function glossary_print_entry_definition($entry) {
         $definition = str_replace(array_keys($tags),$tags,$definition);
     }
 
-    $text = format_text($definition, $entry->format);
+    $options->para = false;
+    $text = format_text($definition, $entry->format,$options);
     if (!empty($entry->highlight)) {
         $text = highlight($entry->highlight, $text);
     }
@@ -661,7 +662,7 @@ function glossary_print_entry_by_default($course, $cm, $glossary, $entry,$mode="
     $colour = $THEME->cellheading2;
 
     echo "\n<TR>";
-    echo "<TD WIDTH=100% class=\"generalbox\" valign=\"top\" BGCOLOR=\"#FFFFFF\">";
+    echo "<TD WIDTH=100% valign=\"top\" BGCOLOR=\"#FFFFFF\">";
         glossary_print_entry_approval($cm, $entry, $mode);
         glossary_print_entry_attachment($entry,"html","right");
         echo "<b>";
@@ -1111,6 +1112,10 @@ for ($row = 0; $row < $numrows; $row++) {
                          $currentcolor = $tabcolor;
                          $currentstyle = 'generaltab';
                     }
+
+                    if (!isset($data[$tabproccessed]->link)) {
+                        $data[$tabproccessed]->link = NULL;
+                    }
                     echo "<td class=\"$currentstyle\" width=\"$tabwidth%\" bgcolor=\"$currentcolor\" align=\"center\"><b>";
                     if ($tabproccessed != $currenttab and $data[$tabproccessed]->link) {
                         echo "<a href=\"" . $data[$tabproccessed]->link . "\">";
index eb660f087b701620ff8075d507d62fc9b11f4e9d..d3f7f50549984a718239d2544dee93f60f46cac8 100644 (file)
                 if ( glossary_print_entry($course, $cm, $glossary, $entry, $mode, $hook,1,$displayformat,$ratings) ) {
                     $ratingsmenuused = true;
                 }
-                echo "<br />";
 
                 $entriesshown++;
             }