Пример #1
0
}
if (!is_null($course->sourceCourseId) && !empty($course->sourceCourseId)) {
    $sourceCourse = new claroCourse();
    $sourceCourse->load(claroCourse::getCodeFromId($course->sourceCourseId));
    if ($sourceCourse->sourceCourseId) {
        claro_die(get_lang('You cannot create a course session from another course session'));
    }
    $course->categories = $sourceCourse->categories;
}
if ($adminContext && claro_is_platform_admin()) {
    // From admin, add param to form
    $course->addHtmlParam('adminContext', '1');
}
if (claro_is_platform_admin() || get_conf('courseCreationAllowed', true)) {
    if ($cmd == 'exEdit') {
        $course->handleForm();
        if ($course->validate()) {
            if ($course->save()) {
                // include the platform language file with all language variables
                language::load_translation();
                language::load_locale_settings();
                $course->mailAdministratorOnCourseCreation($thisUser['firstName'], $thisUser['lastName'], $thisUser['mail']);
                $dialogBox->success(get_lang('You have just created the course website') . ' : ' . '<strong>' . $course->officialCode . '</strong>');
                $display = DISP_COURSE_CREATION_SUCCEED;
            } else {
                $dialogBox->error($course->backlog->output());
                $display = DISP_COURSE_CREATION_FAILED;
            }
        } else {
            $dialogBox->error($course->backlog->output());
            $display = DISP_COURSE_CREATION_FAILED;