diff --git a/course/edit.html b/course/edit.html index b795910beb3..aedce100b87 100644 --- a/course/edit.html +++ b/course/edit.html @@ -98,6 +98,16 @@ helpbutton("courseavailability", get_string("availability")); ?> + +

: + hiddentopics, ""); + helpbutton("coursehiddentopics", get_string("hiddentopics")); ?> + +

: diff --git a/course/format/topics/format.php b/course/format/topics/format.php index 12b303f77cc..7d088aa84e4 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -180,83 +180,91 @@ $colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\""; } - echo ""; - echo ""; - echo "

$section

"; - echo ""; + //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 { + $showtopicheader = true; //Show section (full or collapsed) + } - if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students - echo ""; - echo get_string("notavailable"); + if ($showtopicheader) { + echo ""; + echo ""; + echo "

$section

"; echo ""; - } else { - echo ""; + if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students + echo ""; + echo get_string("notavailable"); + echo ""; + } else { + echo ""; - echo format_text($thissection->summary, FORMAT_HTML); + echo format_text($thissection->summary, FORMAT_HTML); - if (isediting($course->id)) { - echo " id>". - "pixpath/t/edit.gif\" border=0 height=11 width=11>
"; + if (isediting($course->id)) { + echo " id>". + "pixpath/t/edit.gif\" border=0 height=11 width=11>
"; + } + + echo '
'; + + print_section($course, $thissection, $mods, $modnamesused); + + if (isediting($course->id)) { + echo "
"; + popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=", + $modnames, "section$section", "", "$stradd..."); + echo "
"; + } + + echo ""; + } + echo ""; + echo ""; + + if ($displaysection == $section) { // Show the zoom boxes + echo "id&topic=all\" title=\"$strshowalltopics\">". + "pixpath/i/all.gif\" height=25 width=16 border=0>
"; + } else { + $strshowonlytopic = get_string("showonlytopic", "", $section); + echo "id&topic=$section\" title=\"$strshowonlytopic\">". + "pixpath/i/one.gif\" height=16 width=16 border=0>
"; } - echo '
'; - - print_section($course, $thissection, $mods, $modnamesused); - if (isediting($course->id)) { - echo "
"; - popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=", - $modnames, "section$section", "", "$stradd..."); - echo "
"; + if ($course->marker == $section) { // Show the "light globe" on/off + echo "id&marker=0\" title=\"$strmarkedthistopic\">". + "pixpath/i/marked.gif\" vspace=3 height=16 width=16 border=0>
"; + } else { + echo "id&marker=$section\" title=\"$strmarkthistopic\">". + "pixpath/i/marker.gif\" vspace=3 height=16 width=16 border=0>
"; + } + + if ($thissection->visible) { // Show the hide/show eye + echo "id&hide=$section\" title=\"$strtopichide\">". + "pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0>
"; + } else { + echo "id&show=$section\" title=\"$strtopicshow\">". + "pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0>
"; + } + + if ($section > 1) { // Add a arrow to move section up + echo "id§ion=$section&move=-1\" title=\"$strmoveup\">". + "pixpath/t/up.gif\" vspace=3 height=11 width=11 border=0>
"; + } + + if ($section < $course->numsections) { // Add a arrow to move section down + echo "id§ion=$section&move=1\" title=\"$strmovedown\">". + "pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0>
"; + } + } echo ""; + echo ""; + echo ""; } - echo ""; - echo ""; - - if ($displaysection == $section) { // Show the zoom boxes - echo "id&topic=all\" title=\"$strshowalltopics\">". - "pixpath/i/all.gif\" height=25 width=16 border=0>
"; - } else { - $strshowonlytopic = get_string("showonlytopic", "", $section); - echo "id&topic=$section\" title=\"$strshowonlytopic\">". - "pixpath/i/one.gif\" height=16 width=16 border=0>
"; - } - - if (isediting($course->id)) { - if ($course->marker == $section) { // Show the "light globe" on/off - echo "id&marker=0\" title=\"$strmarkedthistopic\">". - "pixpath/i/marked.gif\" vspace=3 height=16 width=16 border=0>
"; - } else { - echo "id&marker=$section\" title=\"$strmarkthistopic\">". - "pixpath/i/marker.gif\" vspace=3 height=16 width=16 border=0>
"; - } - - if ($thissection->visible) { // Show the hide/show eye - echo "id&hide=$section\" title=\"$strtopichide\">". - "pixpath/i/hide.gif\" vspace=3 height=16 width=16 border=0>
"; - } else { - echo "id&show=$section\" title=\"$strtopicshow\">". - "pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0>
"; - } - - if ($section > 1) { // Add a arrow to move section up - echo "id§ion=$section&move=-1\" title=\"$strmoveup\">". - "pixpath/t/up.gif\" vspace=3 height=11 width=11 border=0>
"; - } - - if ($section < $course->numsections) { // Add a arrow to move section down - echo "id§ion=$section&move=1\" title=\"$strmovedown\">". - "pixpath/t/down.gif\" vspace=3 height=11 width=11 border=0>
"; - } - - } - - echo ""; - echo ""; - echo ""; $section++; }