Ejemplo n.º 1
0
    if ($PAGE->user_is_editing() && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {
        echo '<p><a title="' . $streditsummary . '" ' . ' href="editsection.php?id=' . $thissection->id . '"><img src="' . $OUTPUT->pix_url('t/edit') . '" ' . ' class="iconsmall edit" alt="' . $streditsummary . '" /></a></p>';
    }
    echo '</div>';
    $cobject->print_section_fn($course, $thissection, $mods, $modnamesused, $resubmission);
    if ($PAGE->user_is_editing()) {
        $cobject->print_section_add_menus($course, $section, $modnames);
    }
    echo '</div>';
    echo "</li>\n";
}
/// Now all the normal modules by week
/// Everything below uses "section" terminology - each "section" is a week.
$courseformatoptions = course_get_format($course)->get_format_options();
//$course->numsections = $courseformatoptions['numsections'];
$course->numsections = $cobject->get_last_lection();
//$course->hiddensections = $courseformatoptions['hiddensections'];
//$course->coursedisplay = $courseformatoptions['coursedisplay'];
if (empty($course->showonlysection0)) {
    /// Now all the weekly sections
    $timenow = time();
    $weekdate = $course->startdate;
    // this should be 0:00 Monday of that week
    $weekdate += 7200;
    // Add two hours to avoid possible DST problems
    $section = 1;
    $sectionmenu = array();
    $weekofseconds = 604800;
    $course->enddate = $course->startdate + $weekofseconds * $course->numsections;
    $completion = new completion_info($course);
    $show_option = $DB->get_field('course_config_fn', 'value', array('courseid' => $course->id, 'variable' => 'defaulttab'));