From 16337504b15ed68840daaef04e9c0b8a02d555a0 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 26 Oct 2011 15:45:19 +0200 Subject: [PATCH] Fixing course settings page --- main/course_info/infocours.php | 134 +++++++++++++++++++-------------- 1 file changed, 78 insertions(+), 56 deletions(-) diff --git a/main/course_info/infocours.php b/main/course_info/infocours.php index 8974faf6d4..c887798c73 100644 --- a/main/course_info/infocours.php +++ b/main/course_info/infocours.php @@ -148,12 +148,9 @@ $form->applyFilter('visual_code', 'strtoupper');*/ $form->addElement('select', 'category_code', get_lang('Fac'), $categories, array('style'=>'width:350px', 'class'=>'chzn-select', 'id'=>'category_code')); - - $form->addElement('select_language', 'course_language', array(get_lang('Ln'), get_lang('TipLang'))); - $form->add_textfield('department_name', get_lang('Department'), false, array('size' => '60')); $form->applyFilter('department_name', 'trim'); @@ -184,20 +181,22 @@ $form->addElement('html', ''); $form->addElement('html', '

'.Display::return_icon('course.png', addslashes(get_lang('CourseAccess')),'','22').' '.addslashes(get_lang('CourseAccess')).'

'); -$form->addElement('radio', 'visibility', get_lang("CourseAccess"), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD); -$form->addElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM); -$form->addElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED); -$form->addElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED); -$form->addElement('static', null, null, get_lang("CourseAccessConfigTip")); -$form->addElement('html', $linebreak); +$group = array(); +$group[]= $form->createElement('radio', 'visibility', get_lang("CourseAccess"), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD); +$group[]= $form->createElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM); +$group[]= $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED); +$group[]= $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED); +$form->addGroup($group, '', array(get_lang("CourseAccess"), get_lang("CourseAccessConfigTip")), '
'); -$form->addElement('radio', 'subscribe', get_lang('Subscription'), get_lang('Allowed'), 1); -$form->addElement('radio', 'subscribe', null, get_lang('Denied'), 0); -$form->addElement('html', $linebreak); +$group = array(); +$group[]=$form->createElement('radio', 'subscribe', get_lang('Subscription'), get_lang('Allowed'), 1); +$group[]=$form->createElement('radio', 'subscribe', null, get_lang('Denied'), 0); +$form->addGroup($group, '', array(get_lang("Subscription")), '
'); -$form->addElement('radio', 'unsubscribe', get_lang('Unsubscription'), get_lang('AllowedToUnsubscribe'), 1); -$form->addElement('radio', 'unsubscribe', null, get_lang('NotAllowedToUnsubscribe'), 0); -$form->addElement('html', $linebreak); +$group = array(); +$group[]=$form->createElement('radio', 'unsubscribe', get_lang('Unsubscription'), get_lang('AllowedToUnsubscribe'), 1); +$group[]=$form->createElement('radio', 'unsubscribe', null, get_lang('NotAllowedToUnsubscribe'), 0); +$form->addGroup($group, '', array(get_lang("Unsubscription")), '
'); $form->add_textfield('course_registration_password', get_lang('CourseRegistrationPassword'), false, array('size' => '60')); @@ -210,35 +209,43 @@ $form->addElement('html', '
'); // EMAIL NOTIFICATIONS -$form->addElement('html', '

'.Display::return_icon('mail.png', addslashes(get_lang('EmailNotifications')),'','22').' '.addslashes(get_lang('EmailNotifications')).'

'); +$form->addElement('html', '

'.Display::return_icon('mail.png', addslashes(get_lang('EmailNotifications')),'','22').' '.addslashes(get_lang('EmailNotifications')).'

'); + +$group = array(); +$group[]=$form->createElement('radio', 'email_alert_to_teacher_on_new_user_in_course', get_lang('NewUserEmailAlert'), get_lang('NewUserEmailAlertEnable'), 1); +$group[]=$form->createElement('radio', 'email_alert_to_teacher_on_new_user_in_course', null, get_lang('NewUserEmailAlertToTeacharAndTutor'), 2); +$group[]=$form->createElement('radio', 'email_alert_to_teacher_on_new_user_in_course', null, get_lang('NewUserEmailAlertDisable'), 0); +$form->addGroup($group, '', array(get_lang("NewUserEmailAlert")), '
'); -$form->addElement('radio', 'email_alert_to_teacher_on_new_user_in_course', get_lang('NewUserEmailAlert'), get_lang('NewUserEmailAlertEnable'), 1); -$form->addElement('radio', 'email_alert_to_teacher_on_new_user_in_course', null, get_lang('NewUserEmailAlertToTeacharAndTutor'), 2); -$form->addElement('radio', 'email_alert_to_teacher_on_new_user_in_course', null, get_lang('NewUserEmailAlertDisable'), 0); -$form->addElement('html', $linebreak); +$group = array(); +$group[]=$form->createElement('radio', 'email_alert_students_on_new_homework', get_lang('NewHomeworkEmailAlert'), get_lang('NewHomeworkEmailAlertEnable'), 1); +$group[]=$form->createElement('radio', 'email_alert_students_on_new_homework', null, get_lang('NewHomeworkEmailAlertDisable'), 0); +$form->addGroup($group, '', array(get_lang("NewHomeworkEmailAlert")), '
'); -$form->addElement('radio', 'email_alert_students_on_new_homework', get_lang('NewHomeworkEmailAlert'), get_lang('NewHomeworkEmailAlertEnable'), 1); -$form->addElement('radio', 'email_alert_students_on_new_homework', null, get_lang('NewHomeworkEmailAlertDisable'), 0); -$form->addElement('html', $linebreak); +$group = array(); +$group[]=$form->createElement('radio', 'email_alert_manager_on_new_doc', get_lang('WorkEmailAlert'), get_lang('WorkEmailAlertActivate'), 1); +$group[]=$form->createElement('radio', 'email_alert_manager_on_new_doc', null, get_lang('WorkEmailAlertDeactivate'), 0); +$form->addGroup($group, '', array(get_lang("WorkEmailAlert")), '
'); -$form->addElement('radio', 'email_alert_manager_on_new_doc', get_lang('WorkEmailAlert'), get_lang('WorkEmailAlertActivate'), 1); -$form->addElement('radio', 'email_alert_manager_on_new_doc', null, get_lang('WorkEmailAlertDeactivate'), 0); -$form->addElement('html', $linebreak); -$form->addElement('radio', 'email_alert_on_new_doc_dropbox', get_lang('DropboxEmailAlert'), get_lang('DropboxEmailAlertActivate'), 1); -$form->addElement('radio', 'email_alert_on_new_doc_dropbox', null, get_lang('DropboxEmailAlertDeactivate'), 0); -$form->addElement('html', $linebreak); +$group = array(); +$group[]=$form->createElement('radio', 'email_alert_on_new_doc_dropbox', get_lang('DropboxEmailAlert'), get_lang('DropboxEmailAlertActivate'), 1); +$group[]=$form->createElement('radio', 'email_alert_on_new_doc_dropbox', null, get_lang('DropboxEmailAlertDeactivate'), 0); +$form->addGroup($group, '', array(get_lang("DropboxEmailAlert")), '
'); + +$group = array(); +$group[]=$form->createElement('radio', 'email_alert_manager_on_new_quiz', get_lang('QuizEmailAlert'), get_lang('QuizEmailAlertActivate'), 1); +$group[]=$form->createElement('radio', 'email_alert_manager_on_new_quiz', null, get_lang('QuizEmailAlertDeactivate'), 0); +$form->addGroup($group, '', array(get_lang("QuizEmailAlert")), '
'); -$form->addElement('radio', 'email_alert_manager_on_new_quiz', get_lang('QuizEmailAlert'), get_lang('QuizEmailAlertActivate'), 1); -$form->addElement('radio', 'email_alert_manager_on_new_quiz', null, get_lang('QuizEmailAlertDeactivate'), 0); $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"'); $form->addElement('html', '
'); - // Gradebook SETTINGS $form->addElement('html', '

'.Display::return_icon('gradebook.png', addslashes(get_lang('Gradebook')),'','22').' '.addslashes(get_lang('Gradebook')).'

'); + $group = array(); $models = api_get_settings_options('grading_model'); if (!empty($models )) { @@ -260,20 +267,27 @@ $form->addElement('html', '
'); // USER RIGHTS $form->addElement('html', '

'.Display::return_icon('user.png', addslashes(get_lang('UserRights')),'','22').' '.addslashes(get_lang('UserRights')).'

'); -$form->addElement('radio', 'allow_user_edit_agenda', get_lang('AllowUserEditAgenda'), get_lang('AllowUserEditAgendaActivate'), 1); -$form->addElement('radio', 'allow_user_edit_agenda', null, get_lang('AllowUserEditAgendaDeactivate'), 0); -$form->addElement('html', $linebreak); -$form->addElement('radio', 'allow_user_edit_announcement', get_lang('AllowUserEditAnnouncement'), get_lang('AllowUserEditAnnouncementActivate'), 1); -$form->addElement('radio', 'allow_user_edit_announcement', null, get_lang('AllowUserEditAnnouncementDeactivate'), 0); -$form->addElement('html', $linebreak); +$group = array(); +$group[]=$form->createElement('radio', 'allow_user_edit_agenda', get_lang('AllowUserEditAgenda'), get_lang('AllowUserEditAgendaActivate'), 1); +$group[]=$form->createElement('radio', 'allow_user_edit_agenda', null, get_lang('AllowUserEditAgendaDeactivate'), 0); +$form->addGroup($group, '', array(get_lang("AllowUserEditAgenda")), '
'); + +$group = array(); +$group[]=$form->createElement('radio', 'allow_user_edit_announcement', get_lang('AllowUserEditAnnouncement'), get_lang('AllowUserEditAnnouncementActivate'), 1); +$group[]=$form->createElement('radio', 'allow_user_edit_announcement', null, get_lang('AllowUserEditAnnouncementDeactivate'), 0); +$form->addGroup($group, '', array(get_lang("AllowUserEditAnnouncement")), '
'); -$form->addElement('radio', 'allow_user_image_forum', get_lang('AllowUserImageForum'), get_lang('AllowUserImageForumActivate'), 1); -$form->addElement('radio', 'allow_user_image_forum', null, get_lang('AllowUserImageForumDeactivate'), 0); -$form->addElement('html', $linebreak); +$group = array(); +$group[]=$form->createElement('radio', 'allow_user_image_forum', get_lang('AllowUserImageForum'), get_lang('AllowUserImageForumActivate'), 1); +$group[]=$form->createElement('radio', 'allow_user_image_forum', null, get_lang('AllowUserImageForumDeactivate'), 0); +$form->addGroup($group, '', array(get_lang("AllowUserImageForum")), '
'); + +$group = array(); +$group[]=$form->createElement('radio', 'allow_user_view_user_list', get_lang('AllowUserViewUserList'), get_lang('AllowUserViewUserListActivate'), 1); +$group[]=$form->createElement('radio', 'allow_user_view_user_list', null, get_lang('AllowUserViewUserListDeactivate'), 0); +$form->addGroup($group, '', array(get_lang("AllowUserViewUserList")), '
'); -$form->addElement('radio', 'allow_user_view_user_list', get_lang('AllowUserViewUserList'), get_lang('AllowUserViewUserListActivate'), 1); -$form->addElement('radio', 'allow_user_view_user_list', null, get_lang('AllowUserViewUserListDeactivate'), 0); $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"'); $form->addElement('html', '
'); @@ -281,8 +295,12 @@ $form->addElement('html', '
'); // CHAT SETTINGS $form->addElement('html', '

'.Display::return_icon('chat.png', addslashes(get_lang('ConfigChat')),'','22').' '.addslashes(get_lang('ConfigChat')).'

'); -$form->addElement('radio', 'allow_open_chat_window', get_lang('AllowOpenchatWindow'), get_lang('AllowOpenChatWindowActivate'), 1); -$form->addElement('radio', 'allow_open_chat_window', null, get_lang('AllowOpenChatWindowDeactivate'), 0); + +$group = array(); +$group[]=$form->createElement('radio', 'allow_open_chat_window', get_lang('AllowOpenchatWindow'), get_lang('AllowOpenChatWindowActivate'), 1); +$group[]=$form->createElement('radio', 'allow_open_chat_window', null, get_lang('AllowOpenChatWindowDeactivate'), 0); +$form->addGroup($group, '', array(get_lang("AllowOpenchatWindow")), '
'); + $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"'); $form->addElement('html', '
'); @@ -290,17 +308,19 @@ $form->addElement('html', ''); // LEARNING PATH $form->addElement('html', '

'.Display::return_icon('scorms.png', addslashes(get_lang('ConfigLearnpath')),'','22').' '.addslashes(get_lang('ConfigLearnpath')).'

'); - //Auto launch LP -$form->addElement('radio', 'enable_lp_auto_launch', get_lang('LPAutoLaunch'), get_lang('RedirectToALearningPath'), 1); -$form->addElement('radio', 'enable_lp_auto_launch', get_lang('LPAutoLaunch'), get_lang('RedirectToTheLearningPathList'), 2); -$form->addElement('radio', 'enable_lp_auto_launch', null, get_lang('Deactivate'), 0); -$form -> addElement('html', $linebreak); +$group = array(); +$group[]=$form->createElement('radio', 'enable_lp_auto_launch', get_lang('LPAutoLaunch'), get_lang('RedirectToALearningPath'), 1); +$group[]=$form->createElement('radio', 'enable_lp_auto_launch', get_lang('LPAutoLaunch'), get_lang('RedirectToTheLearningPathList'), 2); +$group[]=$form->createElement('radio', 'enable_lp_auto_launch', null, get_lang('Deactivate'), 0); +$form->addGroup($group, '', array(get_lang("LPAutoLaunch")), '
'); if (api_get_setting('allow_course_theme') == 'true') { // Allow theme into Learning path - $form->addElement('radio', 'allow_learning_path_theme', get_lang('AllowLearningPathTheme'), get_lang('AllowLearningPathThemeAllow'), 1); - $form->addElement('radio', 'allow_learning_path_theme', null, get_lang('AllowLearningPathThemeDisallow'), 0); + $group = array(); + $group[]=$form->createElement('radio', 'allow_learning_path_theme', get_lang('AllowLearningPathTheme'), get_lang('AllowLearningPathThemeAllow'), 1); + $group[]=$form->createElement('radio', 'allow_learning_path_theme', null, get_lang('AllowLearningPathThemeDisallow'), 0); + $form->addGroup($group, '', array(get_lang("AllowLearningPathTheme")), '
'); $form->addElement('select_theme', 'course_theme', get_lang('Theme'), '', array('class'=>'chzn-select', 'id'=>'theme')); $form->applyFilter('course_theme', 'trim'); @@ -321,10 +341,12 @@ $form->addElement('html', '
'); // THEMATIC ADVANCE SETTINGS $form->addElement('html', '

'.Display::return_icon('course_progress.png', addslashes(get_lang('ThematicAdvanceConfiguration')),'','22').' '.addslashes(get_lang('ThematicAdvanceConfiguration')).'

'); -$form->addElement('radio', 'display_info_advance_inside_homecourse', get_lang('InfoAboutAdvanceInsideHomeCourse'), get_lang('DisplayAboutLastDoneAdvance'), 1); -$form->addElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DisplayAboutNextAdvanceNotDone'), 2); -$form->addElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DisplayAboutNextAdvanceNotDoneAndLastDoneAdvance'), 3); -$form->addElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DoNotDisplayAnyAdvance'), 0); +$group = array(); +$group[]=$form->createElement('radio', 'display_info_advance_inside_homecourse', get_lang('InfoAboutAdvanceInsideHomeCourse'), get_lang('DisplayAboutLastDoneAdvance'), 1); +$group[]=$form->createElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DisplayAboutNextAdvanceNotDone'), 2); +$group[]=$form->createElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DisplayAboutNextAdvanceNotDoneAndLastDoneAdvance'), 3); +$group[]=$form->createElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DoNotDisplayAnyAdvance'), 0); +$form->addGroup($group, '', array(get_lang("InfoAboutAdvanceInsideHomeCourse")), '
'); $form->addElement('style_submit_button', null, get_lang('SaveSettings'), 'class="save"');