diff --git a/main/course_info/infocours.php b/main/course_info/infocours.php index c75ed94414..c6f5cb9137 100644 --- a/main/course_info/infocours.php +++ b/main/course_info/infocours.php @@ -128,7 +128,6 @@ if (file_exists($course_path.'/course-pic85x85.png')) { } $form->addElement('html', $image_html); - $form->add_textfield('title', get_lang('Title'), true, array('class' => 'span6')); $form->applyFilter('title', 'html_filter'); $form->applyFilter('title', 'trim'); @@ -344,7 +343,6 @@ $form->addGroup($group, '', array(get_lang("ShowSystemFolders")), ''); $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"'); $form->addElement('html', ''); - // Certificate settings if (api_get_setting('allow_public_certificates')=='true') { $form->addElement('html', '

'.Display::return_icon('certificate.png', Security::remove_XSS(get_lang('Certificates')),'',ICON_SIZE_SMALL).' '.Security::remove_XSS(get_lang('Certificates')).'

'); @@ -363,7 +361,7 @@ $app_plugin = new AppPlugin(); $app_plugin->add_course_settings_form($form); // Get all the course information -$all_course_information = CourseManager::get_course_information($_course['sysCode']); +$all_course_information = CourseManager::get_course_information($_course['sysCode']); // Set the default values of the form $values = array(); @@ -386,7 +384,6 @@ $courseSettings = CourseManager::getCourseSettingVariables(); foreach ($courseSettings as $setting) { $values[$setting] = api_get_course_setting($setting); } - $app_plugin->set_course_settings_defaults($values); $form->setDefaults($values); @@ -395,21 +392,37 @@ $form->setDefaults($values); if ($form->validate() && is_settings_editable()) { $update_values = $form->exportValues(); - $pdf_export_watermark_path = $_FILES['pdf_export_watermark_path']; + $pdf_export_watermark_path = isset($_FILES['pdf_export_watermark_path']) ? $_FILES['pdf_export_watermark_path'] : null if (!empty($pdf_export_watermark_path['name'])) { - $pdf_export_watermark_path_result = PDF::upload_watermark($pdf_export_watermark_path['name'], $pdf_export_watermark_path['tmp_name'], $course_code); + $pdf_export_watermark_path_result = PDF::upload_watermark( + $pdf_export_watermark_path['name'], + $pdf_export_watermark_path['tmp_name'], + $course_code + ); unset($update_values['pdf_export_watermark_path']); } //Variables that will be saved in the TABLE_MAIN_COURSE table - $update_in_course_table = array('title', 'course_language','category_code','department_name', 'department_url','visibility', - 'subscribe', 'unsubscribe','tutor_name','course_registration_password', 'legal', 'activate_legal'); + $update_in_course_table = array( + 'title', + 'course_language', + 'category_code', + 'department_name', + 'department_url', + 'visibility', + 'subscribe', + 'unsubscribe', + 'tutor_name', + 'course_registration_password', + 'legal', + 'activate_legal' + ); foreach ($update_values as $index =>$value) { $update_values[$index] = Database::escape_string($value); } - unset($value); + $table_course = Database :: get_main_table(TABLE_MAIN_COURSE); $sql = "UPDATE $table_course SET title = '".$update_values['title']."', @@ -429,7 +442,11 @@ if ($form->validate() && is_settings_editable()) { // Insert/Updates course_settings table foreach ($courseSettings as $setting) { if (isset($update_values[$setting])) { - CourseManager::saveCourseConfigurationSetting($setting, $update_values[$setting], api_get_course_int_id()); + CourseManager::saveCourseConfigurationSetting( + $setting, + $update_values[$setting], + api_get_course_int_id() + ); } }