MDL-24316 adding support for stealth sections on course edit page - work in progress, we need to decide how to visualise it and what lang strings to use
This commit is contained in:
@@ -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 "</li>\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 '<li id="section-'.$section.'" class="section main clearfix stealth hidden">'; //'<div class="left side"> </div>';
|
||||
|
||||
echo '<div class="left side">';
|
||||
echo $strstealth;
|
||||
echo '</div>';
|
||||
// Note, 'right side' is BEFORE content.
|
||||
echo '<div class="right side">';
|
||||
echo $strstealth;
|
||||
echo '</div>';
|
||||
echo '<div class="content">';
|
||||
print_section($course, $thissection, $mods, $modnamesused);
|
||||
echo '<br />';
|
||||
if ($PAGE->user_is_editing()) {
|
||||
print_section_add_menus($course, $section, $modnames);
|
||||
}
|
||||
echo '</div>';
|
||||
echo "</li>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "</ul>\n";
|
||||
|
||||
if (!empty($sectionmenu)) {
|
||||
|
||||
@@ -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 "</li>\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 '<li id="section-'.$section.'" class="section main clearfix stealth hidden">'; //'<div class="left side"> </div>';
|
||||
|
||||
echo '<div class="left side">';
|
||||
echo $strstealth;
|
||||
echo '</div>';
|
||||
// Note, 'right side' is BEFORE content.
|
||||
echo '<div class="right side">';
|
||||
echo $strstealth;
|
||||
echo '</div>';
|
||||
echo '<div class="content">';
|
||||
print_section($course, $thissection, $mods, $modnamesused);
|
||||
echo '<br />';
|
||||
if ($PAGE->user_is_editing()) {
|
||||
print_section_add_menus($course, $section, $modnames);
|
||||
}
|
||||
echo '</div>';
|
||||
echo "</li>\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</ul>\n";
|
||||
|
||||
if (!empty($sectionmenu)) {
|
||||
|
||||
Reference in New Issue
Block a user