@ -14,13 +14,11 @@ use Chamilo\CoreBundle\Framework\Container;
* @author Patrick Cool < patrick.cool @ UGent . be >
* @author Patrick Cool < patrick.cool @ UGent . be >
* @author Roan Embrechts, refactoring and improved course visibility|subscribe|unsubscribe options
* @author Roan Embrechts, refactoring and improved course visibility|subscribe|unsubscribe options
* @author Julio Montoya < gugli100 @ gmail . com > Jquery support + lots of fixes
* @author Julio Montoya < gugli100 @ gmail . com > Jquery support + lots of fixes
*
* @package chamilo.course_info
*/
*/
require_once __DIR__.'/../inc/global.inc.php';
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_COURSE_SETTING;
$current_course_tool = TOOL_COURSE_SETTING;
$this_section = SECTION_COURSES;
$this_section = SECTION_COURSES;
$nameTools = get_lang('ModifInfo ');
$nameTools = get_lang('Settings ');
api_protect_course_script(true);
api_protect_course_script(true);
api_block_anonymous_users();
api_block_anonymous_users();
$_course = api_get_course_info();
$_course = api_get_course_info();
@ -82,7 +80,7 @@ function card_settings_close()
return $html;
return $html;
}
}
$form->addHtml(card_settings_open('course_settings', get_lang('CourseS ettings'), true, 'settings.png', 'accordionSettings'));
$form->addHtml(card_settings_open('course_settings', get_lang('Course s ettings'), true, 'settings.png', 'accordionSettings'));
$image = '';
$image = '';
// Display course picture
// Display course picture
@ -101,13 +99,13 @@ $form->applyFilter('title', 'trim');
$form->addElement(
$form->addElement(
'select',
'select',
'category_code',
'category_code',
get_lang('Fac '),
get_lang('Category '),
$categories,
$categories,
['style' => 'width:350px', 'id' => 'category_code']
['style' => 'width:350px', 'id' => 'category_code']
);
);
$form->addSelectLanguage(
$form->addSelectLanguage(
'course_language',
'course_language',
[get_lang('Ln'), get_lang('TipLang ')]
[get_lang('Language'), get_lang('This language will be valid for every visitor of your courses portal ')]
);
);
$group = [
$group = [
@ -115,13 +113,13 @@ $group = [
$form->createElement('radio', 'show_course_in_user_language', null, get_lang('No'), 2),
$form->createElement('radio', 'show_course_in_user_language', null, get_lang('No'), 2),
];
];
$form->addGroup($group, '', [get_lang('ShowCourseInUserL anguage')]);
$form->addGroup($group, '', [get_lang('Show course in user\'s l anguage')]);
$form->addText('department_name', get_lang('Department'), false);
$form->addText('department_name', get_lang('Department'), false);
$form->applyFilter('department_name', 'html_filter');
$form->applyFilter('department_name', 'html_filter');
$form->applyFilter('department_name', 'trim');
$form->applyFilter('department_name', 'trim');
$form->addText('department_url', get_lang('DepartmentUrl '), false);
$form->addText('department_url', get_lang('Department URL '), false);
$form->applyFilter('department_url', 'html_filter');
$form->applyFilter('department_url', 'html_filter');
// Extra fields
// Extra fields
@ -150,7 +148,7 @@ $(function() {
// Picture
// Picture
$form->addFile(
$form->addFile(
'picture',
'picture',
get_lang('AddP icture'),
get_lang('Add a p icture'),
['id' => 'picture', 'class' => 'picture-form', 'crop_image' => true]
['id' => 'picture', 'class' => 'picture-form', 'crop_image' => true]
);
);
@ -160,18 +158,18 @@ $form->addHtml($image);
$form->addRule(
$form->addRule(
'picture',
'picture',
get_lang('OnlyImagesA llowed').' ('.implode(',', $allowed_picture_types).')',
get_lang('Only PNG, JPG or GIF images a llowed').' ('.implode(',', $allowed_picture_types).')',
'filetype',
'filetype',
$allowed_picture_types
$allowed_picture_types
);
);
$form->addElement('checkbox', 'delete_picture', null, get_lang('DeleteP icture'));
$form->addElement('checkbox', 'delete_picture', null, get_lang('Delete p icture'));
if (api_get_setting('pdf_export_watermark_by_course') == 'true') {
if (api_get_setting('pdf_export_watermark_by_course') == 'true') {
$url = PDF::get_watermark($course_code);
$url = PDF::get_watermark($course_code);
$form->addText('pdf_export_watermark_text', get_lang('PDFExportWatermarkTextTitle '), false, ['size' => '60']);
$form->addText('pdf_export_watermark_text', get_lang('PDF watermark text '), false, ['size' => '60']);
$form->addElement('file', 'pdf_export_watermark_path', get_lang('AddWaterMark '));
$form->addElement('file', 'pdf_export_watermark_path', get_lang('Upload a watermark image '));
if ($url != false) {
if ($url != false) {
$delete_url = '< a href = "?delete_watermark" > '.Display::return_icon('delete.png', get_lang('DelImag e')).'< / a > ';
$delete_url = '< a href = "?delete_watermark" > '.Display::return_icon('delete.png', get_lang('Remove pictur e')).'< / a > ';
$form->addElement(
$form->addElement(
'html',
'html',
'< div class = "row" > < div class = "form" > < a href = "'.$url.'" > '.$url.' '.$delete_url.'< / a > < / div > < / div > '
'< div class = "row" > < div class = "form" > < a href = "'.$url.'" > '.$url.' '.$delete_url.'< / a > < / div > < / div > '
@ -179,7 +177,7 @@ if (api_get_setting('pdf_export_watermark_by_course') == 'true') {
}
}
$form->addRule(
$form->addRule(
'pdf_export_watermark_path',
'pdf_export_watermark_path',
get_lang('OnlyImagesA llowed').' ('.implode(',', $allowed_picture_types).')',
get_lang('Only PNG, JPG or GIF images a llowed').' ('.implode(',', $allowed_picture_types).')',
'filetype',
'filetype',
$allowed_picture_types
$allowed_picture_types
);
);
@ -193,21 +191,21 @@ if (api_get_setting('allow_course_theme') == 'true') {
null,
null,
['id' => 'course_theme_id']
['id' => 'course_theme_id']
);
);
$form->addGroup($group, '', [get_lang('Stylesheets')]);
$form->addGroup($group, '', [get_lang('Style sheets')]);
}
}
$form->addElement('label', get_lang('DocumentQuota '), format_file_size(DocumentManager::get_course_quota()));
$form->addElement('label', get_lang('Space Available '), format_file_size(DocumentManager::get_course_quota()));
$scoreModels = ExerciseLib::getScoreModels();
$scoreModels = ExerciseLib::getScoreModels();
if (!empty($scoreModels)) {
if (!empty($scoreModels)) {
$options = ['' => get_lang('N one')];
$options = ['' => get_lang('n one')];
foreach ($scoreModels['models'] as $item) {
foreach ($scoreModels['models'] as $item) {
$options[$item['id']] = get_lang($item['name']);
$options[$item['id']] = get_lang($item['name']);
}
}
$form->addSelect('score_model_id', get_lang('ScoreM odel'), $options);
$form->addSelect('score_model_id', get_lang('Score m odel'), $options);
}
}
$form->addButtonSave(get_lang('SaveS ettings'), 'submit_save');
$form->addButtonSave(get_lang('Save s ettings'), 'submit_save');
$form->addHtml(card_settings_close());
$form->addHtml(card_settings_close());
@ -215,23 +213,23 @@ $group = [];
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'visibility',
'visibility',
get_lang('CourseA ccess'),
get_lang('Course a ccess'),
get_lang('OpenToTheW orld'),
get_lang('Public - access allowed for the whole w orld'),
COURSE_VISIBILITY_OPEN_WORLD
COURSE_VISIBILITY_OPEN_WORLD
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'visibility',
'visibility',
null,
null,
get_lang('OpenToTheP latform'),
get_lang(' Open - access allowed for users registered on the p latform'),
COURSE_VISIBILITY_OPEN_PLATFORM
COURSE_VISIBILITY_OPEN_PLATFORM
);
);
$group[] = $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED);
$group[] = $form->createElement('radio', 'visibility', null, get_lang('Private access (access authorized to group members only) '), COURSE_VISIBILITY_REGISTERED);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'visibility',
'visibility',
null,
null,
get_lang('CourseVisibilityClosed '),
get_lang('Closed - the course is only accessible to the teachers '),
COURSE_VISIBILITY_CLOSED
COURSE_VISIBILITY_CLOSED
);
);
@ -241,7 +239,7 @@ if (api_is_platform_admin()) {
'radio',
'radio',
'visibility',
'visibility',
null,
null,
get_lang('CourseVisibilityHidden '),
get_lang('Hidden - Completely hidden to all users except the administrators '),
COURSE_VISIBILITY_HIDDEN
COURSE_VISIBILITY_HIDDEN
);
);
}
}
@ -249,7 +247,7 @@ if (api_is_platform_admin()) {
$groupElement = $form->addGroup(
$groupElement = $form->addGroup(
$group,
$group,
'',
'',
[get_lang('CourseAccess'), get_lang('CourseA ccessConfigTip')],
[get_lang('Course access'), get_lang('Course a ccessConfigTip')],
null,
null,
null,
null,
true
true
@ -257,27 +255,27 @@ $groupElement = $form->addGroup(
$url = api_get_path(WEB_CODE_PATH)."auth/inscription.php?c=$course_code&e=1";
$url = api_get_path(WEB_CODE_PATH)."auth/inscription.php?c=$course_code&e=1";
$url = Display::url($url, $url);
$url = Display::url($url, $url);
$label = $form->addLabel(get_lang('DirectLink'), sprintf(get_lang('CourseSettingsRegisterDirectL ink'), $url), true);
$label = $form->addLabel(get_lang('Direct link'), sprintf(get_lang('Course settingsRegisterDirect l ink'), $url), true);
$group2 = [];
$group2 = [];
$group2[] = $form->createElement('radio', 'subscribe', get_lang('Subscription'), get_lang('Allowed'), 1);
$group2[] = $form->createElement('radio', 'subscribe', get_lang('Subscription'), get_lang('Allowed'), 1);
$group2[] = $form->createElement('radio', 'subscribe', null, get_lang('Denied '), 0);
$group2[] = $form->createElement('radio', 'subscribe', null, get_lang('This function is only available to trainers '), 0);
$myButton = $form->addButtonSave(get_lang('SaveS ettings'), 'submit_save', true);
$myButton = $form->addButtonSave(get_lang('Save s ettings'), 'submit_save', true);
$group3[] = $form->createElement(
$group3[] = $form->createElement(
'radio',
'radio',
'unsubscribe',
'unsubscribe',
get_lang('Unsubscription '),
get_lang('Unsubscribe '),
get_lang('AllowedToUnsubscrib e'),
get_lang('Users are allowed to unsubscribe from this cours e'),
1
1
);
);
$group3[] = $form->createElement('radio', 'unsubscribe', null, get_lang('NotAllowedToUnsubscrib e'), 0);
$group3[] = $form->createElement('radio', 'unsubscribe', null, get_lang('NotUsers are allowed to unsubscribe from this cours e'), 0);
$text = $form->createElement(
$text = $form->createElement(
'text',
'text',
'course_registration_password',
'course_registration_password',
get_lang('CourseRegistrationP assword'),
get_lang('Course registration p assword'),
false,
false,
['size' => '60']
['size' => '60']
);
);
@ -285,16 +283,16 @@ $text = $form->createElement(
$checkBoxActiveLegal = $form->createElement(
$checkBoxActiveLegal = $form->createElement(
'checkbox',
'checkbox',
'activate_legal',
'activate_legal',
[null, get_lang('ShowALegalNoticeWhenEnteringTheC ourse')],
[null, get_lang('Show a legal notice when entering the c ourse')],
get_lang('ActivateLegal ')
get_lang('Enable legal terms ')
);
);
$textAreaLegal = $form->createElement('textarea', 'legal', get_lang('CourseLegalAgreement '), ['rows' => 8]);
$textAreaLegal = $form->createElement('textarea', 'legal', get_lang('Legal agreement for this course '), ['rows' => 8]);
$elements = [
$elements = [
$groupElement,
$groupElement,
$label,
$label,
get_lang('Subscription') => $group2,
get_lang('Subscription') => $group2,
get_lang('Unsubscription ') => $group3,
get_lang('Unsubscribe ') => $group3,
$text,
$text,
$checkBoxActiveLegal,
$checkBoxActiveLegal,
$textAreaLegal,
$textAreaLegal,
@ -303,7 +301,7 @@ $elements = [
$form->addPanelOption(
$form->addPanelOption(
'course_access',
'course_access',
get_lang('CourseA ccess'),
get_lang('Course a ccess'),
$elements,
$elements,
'course.png',
'course.png',
false,
false,
@ -315,9 +313,9 @@ $globalGroup = [];
if (api_get_setting('documents_default_visibility_defined_in_course') == 'true') {
if (api_get_setting('documents_default_visibility_defined_in_course') == 'true') {
$group = [
$group = [
$form->createElement('radio', 'documents_default_visibility', null, get_lang('Visible'), 'visible'),
$form->createElement('radio', 'documents_default_visibility', null, get_lang('Visible'), 'visible'),
$form->createElement('radio', 'documents_default_visibility', null, get_lang('I nvisible'), 'invisible'),
$form->createElement('radio', 'documents_default_visibility', null, get_lang('i nvisible'), 'invisible'),
];
];
$globalGroup[get_lang('DocumentsDefaultVisibility ')] = $group;
$globalGroup[get_lang('Default visibility of new documents ')] = $group;
}
}
$group = [
$group = [
@ -325,20 +323,20 @@ $group = [
$form->createElement('radio', 'show_system_folders', null, get_lang('No'), 2),
$form->createElement('radio', 'show_system_folders', null, get_lang('No'), 2),
];
];
$globalGroup[get_lang('ShowSystemFolders ')] = $group;
$globalGroup[get_lang('Show system folders. ')] = $group;
$myButton = $form->addButtonSave(get_lang('SaveS ettings'), 'submit_save', true);
$myButton = $form->addButtonSave(get_lang('Save s ettings'), 'submit_save', true);
$group = [];
$group = [];
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'enable_document_auto_launch',
'enable_document_auto_launch',
get_lang('DocumentAutoLaunch '),
get_lang('Auto-launch for documents '),
get_lang('RedirectToTheDocumentL ist'),
get_lang('Redirect to the document l ist'),
1
1
);
);
$group[] = $form->createElement('radio', 'enable_document_auto_launch', null, get_lang('Deactivate'), 0);
$group[] = $form->createElement('radio', 'enable_document_auto_launch', null, get_lang('Deactivate'), 0);
$globalGroup[get_lang('DocumentAutoLaunch ')] = $group;
$globalGroup[get_lang('Auto-launch for documents ')] = $group;
$globalGroup[] = $myButton;
$globalGroup[] = $myButton;
@ -356,99 +354,99 @@ $group = [];
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_to_teacher_on_new_user_in_course',
'email_alert_to_teacher_on_new_user_in_course',
get_lang('NewUserEmailAlert '),
get_lang('E-mail teacher when a new user auto-subscribes '),
get_lang('NewUserEmailAlert Enable'),
get_lang('E-mail teacher when a new user auto-subscribes Enable'),
1
1
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_to_teacher_on_new_user_in_course',
'email_alert_to_teacher_on_new_user_in_course',
null,
null,
get_lang('NewUserEmailAlert ToTeacharAndTutor'),
get_lang('E-mail teacher when a new user auto-subscribes ToTeacharAndTutor'),
2
2
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_to_teacher_on_new_user_in_course',
'email_alert_to_teacher_on_new_user_in_course',
null,
null,
get_lang('NewUserEmailAlert Disable'),
get_lang('E-mail teacher when a new user auto-subscribes Disable'),
0
0
);
);
$globalGroup[get_lang('NewUserEmailAlert ')] = $group;
$globalGroup[get_lang('E-mail teacher when a new user auto-subscribes ')] = $group;
$group = [];
$group = [];
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_students_on_new_homework',
'email_alert_students_on_new_homework',
get_lang('NewHomeworkEmailAlert '),
get_lang('E-mail students on assignment creation '),
get_lang('NewHomeworkEmailAlert Enable'),
get_lang('E-mail students on assignment creation Enable'),
1
1
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_students_on_new_homework',
'email_alert_students_on_new_homework',
null,
null,
get_lang('NewHomeworkEmailAlert ToHrmEnable'),
get_lang('E-mail students on assignment creation ToHrmEnable'),
2
2
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_students_on_new_homework',
'email_alert_students_on_new_homework',
null,
null,
get_lang('NewHomeworkEmailAlert Disable'),
get_lang('E-mail students on assignment creation Disable'),
0
0
);
);
$globalGroup[get_lang('NewHomeworkEmailAlert ')] = $group;
$globalGroup[get_lang('E-mail students on assignment creation ')] = $group;
$group = [];
$group = [];
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_manager_on_new_doc',
'email_alert_manager_on_new_doc',
get_lang('WorkEmailAlert '),
get_lang('E-mail on assignments submission by students '),
get_lang('WorkEmailAlert Activate'),
get_lang('E-mail on assignments submission by students Activate'),
1
1
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_manager_on_new_doc',
'email_alert_manager_on_new_doc',
null,
null,
get_lang('WorkEmailAlert ActivateOnlyForTeachers'),
get_lang('E-mail on assignments submission by students ActivateOnlyForTeachers'),
3
3
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_manager_on_new_doc',
'email_alert_manager_on_new_doc',
null,
null,
get_lang('WorkEmailAlert ActivateOnlyForStudents'),
get_lang('E-mail on assignments submission by students ActivateOnlyForStudents'),
2
2
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_manager_on_new_doc',
'email_alert_manager_on_new_doc',
null,
null,
get_lang('WorkEmailAlert Deactivate'),
get_lang('E-mail on assignments submission by students Deactivate'),
0
0
);
);
$globalGroup[get_lang('WorkEmailAlert ')] = $group;
$globalGroup[get_lang('E-mail on assignments submission by students ')] = $group;
$group = [];
$group = [];
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_on_new_doc_dropbox',
'email_alert_on_new_doc_dropbox',
get_lang('DropboxEmailAlert '),
get_lang('E-mail users on dropbox file reception '),
get_lang('DropboxEmailAlert Activate'),
get_lang('E-mail users on dropbox file reception Activate'),
1
1
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_alert_on_new_doc_dropbox',
'email_alert_on_new_doc_dropbox',
null,
null,
get_lang('DropboxEmailAlert Deactivate'),
get_lang('E-mail users on dropbox file reception Deactivate'),
0
0
);
);
$globalGroup[get_lang('DropboxEmailAlert ')] = $group;
$globalGroup[get_lang('E-mail users on dropbox file reception ')] = $group;
// Exercises notifications
// Exercises notifications
$emailAlerts = ExerciseLib::getNotificationSettings();
$emailAlerts = ExerciseLib::getNotificationSettings();
@ -463,13 +461,13 @@ foreach ($emailAlerts as $itemId => $label) {
);
);
}
}
$globalGroup[get_lang('Exercise s')] = $group;
$globalGroup[get_lang('Test s')] = $group;
$group = [];
$group = [];
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'email_to_teachers_on_new_work_feedback',
'email_to_teachers_on_new_work_feedback',
get_lang('EmailToTeachersWhenNewWorkFeedback '),
get_lang('E-mail to teachers on new user\'s student publication feedback. '),
get_lang('Yes'),
get_lang('Yes'),
1
1
);
);
@ -481,14 +479,14 @@ $group[] = $form->createElement(
2
2
);
);
$globalGroup[get_lang('EmailToTeachersWhenNewWorkFeedback ')] = $group;
$globalGroup[get_lang('E-mail to teachers on new user\'s student publication feedback. ')] = $group;
$myButton = $form->addButtonSave(get_lang('SaveS ettings'), 'submit_save', true);
$myButton = $form->addButtonSave(get_lang('Save s ettings'), 'submit_save', true);
$globalGroup[] = $myButton;
$globalGroup[] = $myButton;
$form->addPanelOption(
$form->addPanelOption(
'email-notifications',
'email-notifications',
get_lang('EmailN otifications'),
get_lang('E-mail n otifications'),
$globalGroup,
$globalGroup,
'mail.png',
'mail.png',
false,
false,
@ -499,25 +497,25 @@ $group = [];
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'allow_user_edit_agenda',
'allow_user_edit_agenda',
get_lang('AllowUserEditA genda'),
get_lang('Allow learners to edit the a genda'),
get_lang('AllowUserEditA gendaActivate'),
get_lang('Allow learners to edit the a gendaActivate'),
1
1
);
);
$group[] = $form->createElement('radio', 'allow_user_edit_agenda', null, get_lang('AllowUserEditA gendaDeactivate'), 0);
$group[] = $form->createElement('radio', 'allow_user_edit_agenda', null, get_lang('Allow learners to edit the a gendaDeactivate'), 0);
$group2 = [];
$group2 = [];
$group2[] = $form->createElement(
$group2[] = $form->createElement(
'radio',
'radio',
'allow_user_edit_announcement',
'allow_user_edit_announcement',
get_lang('AllowUserEditAnnouncement '),
get_lang('Allow learners to edit announcements '),
get_lang('AllowUserEditAnnouncement Activate'),
get_lang('Allow learners to edit announcements Activate'),
1
1
);
);
$group2[] = $form->createElement(
$group2[] = $form->createElement(
'radio',
'radio',
'allow_user_edit_announcement',
'allow_user_edit_announcement',
null,
null,
get_lang('AllowUserEditAnnouncement Deactivate'),
get_lang('Allow learners to edit announcements Deactivate'),
0
0
);
);
@ -525,40 +523,40 @@ $group3 = [];
$group3[] = $form->createElement(
$group3[] = $form->createElement(
'radio',
'radio',
'allow_user_image_forum',
'allow_user_image_forum',
get_lang('AllowUserImageF orum'),
get_lang('User picture in f orum'),
get_lang('AllowUserImageF orumActivate'),
get_lang('User picture in f orumActivate'),
1
1
);
);
$group3[] = $form->createElement('radio', 'allow_user_image_forum', null, get_lang('AllowUserImageF orumDeactivate'), 0);
$group3[] = $form->createElement('radio', 'allow_user_image_forum', null, get_lang('User picture in f orumDeactivate'), 0);
$group4 = [];
$group4 = [];
$group4[] = $form->createElement(
$group4[] = $form->createElement(
'radio',
'radio',
'allow_user_view_user_list',
'allow_user_view_user_list',
get_lang('AllowUserViewUserL ist'),
get_lang('Allow user view user l ist'),
get_lang('AllowUserViewUserL istActivate'),
get_lang('Allow user view user l istActivate'),
1
1
);
);
$group4[] = $form->createElement(
$group4[] = $form->createElement(
'radio',
'radio',
'allow_user_view_user_list',
'allow_user_view_user_list',
null,
null,
get_lang('AllowUserViewUserL istDeactivate'),
get_lang('Allow user view user l istDeactivate'),
0
0
);
);
$myButton = $form->addButtonSave(get_lang('SaveS ettings'), 'submit_save', true);
$myButton = $form->addButtonSave(get_lang('Save s ettings'), 'submit_save', true);
$globalGroup = [
$globalGroup = [
get_lang('AllowUserEditA genda') => $group,
get_lang('Allow learners to edit the a genda') => $group,
get_lang('AllowUserEditAnnouncement ') => $group2,
get_lang('Allow learners to edit announcements ') => $group2,
get_lang('AllowUserImageF orum') => $group3,
get_lang('User picture in f orum') => $group3,
get_lang('AllowUserViewUserL ist') => $group4,
get_lang('Allow user view user l ist') => $group4,
'' => $myButton,
'' => $myButton,
];
];
$form->addPanelOption(
$form->addPanelOption(
'users',
'users',
get_lang('UserR ights'),
get_lang('User r ights'),
$globalGroup,
$globalGroup,
'user.png',
'user.png',
false,
false,
@ -570,21 +568,21 @@ $group = [];
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'allow_open_chat_window',
'allow_open_chat_window',
get_lang('Allow OpenchatWindow'),
get_lang('Open chat in a new Window'),
get_lang('AllowOpenChatWindowActivate '),
get_lang('Activate open the chat in a new window '),
1
1
);
);
$group[] = $form->createElement('radio', 'allow_open_chat_window', null, get_lang('AllowOpenChatWindowDeactivate '), 0);
$group[] = $form->createElement('radio', 'allow_open_chat_window', null, get_lang('Deactivate open the chat in a new window '), 0);
$myButton = $form->addButtonSave(get_lang('SaveS ettings'), 'submit_save', true);
$myButton = $form->addButtonSave(get_lang('Save s ettings'), 'submit_save', true);
$globalGroup = [
$globalGroup = [
get_lang('Allow OpenchatWindow') => $group,
get_lang('Open chat in a new Window') => $group,
'' => $myButton,
'' => $myButton,
];
];
$form->addPanelOption(
$form->addPanelOption(
'chat',
'chat',
get_lang('ConfigC hat'),
get_lang('Chat settings '),
$globalGroup,
$globalGroup,
'chat.png',
'chat.png',
false,
false,
@ -596,20 +594,20 @@ $group = [];
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'enable_lp_auto_launch',
'enable_lp_auto_launch',
get_lang('LPAutoL aunch'),
get_lang('Enable learning path auto-l aunch'),
get_lang('RedirectToALearningP ath'),
get_lang('Redirect to a selected learning p ath'),
1
1
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'enable_lp_auto_launch',
'enable_lp_auto_launch',
get_lang('LPAutoL aunch'),
get_lang('Enable learning path auto-l aunch'),
get_lang('RedirectToTheLearningPathL ist'),
get_lang('Redirect to the learning paths l ist'),
2
2
);
);
$group[] = $form->createElement('radio', 'enable_lp_auto_launch', null, get_lang('Deactivate'), 0);
$group[] = $form->createElement('radio', 'enable_lp_auto_launch', null, get_lang('Deactivate'), 0);
$globalGroup[get_lang('LPAutoL aunch')] = $group;
$globalGroup[get_lang('Enable learning path auto-l aunch')] = $group;
if (api_get_setting('allow_course_theme') == 'true') {
if (api_get_setting('allow_course_theme') == 'true') {
// Allow theme into Learning path
// Allow theme into Learning path
@ -617,19 +615,19 @@ if (api_get_setting('allow_course_theme') == 'true') {
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'allow_learning_path_theme',
'allow_learning_path_theme',
get_lang('AllowLearningPathTheme '),
get_lang('Enable course themes '),
get_lang('AllowLearningPathTheme Allow'),
get_lang('Enable course themes Allow'),
1
1
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'allow_learning_path_theme',
'allow_learning_path_theme',
null,
null,
get_lang('AllowLearningPathTheme Disallow'),
get_lang('Enable course themes Disallow'),
0
0
);
);
$globalGroup[get_lang("AllowLearningPathTheme ")] = $group;
$globalGroup[get_lang("Enable course themes ")] = $group;
}
}
$allowLPReturnLink = api_get_setting('allow_lp_return_link');
$allowLPReturnLink = api_get_setting('allow_lp_return_link');
@ -638,26 +636,26 @@ if ($allowLPReturnLink === 'true') {
$form->createElement(
$form->createElement(
'radio',
'radio',
'lp_return_link',
'lp_return_link',
get_lang('LpReturnL ink'),
get_lang('Learning path return l ink'),
get_lang('RedirectToTheLearningPathL ist'),
get_lang('Redirect to the learning paths l ist'),
1
1
),
),
$form->createElement(
$form->createElement(
'radio',
'radio',
'lp_return_link',
'lp_return_link',
null,
null,
get_lang('RedirectToCourseH ome'),
get_lang('Redirect to Course h ome'),
0
0
),
),
$form->createElement(
$form->createElement(
'radio',
'radio',
'lp_return_link',
'lp_return_link',
null,
null,
get_lang('MyC ourses'),
get_lang('My c ourses'),
2
2
),
),
];
];
$globalGroup[get_lang("LpReturnL ink")] = $group;
$globalGroup[get_lang("Learning path return l ink")] = $group;
}
}
$exerciseInvisible = api_get_setting('exercise_invisible_in_session');
$exerciseInvisible = api_get_setting('exercise_invisible_in_session');
@ -670,7 +668,7 @@ if ($exerciseInvisible === 'true' &&
$form->createElement(
$form->createElement(
'radio',
'radio',
'exercise_invisible_in_session',
'exercise_invisible_in_session',
get_lang('ExerciseI nvisibleInSession'),
get_lang('Testi nvisibleInSession'),
get_lang('Yes'),
get_lang('Yes'),
1
1
),
),
@ -683,11 +681,11 @@ if ($exerciseInvisible === 'true' &&
),
),
];
];
$globalGroup[get_lang("ExerciseI nvisibleInSession")] = $group;
$globalGroup[get_lang("Testi nvisibleInSession")] = $group;
}
}
if ($isEditable) {
if ($isEditable) {
$myButton = $form->addButtonSave(get_lang('SaveS ettings'), 'submit_save', true);
$myButton = $form->addButtonSave(get_lang('Save s ettings'), 'submit_save', true);
$globalGroup[] = $myButton;
$globalGroup[] = $myButton;
} else {
} else {
// Is it allowed to edit the course settings?
// Is it allowed to edit the course settings?
@ -699,7 +697,7 @@ if ($isEditable) {
$form->addPanelOption(
$form->addPanelOption(
'config_lp',
'config_lp',
get_lang('Config Learnpath'),
get_lang('Learning path settings '),
$globalGroup,
$globalGroup,
'scorms.png',
'scorms.png',
false,
false,
@ -714,23 +712,23 @@ if (api_get_configuration_value('allow_exercise_auto_launch')) {
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'enable_exercise_auto_launch',
'enable_exercise_auto_launch',
get_lang('ExerciseAutoLaunch '),
get_lang('Auto-launch for exercises '),
get_lang('RedirectToE xercise'),
get_lang('Redirect to the selected e xercise'),
1
1
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'enable_exercise_auto_launch',
'enable_exercise_auto_launch',
get_lang('ExerciseAutoLaunch '),
get_lang('Auto-launch for exercises '),
get_lang('RedirectToTheExerciseL ist'),
get_lang('Redirect to the exercises l ist'),
2
2
);
);
$group[] = $form->createElement('radio', 'enable_exercise_auto_launch', null, get_lang('Deactivate'), 0);
$group[] = $form->createElement('radio', 'enable_exercise_auto_launch', null, get_lang('Deactivate'), 0);
$globalGroup[get_lang("ExerciseAutoLaunch ")] = $group;
$globalGroup[get_lang("Auto-launch for exercises ")] = $group;
if ($isEditable) {
if ($isEditable) {
$myButton = $form->addButtonSave(get_lang('SaveS ettings'), 'submit_save', true);
$myButton = $form->addButtonSave(get_lang('Save s ettings'), 'submit_save', true);
$globalGroup[] = $myButton;
$globalGroup[] = $myButton;
} else {
} else {
// Is it allowed to edit the course settings?
// Is it allowed to edit the course settings?
@ -742,7 +740,7 @@ if (api_get_configuration_value('allow_exercise_auto_launch')) {
$form->addPanelOption(
$form->addPanelOption(
'config_exercise',
'config_exercise',
get_lang('Exercise '),
get_lang('Test '),
$globalGroup,
$globalGroup,
'quiz.png',
'quiz.png',
false,
false,
@ -755,41 +753,41 @@ $group = [];
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'display_info_advance_inside_homecourse',
'display_info_advance_inside_homecourse',
get_lang('InfoAboutAdvanceInsideHomeCours e'),
get_lang('Information on thematic advance on course homepag e'),
get_lang('DisplayAboutLastDoneAdvance '),
get_lang('Display information about the last completed topic '),
1
1
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'display_info_advance_inside_homecourse',
'display_info_advance_inside_homecourse',
null,
null,
get_lang('DisplayAboutNextAdvanceNotDone '),
get_lang('Display information about the next uncompleted topic '),
2
2
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'display_info_advance_inside_homecourse',
'display_info_advance_inside_homecourse',
null,
null,
get_lang('DisplayAboutNextAdvanceNotDone AndLastDoneAdvance'),
get_lang('Display information about the next uncompleted topic AndLastDoneAdvance'),
3
3
);
);
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'display_info_advance_inside_homecourse',
'display_info_advance_inside_homecourse',
null,
null,
get_lang('DoNotDisplayAnyAdvance '),
get_lang('Do not display progress '),
0
0
);
);
$myButton = $form->addButtonSave(get_lang('SaveS ettings'), 'submit_save', true);
$myButton = $form->addButtonSave(get_lang('Save s ettings'), 'submit_save', true);
$globalGroup = [
$globalGroup = [
get_lang('InfoAboutAdvanceInsideHomeCours e') => $group,
get_lang('Information on thematic advance on course homepag e') => $group,
'' => $myButton,
'' => $myButton,
];
];
$form->addPanelOption(
$form->addPanelOption(
'thematic',
'thematic',
get_lang('ThematicAdvanceC onfiguration'),
get_lang('Thematic advance c onfiguration'),
$globalGroup,
$globalGroup,
'course_progress.png',
'course_progress.png',
false,
false,
@ -801,15 +799,15 @@ if (api_get_setting('allow_public_certificates') === 'true') {
$group[] = $form->createElement(
$group[] = $form->createElement(
'radio',
'radio',
'allow_public_certificates',
'allow_public_certificates',
get_lang('AllowPublicCertificates '),
get_lang('Learner certificates are public '),
get_lang('Yes'),
get_lang('Yes'),
1
1
);
);
$group[] = $form->createElement('radio', 'allow_public_certificates', null, get_lang('No'), 0);
$group[] = $form->createElement('radio', 'allow_public_certificates', null, get_lang('No'), 0);
$myButton = $form->addButtonSave(get_lang('SaveS ettings'), 'submit_save', true);
$myButton = $form->addButtonSave(get_lang('Save s ettings'), 'submit_save', true);
$globalGroup = [
$globalGroup = [
get_lang('AllowPublicCertificates ') => $group,
get_lang('Learner certificates are public ') => $group,
'' => $myButton,
'' => $myButton,
];
];
@ -825,10 +823,10 @@ if (api_get_setting('allow_public_certificates') === 'true') {
// Forum settings
// Forum settings
$group = [
$group = [
$form->createElement('radio', 'enable_forum_auto_launch', null, get_lang('RedirectToForumL ist'), 1),
$form->createElement('radio', 'enable_forum_auto_launch', null, get_lang('Redirect to forums l ist'), 1),
$form->createElement('radio', 'enable_forum_auto_launch', null, get_lang('Disabled'), 2),
$form->createElement('radio', 'enable_forum_auto_launch', null, get_lang('Disabled'), 2),
];
];
$myButton = $form->addButtonSave(get_lang('SaveS ettings'), 'submit_save', true);
$myButton = $form->addButtonSave(get_lang('Save s ettings'), 'submit_save', true);
// Forum settings
// Forum settings
$groupNotification = [
$groupNotification = [
@ -842,9 +840,9 @@ $addUsers = [
];
];
$globalGroup = [
$globalGroup = [
get_lang('EnableForumAutoL aunch') => $group,
get_lang('Enable forum auto-l aunch') => $group,
get_lang('HideForumN otifications') => $groupNotification,
get_lang('Hide forum n otifications') => $groupNotification,
get_lang('SubscribeUsersToAllForumN otifications') => $addUsers,
get_lang('Subscribe automatically all users to all forum n otifications') => $addUsers,
'' => $myButton,
'' => $myButton,
];
];
@ -859,24 +857,24 @@ $form->addPanelOption(
// Student publication
// Student publication
$group = [
$group = [
$form->createElement('radio', 'show_score', null, get_lang('NewVisible '), 0),
$form->createElement('radio', 'show_score', null, get_lang('New documents are visible for all users '), 0),
$form->createElement('radio', 'show_score', null, get_lang('NewUnvisible '), 1),
$form->createElement('radio', 'show_score', null, get_lang('New documents are only visible for the teacher(s) '), 1),
];
];
$group2 = [
$group2 = [
$form->createElement('radio', 'student_delete_own_publication', null, get_lang('Yes'), 1),
$form->createElement('radio', 'student_delete_own_publication', null, get_lang('Yes'), 1),
$form->createElement('radio', 'student_delete_own_publication', null, get_lang('No'), 0),
$form->createElement('radio', 'student_delete_own_publication', null, get_lang('No'), 0),
];
];
$myButton = $form->addButtonSave(get_lang('SaveS ettings'), 'submit_save', true);
$myButton = $form->addButtonSave(get_lang('Save s ettings'), 'submit_save', true);
$globalGroup = [
$globalGroup = [
get_lang('DefaultUpload ') => $group,
get_lang('Default setting for the visibility of newly posted files ') => $group,
get_lang('StudentAllowedToDeleteOwnPublication ') => $group2,
get_lang('Allow learners to delete their own publications ') => $group2,
'' => $myButton,
'' => $myButton,
];
];
$form->addPanelOption(
$form->addPanelOption(
'student-publication',
'student-publication',
get_lang('StudentPublication s'),
get_lang('Assignment s'),
$globalGroup,
$globalGroup,
'work.png',
'work.png',
false,
false,
@ -979,7 +977,7 @@ if ($form->validate() && $isEditable) {
api_warn_hosting_contact('hosting_limit_active_courses');
api_warn_hosting_contact('hosting_limit_active_courses');
Display::addFlash(
Display::addFlash(
Display::return_message(get_lang('PortalActiveCoursesLimitReached '))
Display::return_message(get_lang('Sorry, this installation has an active courses limit, which has now been reached. You can still create new courses, but only if you hide/disable at least one existing active course. To do this, edit a course from the administration courses list, and change the visibility to \'hidden\', then try creating this course again. To increase the maximum number of active courses allowed on this Chamilo installation, please contact your hosting provider or, if available, upgrade to a superior hosting plan. '))
);
);
$url = api_get_path(WEB_CODE_PATH).'course_info/infocours.php?'.api_get_cidreq();
$url = api_get_path(WEB_CODE_PATH).'course_info/infocours.php?'.api_get_cidreq();
@ -1039,7 +1037,7 @@ if ($form->validate() && $isEditable) {
$courseParams = api_get_cidreq();
$courseParams = api_get_cidreq();
$cidReset = true;
$cidReset = true;
$cidReq = $course_code;
$cidReq = $course_code;
Display::addFlash(Display::return_message(get_lang('Updated ')));
Display::addFlash(Display::return_message(get_lang('Update successful ')));
$url = api_get_path(WEB_CODE_PATH).'course_info/infocours.php?'.$courseParams;
$url = api_get_path(WEB_CODE_PATH).'course_info/infocours.php?'.$courseParams;
header("Location: $url");
header("Location: $url");
@ -1048,7 +1046,7 @@ if ($form->validate() && $isEditable) {
if ($show_delete_watermark_text_message) {
if ($show_delete_watermark_text_message) {
Display::addFlash(
Display::addFlash(
Display::return_message(get_lang('FileD eleted'), 'normal')
Display::return_message(get_lang('File d eleted'), 'normal')
);
);
}
}