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
This commit is contained in:
@@ -98,6 +98,16 @@
|
||||
helpbutton("courseavailability", get_string("availability")); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align="right"><P><?php print_string("hiddentopics") ?>:</td>
|
||||
<td><?php
|
||||
unset($choices);
|
||||
$choices["0"] = get_string("hiddentopicscollapsed");
|
||||
$choices["1"] = get_string("hiddentopicsinvisible");
|
||||
choose_from_menu ($choices, "hiddentopics", $form->hiddentopics, "");
|
||||
helpbutton("coursehiddentopics", get_string("hiddentopics")); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign=top>
|
||||
<td align="right"><P><?php print_string("enrolmentkey") ?>:</td>
|
||||
<td><input type="text" name="password" size=25 value="<?php p($form->password) ?>">
|
||||
|
||||
@@ -180,83 +180,91 @@
|
||||
$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 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 "<td valign=top align=center $colormain width=\"100%\">";
|
||||
echo get_string("notavailable");
|
||||
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>";
|
||||
|
||||
} else {
|
||||
echo "<td valign=top $colormain width=\"100%\">";
|
||||
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 format_text($thissection->summary, FORMAT_HTML);
|
||||
echo format_text($thissection->summary, FORMAT_HTML);
|
||||
|
||||
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 " <a title=\"$streditsummary\" href=editsection.php?id=$thissection->id>".
|
||||
"<img src=\"$CFG->pixpath/t/edit.gif\" border=0 height=11 width=11></a><br />";
|
||||
}
|
||||
|
||||
echo '<br clear="all">';
|
||||
|
||||
print_section($course, $thissection, $mods, $modnamesused);
|
||||
|
||||
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 "</td>";
|
||||
}
|
||||
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=\"$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 />";
|
||||
}
|
||||
|
||||
echo '<br clear="all">';
|
||||
|
||||
print_section($course, $thissection, $mods, $modnamesused);
|
||||
|
||||
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 ($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 />";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
|
||||
}
|
||||
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=\"$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)) {
|
||||
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 />";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr><td colspan=3><img src=\"../pix/spacer.gif\" width=1 height=1></td></tr>";
|
||||
|
||||
$section++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user