load(); if ($course && $course->getType() == 'course' && $course->canEdit()) { $input_values = array(); $input_values['title'] = $title; $input_values['description'] = $description; $input_values['start'] = $start; $input_values['end'] = $end; $input_values['applyuntil'] = $applyuntil; $input_values['provider'] = $provider; $input_values['identifier'] = $identifier; $input_values['credits'] = $credits; $input_values['permission'] = $permission; $input_values['enrollment_procedure'] = $enrollment_procedure; $input_values['education_level'] = $education_level; $input_values['language_of_instruction'] = $language_of_instruction; $input_values['attendance_mode'] = $attendance_mode; $input_values['objective'] = $objective; $input_values['assessment'] = $assessment; $input_values['prerequisite'] = $prerequisite; $input_values['course_tag'] = $course_tag; $input_values['image'] = $image; $input_values['status'] = $status; $_SESSION['input_values'] = $input_values; if (empty($title) || empty($start) || empty($end)) { $Dippler->add_system_message(_("At least one of the parameters is empty."), 'error'); forward("course/info/{$id}/edit"); } else { if (!check_credits($credits)) { $Dippler->add_system_message(_("Credits has to be a numeric value."), 'error'); forward("course/info/{$id}/edit"); } $course->title = $title; $course->description = $description; $course->start = date_into_timestamp($start); $course->end = date_into_timestamp($end); $course->applyuntil = date_into_timestamp($applyuntil); $course->provider = $provider; $course->identifier = $identifier; $course->credits = $credits; $course->permission = $permission; $course->enrollment_procedure = $enrollment_procedure; $course->education_level = $education_level; $course->language_of_instruction = $language_of_instruction; $course->attendance_mode = $attendance_mode; $course->objective = $objective; $course->assessment = $assessment; $course->prerequisite = $prerequisite; $course->course_tag = $course_tag; if ($image_delete) $course->course_image_delete = 1; if (isset($_FILES['course_image'])) { $course->setImageFile($_FILES['course_image']); } $course->status = $status; if (!$course->save()) { $Dippler->add_system_message(_("Course could not be saved."), 'error'); forward("course/info/{$id}/edit"); } $Dippler->add_system_message(_("Course saved.")); // Clear cache $Dippler->clearSessionInputValues(); forward($course->getURL("info")); } } // Clear cahce $Dippler->clearSessionInputValues(); forward(""); ?>