$colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\"";
}
- echo "<tr>";
- echo "<td nowrap $colorsides valign=top width=20>";
- echo "<p align=center><font size=3><b>$section</b></font></p>";
- echo "</td>";
-
- 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>";
-
+ //If is student and the section isn't visible and hidden topics are invisible
+ if (!isteacher($course->id) and !$thissection->visible and $course->hiddentopics == 1) {
+ $showtopicheader = false; //Don't show section at all
} else {
- echo "<td valign=top $colormain width=\"100%\">";
+ $showtopicheader = true; //Show section (full or collapsed)
+ }
- echo format_text($thissection->summary, FORMAT_HTML);
+ if ($showtopicheader) {
+ echo "<tr>";
+ echo "<td nowrap $colorsides valign=top width=20>";
+ echo "<p align=center><font size=3><b>$section</b></font></p>";
+ echo "</td>";
- if (isediting($course->id)) {
- echo " <a title=\"$streditsummary\" href=editsection.php?id=$thissection->id>".
- "<img src=\"$CFG->pixpath/t/edit.gif\" border=0 height=11 width=11></a><br />";
- }
+ 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>";
+ } else {
+ echo "<td valign=top $colormain width=\"100%\">";
- echo '<br clear="all">';
+ echo format_text($thissection->summary, FORMAT_HTML);
- print_section($course, $thissection, $mods, $modnamesused);
+ if (isediting($course->id)) {
+ echo " <a title=\"$streditsummary\" href=editsection.php?id=$thissection->id>".
+ "<img src=\"$CFG->pixpath/t/edit.gif\" border=0 height=11 width=11></a><br />";
+ }
- if (isediting($course->id)) {
- echo "<div align=right>";
- popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=",
- $modnames, "section$section", "", "$stradd...");
- echo "</div>";
- }
+ echo '<br clear="all">';
- echo "</td>";
- }
- echo "<td nowrap $colorsides valign=top align=center width=10>";
- echo "<font size=1>";
+ print_section($course, $thissection, $mods, $modnamesused);
- if ($displaysection == $section) { // Show the zoom boxes
- echo "<a href=\"view.php?id=$course->id&topic=all\" title=\"$strshowalltopics\">".
- "<img src=\"$CFG->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=\"$CFG->pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
- }
+ if (isediting($course->id)) {
+ echo "<div align=right>";
+ popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=",
+ $modnames, "section$section", "", "$stradd...");
+ echo "</div>";
+ }
- 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=\"$CFG->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=\"$CFG->pixpath/i/marker.gif\" vspace=3 height=16 width=16 border=0></a><br />";
+ echo "</td>";
}
+ echo "<td nowrap $colorsides valign=top align=center width=10>";
+ echo "<font size=1>";
- if ($thissection->visible) { // Show the hide/show eye
- echo "<a href=\"view.php?id=$course->id&hide=$section\" title=\"$strtopichide\">".
- "<img src=\"$CFG->pixpath/i/hide.gif\" vspace=3 height=16 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=\"$CFG->pixpath/i/all.gif\" height=25 width=16 border=0></a><br />";
} else {
- echo "<a href=\"view.php?id=$course->id&show=$section\" title=\"$strtopicshow\">".
- "<img src=\"$CFG->pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
+ $strshowonlytopic = get_string("showonlytopic", "", $section);
+ echo "<a href=\"view.php?id=$course->id&topic=$section\" title=\"$strshowonlytopic\">".
+ "<img src=\"$CFG->pixpath/i/one.gif\" height=16 width=16 border=0></a><br />";
}
- if ($section > 1) { // Add a arrow to move section up
- echo "<a href=\"view.php?id=$course->id§ion=$section&move=-1\" title=\"$strmoveup\">".
- "<img src=\"$CFG->pixpath/t/up.gif\" vspace=3 height=11 width=11 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=\"$CFG->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=\"$CFG->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=\"$CFG->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=\"$CFG->pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0></a><br />";
+ }
+
+ if ($section > 1) { // Add a arrow to move section up
+ echo "<a href=\"view.php?id=$course->id§ion=$section&move=-1\" title=\"$strmoveup\">".
+ "<img src=\"$CFG->pixpath/t/up.gif\" vspace=3 height=11 width=11 border=0></a><br />";
+ }
+
+ if ($section < $course->numsections) { // Add a arrow to move section down
+ echo "<a href=\"view.php?id=$course->id§ion=$section&move=1\" title=\"$strmovedown\">".
+ "<img src=\"$CFG->pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0></a><br />";
+ }
- if ($section < $course->numsections) { // Add a arrow to move section down
- echo "<a href=\"view.php?id=$course->id§ion=$section&move=1\" title=\"$strmovedown\">".
- "<img src=\"$CFG->pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0></a><br />";
}
+ echo "</td>";
+ echo "</tr>";
+ echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
}
- echo "</td>";
- echo "</tr>";
- echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
-
$section++;
}
echo "</table>";