]> git.mjollnir.org Git - moodle.git/commitdiff
Avoid one warning where $content and $list were empty.
authorstronk7 <stronk7>
Sat, 10 Apr 2004 22:24:23 +0000 (22:24 +0000)
committerstronk7 <stronk7>
Sat, 10 Apr 2004 22:24:23 +0000 (22:24 +0000)
course/lib.php

index 525c7e4fc09248a445433da29b0750c8cfdb3063..d70f247825e8d4cc03634434d34ca36fd270a9c8 100644 (file)
@@ -1013,13 +1013,15 @@ function print_side_block($heading="", $content="", $list=NULL, $icons=NULL, $fo
         echo "$content";
     } else {
         echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">";
-        foreach ($list as $key => $string) {
-            echo "<tr bgcolor=\"$THEME->cellcontent2\">";
-            if ($icons) {
-                echo "<td class=\"sideblocklinks\" valign=\"top\" width=\"16\">".$icons[$key]."</td>";
+        if ($list) {
+            foreach ($list as $key => $string) {
+                echo "<tr bgcolor=\"$THEME->cellcontent2\">";
+                if ($icons) {
+                    echo "<td class=\"sideblocklinks\" valign=\"top\" width=\"16\">".$icons[$key]."</td>";
+                }
+                echo "<td class=\"sideblocklinks\" valign=\"top\" width=\"*\"><font size=\"-1\">$string</font></td>";
+                echo "</tr>";
             }
-            echo "<td class=\"sideblocklinks\" valign=\"top\" width=\"*\"><font size=\"-1\">$string</font></td>";
-            echo "</tr>";
         }
         if ($footer) {
             echo "<tr bgcolor=\"$THEME->cellcontent2\">";