예제 #1
0
파일: index.php 프로젝트: ncsu-delta/moodle
                $streditsummary = get_string('editsummary');
                echo "<a title=\"$streditsummary\" ".
                     " href=\"course/editsection.php?id=$section->id\"><img src=\"" . $OUTPUT->pix_url('t/edit') . "\" ".
                     " class=\"iconsmall\" alt=\"$streditsummary\" /></a><br /><br />";
            }

            print_section($SITE, $section, $mods, $modnamesused, true);

            if ($editing) {
                print_section_add_menus($SITE, $section->section, $modnames);
            }
            echo $OUTPUT->box_end();
        }
    }
    // Include course AJAX
    if (include_course_ajax($SITE, $modnamesused)) {
        // Add the module chooser
        $renderer = $PAGE->get_renderer('core', 'course');
        echo $renderer->course_modchooser(get_module_metadata($SITE, $modnames), $SITE);
    }

    if (isloggedin() and !isguestuser() and isset($CFG->frontpageloggedin)) {
        $frontpagelayout = $CFG->frontpageloggedin;
    } else {
        $frontpagelayout = $CFG->frontpage;
    }

    foreach (explode(',',$frontpagelayout) as $v) {
        switch ($v) {     /// Display the main part of the front page.
            case FRONTPAGENEWS:
                if ($SITE->newsitems) { // Print forums only when needed
예제 #2
0
파일: view.php 프로젝트: nicusX/moodle
if (!($sections = $modinfo->get_section_info_all())) {
    // No sections found
    $section = new stdClass();
    $section->course = $course->id;
    // Create a default section.
    $section->section = 0;
    $section->visible = 1;
    $section->summaryformat = FORMAT_HTML;
    $section->id = $DB->insert_record('course_sections', $section);
    rebuild_course_cache($course->id);
    $modinfo = get_fast_modinfo($COURSE);
    if (!($sections = $modinfo->get_section_info_all())) {
        // Try again
        print_error('cannotcreateorfindstructs', 'error');
    }
}
// CAUTION, hacky fundamental variable defintion to follow!
// Note that because of the way course fromats are constructed though
// inclusion we pass parameters around this way..
$displaysection = $section;
// Include the actual course format.
require $CFG->dirroot . '/course/format/' . $course->format . '/format.php';
// Content wrapper end.
echo html_writer::end_tag('div');
// Include course AJAX
if (include_course_ajax($course, $modnamesused)) {
    // Add the module chooser
    $renderer = $PAGE->get_renderer('core', 'course');
    echo $renderer->course_modchooser(get_module_metadata($course, $modnames), $course);
}
echo $OUTPUT->footer();
예제 #3
0
if ($completion->is_enabled()) {
    // This value tracks whether there has been a dynamic change to the page.
    // It is used so that if a user does this - (a) set some tickmarks, (b)
    // go to another page, (c) clicks Back button - the page will
    // automatically reload. Otherwise it would start with the wrong tick
    // values.
    echo html_writer::start_tag('form', array('action' => '.', 'method' => 'get'));
    echo html_writer::start_tag('div');
    echo html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'completion_dynamic_change', 'name' => 'completion_dynamic_change', 'value' => '0'));
    echo html_writer::end_tag('div');
    echo html_writer::end_tag('form');
}
// Course wrapper start.
echo html_writer::start_tag('div', array('class' => 'course-content'));
$modinfo = get_fast_modinfo($COURSE);
if (!($sections = $subpage->get_sections())) {
    // No sections found
    // Double-check to be extra sure.
    $subpage->add_section();
    if (!($sections = $subpage->get_sections())) {
        // Try again.
        print_error('cannotcreateorfindstructs', 'error');
    }
}
$renderer = $PAGE->get_renderer('mod_subpage');
echo $renderer->render_subpage($subpage, $modinfo, $sections, $PAGE->user_is_editing(), $move, has_capability('moodle/course:movesections', $modcontext), has_capability('moodle/course:sectionvisibility', $modcontext));
// Content wrapper end.
echo html_writer::end_tag('div');
$modnamesused = $modinfo->get_used_module_names();
include_course_ajax($COURSE, $modnamesused);
echo $OUTPUT->footer();