Skip to content

Commit

Permalink
Invisible sections are no longer shown in jump menu, see bug 2085
Browse files Browse the repository at this point in the history
  • Loading branch information
gustav_delius committed Feb 13, 2005
1 parent 8a6e783 commit 8dc93b9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
30 changes: 14 additions & 16 deletions course/format/topics/format.php
Expand Up @@ -129,22 +129,6 @@

while ($section <= $course->numsections) {

if (!empty($displaysection) and $displaysection != $section) {
if (empty($sections[$section])) {
$strsummary = '';
} else {
$strsummary = ' - '.strip_tags($sections[$section]->summary);
if (strlen($strsummary) < 57) {
$strsummary = ' - '.$strsummary;
} else {
$strsummary = ' - '.substr($strsummary, 0, 60).'...';
}
}
$sectionmenu['topic='.$section] = s($section.$strsummary);
$section++;
continue;
}

if (!empty($sections[$section])) {
$thissection = $sections[$section];

Expand All @@ -161,6 +145,20 @@

$showsection = (isteacher($course->id) or $thissection->visible or !$course->hiddensections);

if (!empty($displaysection) and $displaysection != $section) {
if ($showsection) {
$strsummary = ' - '.strip_tags($thissection->summary);
if (strlen($strsummary) < 57) {
$strsummary = ' - '.$strsummary;
} else {
$strsummary = ' - '.substr($strsummary, 0, 60).'...';
}
$sectionmenu['topic='.$section] = s($section.$strsummary);
}
$section++;
continue;
}

if ($showsection) {

$currenttopic = ($course->marker == $section);
Expand Down
16 changes: 9 additions & 7 deletions course/format/weeks/format.php
Expand Up @@ -131,13 +131,6 @@
$weekday = userdate($weekdate, $strftimedateshort);
$endweekday = userdate($weekdate+518400, $strftimedateshort);

if (!empty($displaysection) and $displaysection != $section) { // Check this week is visible
$sectionmenu["week=$section"] = s("$strweek $section | $weekday - $endweekday");
$section++;
$weekdate = $nextweekdate;
continue;
}

if (!empty($sections[$section])) {
$thissection = $sections[$section];

Expand All @@ -154,6 +147,15 @@

$showsection = (isteacher($course->id) or $thissection->visible or !$course->hiddensections);

if (!empty($displaysection) and $displaysection != $section) { // Check this week is visible
if ($showsection) {
$sectionmenu["week=$section"] = s("$strweek $section | $weekday - $endweekday");
}
$section++;
$weekdate = $nextweekdate;
continue;
}

if ($showsection) {

$currentweek = (($weekdate <= $timenow) && ($timenow < $nextweekdate));
Expand Down

0 comments on commit 8dc93b9

Please sign in to comment.