]> git.mjollnir.org Git - moodle.git/commitdiff
Slightly better logic
authormoodler <moodler>
Sun, 4 May 2003 13:44:56 +0000 (13:44 +0000)
committermoodler <moodler>
Sun, 4 May 2003 13:44:56 +0000 (13:44 +0000)
course/topics.php

index 83ddb1bd803d1ad5b4d6c41974d556713ddf3d8b..1b7b988310fc4a59bcd954e47efc108fe857b72d 100644 (file)
         }
     
         echo "</td>";
-        echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top align=center width=10>&nbsp;";
-        echo "<a href=\"view.php?id=$course->id&topic=all\" title=\"$strshowalltopics\"><img src=\"$pixpath/i/all.gif\" height=25 width=16 border=0></a><br><br>";
-        echo "</td>";
-        echo "</tr>";
+        echo "<td nowrap bgcolor=\"$THEME->cellheading\" class=\"topicsoutlineside\" valign=top align=center width=10>";
+        echo "&nbsp;</td></tr>";
         echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
     }
 
         if (!isteacher($course->id) and !$thissection->visible) {   // Hidden for students
             echo "<td valign=top align=center $colormain width=\"100%\">";
             echo get_string("notavailable");
-            echo "</td><td $colorsides width=20>";
-            echo "&nbsp;";
-            echo "</td></tr>";
+            echo "</td>";
 
         } else {
             echo "<td valign=top $colormain width=\"100%\">";
             }
     
             echo "</td>";
-            echo "<td nowrap $colorsides valign=top align=center width=10>";
-            echo "<font size=1>";
+        }
+        echo "<td nowrap $colorsides valign=top align=center width=10>";
+        echo "<font size=1>";
 
-            if ($displaysection == $section) {      // Show the zoom boxes
-                echo "<a href=\"view.php?id=$course->id&topic=all\" title=\"$strshowalltopics\">".
-                     "<img src=\"$pixpath/i/all.gif\" height=25 width=16 border=0></a><br />";
+        if ($displaysection == $section) {      // Show the zoom boxes
+            echo "<a href=\"view.php?id=$course->id&topic=all\" title=\"$strshowalltopics\">".
+                 "<img src=\"$pixpath/i/all.gif\" height=25 width=16 border=0></a><br />";
+        } else {
+            $strshowonlytopic = get_string("showonlytopic", "", $section);
+            echo "<a href=\"view.php?id=$course->id&topic=$section\" title=\"$strshowonlytopic\">".
+                 "<img src=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
+        }
+
+        if (isediting($course->id)) {
+            if ($course->marker == $section) {  // Show the "light globe" on/off
+                echo "<a href=\"view.php?id=$course->id&marker=0\" title=\"$strmarkedthistopic\">".
+                     "<img src=\"$pixpath/i/marked.gif\" vspace=3 height=16 width=16 border=0></a><br />";
             } else {
-                $strshowonlytopic = get_string("showonlytopic", "", $section);
-                echo "<a href=\"view.php?id=$course->id&topic=$section\" title=\"$strshowonlytopic\">".
-                     "<img src=\"$pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
+                echo "<a href=\"view.php?id=$course->id&marker=$section\" title=\"$strmarkthistopic\">".
+                     "<img src=\"$pixpath/i/marker.gif\" vspace=3 height=16 width=16 border=0></a><br />";
             }
 
-            if (isediting($course->id)) {
-                if ($course->marker == $section) {  // Show the "light globe" on/off
-                    echo "<a href=\"view.php?id=$course->id&marker=0\" title=\"$strmarkedthistopic\">".
-                         "<img src=\"$pixpath/i/marked.gif\" vspace=3 height=16 width=16 border=0></a><br />";
-                } else {
-                    echo "<a href=\"view.php?id=$course->id&marker=$section\" title=\"$strmarkthistopic\">".
-                         "<img src=\"$pixpath/i/marker.gif\" vspace=3 height=16 width=16 border=0></a><br />";
-                }
-
-                if ($thissection->visible) {        // Show the hide/show eye
-                    echo "<a href=\"view.php?id=$course->id&hide=$section\" title=\"$strtopichide\">".
-                         "<img src=\"$pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
-                } else {
-                    echo "<a href=\"view.php?id=$course->id&show=$section\" title=\"$strtopicshow\">".
-                         "<img src=\"$pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
-                }
-
+            if ($thissection->visible) {        // Show the hide/show eye
+                echo "<a href=\"view.php?id=$course->id&hide=$section\" title=\"$strtopichide\">".
+                     "<img src=\"$pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0></a><br />";
+            } else {
+                echo "<a href=\"view.php?id=$course->id&show=$section\" title=\"$strtopicshow\">".
+                     "<img src=\"$pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
             }
 
-            echo "</td>";
-            echo "</tr>";
         }
+
+        echo "</td>";
+        echo "</tr>";
         echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
 
         $section++;