|
|
|
@ -137,25 +137,25 @@ if ($form->validate()) { |
|
|
|
|
$course_language = $course['course_language']; |
|
|
|
|
$exemplary_content = empty($course['exemplary_content']) ? false : true; |
|
|
|
|
$disk_quota = $course['disk_quota']; |
|
|
|
|
if (stripos($department_url, 'http://') === false) { |
|
|
|
|
if (stripos($department_url, 'http://') === false && stripos($department_url, 'https://') === false) { |
|
|
|
|
$department_url = 'http://'.$department_url; |
|
|
|
|
} |
|
|
|
|
if (trim($code) == '') { |
|
|
|
|
$code = generate_course_code(api_substr($title, 0, $maxlength)); |
|
|
|
|
} |
|
|
|
|
$keys = define_course_keys($code, '', $_configuration['db_prefix']); |
|
|
|
|
if (sizeof($keys)) { |
|
|
|
|
$currentCourseCode = $keys['currentCourseCode']; |
|
|
|
|
$currentCourseId = $keys['currentCourseId']; |
|
|
|
|
$currentCourseDbName = $keys['currentCourseDbName']; |
|
|
|
|
$currentCourseRepository = $keys['currentCourseRepository']; |
|
|
|
|
if (count($keys)) { |
|
|
|
|
$current_course_code = $keys['currentCourseCode']; |
|
|
|
|
$current_course_id = $keys['currentCourseId']; |
|
|
|
|
$current_course_db_name = $keys['currentCourseDbName']; |
|
|
|
|
$current_course_repository = $keys['currentCourseRepository']; |
|
|
|
|
$expiration_date = time() + $firstExpirationDelay; |
|
|
|
|
prepare_course_repository($currentCourseRepository, $currentCourseId); |
|
|
|
|
update_Db_course($currentCourseDbName, $course_language); |
|
|
|
|
$pictures_array=fill_course_repository($currentCourseRepository, $exemplary_content); |
|
|
|
|
fill_Db_course($currentCourseDbName, $currentCourseRepository, $course_language,$pictures_array, $exemplary_content); |
|
|
|
|
register_course($currentCourseId, $currentCourseCode, $currentCourseRepository, $currentCourseDbName, $tutor_name, $category, $title, $course_language, $teacher_id, $expiration_date, $course_teachers); |
|
|
|
|
$sql = "UPDATE $table_course SET disk_quota = '".$disk_quota."', visibility = '".Database::escape_string($course['visibility'])."', subscribe = '".Database::escape_string($course['subscribe'])."', unsubscribe='".Database::escape_string($course['unsubscribe'])."' WHERE code = '".$currentCourseId."'"; |
|
|
|
|
prepare_course_repository($current_course_repository, $current_course_id); |
|
|
|
|
update_Db_course($current_course_db_name); |
|
|
|
|
$pictures_array = fill_course_repository($current_course_repository, $exemplary_content); |
|
|
|
|
fill_Db_course($current_course_db_name, $current_course_repository, $course_language, $pictures_array, $exemplary_content); |
|
|
|
|
register_course($current_course_id, $current_course_code, $current_course_repository, $current_course_db_name, $tutor_name, $category, $title, $course_language, $teacher_id, $expiration_date, $course_teachers); |
|
|
|
|
$sql = "UPDATE $table_course SET disk_quota = '".$disk_quota."', visibility = '".Database::escape_string($course['visibility'])."', subscribe = '".Database::escape_string($course['subscribe'])."', unsubscribe='".Database::escape_string($course['unsubscribe'])."' WHERE code = '".$current_course_id."'"; |
|
|
|
|
Database::query($sql); |
|
|
|
|
header('Location: course_list.php'); |
|
|
|
|
exit (); |
|
|
|
|