* @author Julio Montoya BeezNest 2011 Bug fixing * @package chamilo.course_progress */ // protect a course script api_protect_course_script(true); if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') { $header_form = get_lang('NewThematicAdvance'); if ($action == 'thematic_advance_edit') { $header_form = get_lang('EditThematicAdvance'); } if (!$start_date_error && !$duration_error) { $token = md5(uniqid(rand(),TRUE)); $_SESSION['thematic_advance_token'] = $token; } // display form $form = new FormValidator('thematic_advance','POST','index.php?action=thematic_advance_list&thematic_id='.$thematic_id.'&'.api_get_cidreq(),'','style="width: 100%;"'); $form->addElement('header', $header_form); $form->addElement('hidden', 'thematic_advance_token',$token); $form->addElement('hidden', 'action', $action); if (!empty($thematic_advance_id)) { $form->addElement('hidden', 'thematic_advance_id',$thematic_advance_id); } if (!empty($thematic_id)) { $form->addElement('hidden', 'thematic_id',$thematic_id); } $radios = array(); $radios[] = $form->createElement('radio', 'start_date_type', null, get_lang('StartDateFromAnAttendance'),'1',array('onclick' => 'check_per_attendance(this)', 'id'=>'from_attendance')); $radios[] = $form->createElement('radio', 'start_date_type', null, get_lang('StartDateCustom'),'2',array('onclick' => 'check_per_custom_date(this)', 'id'=>'custom_date')); $form->addGroup($radios, null, get_lang('StartDateOptions')); if (isset($thematic_advance_data['attendance_id']) && $thematic_advance_data['attendance_id'] == 0) { $form->addElement('html', '
'); } else { $form->addElement('html', ''); if (isset($thematic_advance_data['attendance_id']) && $thematic_advance_data['attendance_id'] == 0) { $form->addElement('html', '