From eccc37c0333b73609697e66062a7ecb8046dfe17 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 27 Apr 2004 16:36:01 +0000 Subject: [PATCH] Now, in topics format, every course can decide about how to display hidden topics (collapsed or invisible) Now it can be set in every course and it's applicable in topics format --- course/edit.html | 10 +++ course/format/topics/format.php | 126 +++++++++++++++++--------------- 2 files changed, 77 insertions(+), 59 deletions(-) diff --git a/course/edit.html b/course/edit.html index b795910beb..aedce100b8 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 12b303f77c..7d088aa84e 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -180,84 +180,92 @@ $colormain = "bgcolor=\"$THEME->cellcontent\" class=\"topicsoutlinecontent\""; } - echo ""; - echo ""; - echo "

$section

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

$section

"; + echo ""; - if (isediting($course->id)) { - echo " id>". - "pixpath/t/edit.gif\" border=0 height=11 width=11>
"; - } + if (!isteacher($course->id) and !$thissection->visible) { // Hidden for students + echo ""; + echo get_string("notavailable"); + echo ""; + } else { + echo ""; - echo '
'; + echo format_text($thissection->summary, FORMAT_HTML); - print_section($course, $thissection, $mods, $modnamesused); + if (isediting($course->id)) { + echo " id>". + "pixpath/t/edit.gif\" border=0 height=11 width=11>
"; + } - 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 ""; - echo ""; + print_section($course, $thissection, $mods, $modnamesused); - 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)) { + echo "
"; + popup_form("$CFG->wwwroot/course/mod.php?id=$course->id&section=$section&add=", + $modnames, "section$section", "", "$stradd..."); + echo "
"; + } - 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>
"; + echo ""; } + echo ""; + echo ""; - 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>
"; + if ($displaysection == $section) { // Show the zoom boxes + echo "id&topic=all\" title=\"$strshowalltopics\">". + "pixpath/i/all.gif\" height=25 width=16 border=0>
"; } else { - echo "id&show=$section\" title=\"$strtopicshow\">". - "pixpath/i/show.gif\" vspace=3 height=16 width=16 border=0>
"; + $strshowonlytopic = get_string("showonlytopic", "", $section); + echo "id&topic=$section\" title=\"$strshowonlytopic\">". + "pixpath/i/one.gif\" 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 (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>
"; + } - 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 ""; - echo ""; - $section++; } echo ""; -- 2.39.5