diff --git a/course/format/topics/format.php b/course/format/topics/format.php index be93c5d8f84..8edf36a6a5f 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -25,6 +25,8 @@ * @package */ +defined('MOODLE_INTERNAL') || die(); + require_once($CFG->libdir.'/filelib.php'); $topic = optional_param('topic', -1, PARAM_INT); @@ -87,6 +89,7 @@ if (ismoving($course->id)) { $section = 0; $thissection = $sections[$section]; +unset($sections[0]); if ($thissection->summary or $thissection->sequence or $PAGE->user_is_editing()) { @@ -249,8 +252,41 @@ while ($section <= $course->numsections) { echo "\n"; } + unset($sections[$section]); $section++; } + +if ($PAGE->user_is_editing() && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) { + // print stealth sections if present + $modinfo = get_fast_modinfo($course); + foreach ($sections as $section=>$thissection) { + if (empty($modinfo->sections[$section])) { + continue; + } + + $strstealth = 'Invisible topic'; //TODO: MDL-24316 to be localised after we decide how to call this (skodak) + + echo '\n"; + } +} + + echo "\n"; if (!empty($sectionmenu)) { diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 472725a5463..e7c352038b2 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -24,6 +24,8 @@ * @package */ +defined('MOODLE_INTERNAL') || die(); + require_once($CFG->libdir.'/filelib.php'); $week = optional_param('week', -1, PARAM_INT); @@ -79,6 +81,7 @@ $section = 0; $thissection = $sections[$section]; + unset($sections[0]); if ($thissection->summary or $thissection->sequence or $PAGE->user_is_editing()) { @@ -248,9 +251,41 @@ echo "\n"; } + unset($sections[$section]); $section++; $weekdate = $nextweekdate; } + + if ($PAGE->user_is_editing() && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) { + // print stealth sections if present + $modinfo = get_fast_modinfo($course); + foreach ($sections as $section=>$thissection) { + if (empty($modinfo->sections[$section])) { + continue; + } + + $strstealth = 'Invisible week'; //TODO: MDL-24316 to be localised after we decide how to call this (skodak) + + echo '\n"; + } + } + echo "\n"; if (!empty($sectionmenu)) {