|
|
|
@ -29,7 +29,7 @@ $this_section = SECTION_COURSES; |
|
|
|
|
|
|
|
|
|
// "Course validation" feature. This value affects the way of a new course creation: |
|
|
|
|
// true - the new course is requested only and it is created after approval; |
|
|
|
|
// false - the new course is created immedialely, after filling this form. |
|
|
|
|
// false - the new course is created immediately, after filling this form. |
|
|
|
|
$course_validation_feature = api_get_setting('course_validation') == 'true'; |
|
|
|
|
|
|
|
|
|
// Require additional libraries. |
|
|
|
@ -98,34 +98,23 @@ $form->applyFilter('category_code', 'html_filter'); |
|
|
|
|
$categories_select->addOption('-', ''); |
|
|
|
|
CourseManager::select_and_sort_categories($categories_select); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Course code |
|
|
|
|
$form->add_textfield('wanted_code', array(get_lang('Code'), get_lang('OnlyLettersAndNumbers')), '', array('class' => 'span3', 'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE)); |
|
|
|
|
$form->applyFilter('wanted_code', 'html_filter'); |
|
|
|
|
$form->addRule('wanted_code', get_lang('Max'), 'maxlength', CourseManager::MAX_COURSE_LENGTH_CODE); |
|
|
|
|
|
|
|
|
|
/*if ($course_validation_feature) { |
|
|
|
|
$form->addRule('wanted_code', get_lang('ThisFieldIsRequired'), 'required'); |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
// The teacher |
|
|
|
|
//get_lang('ExplicationTrainers') |
|
|
|
|
$titular = & $form->addElement('hidden', 'tutor_name', ''); //array(get_lang('Professor'), null), null, array('size' => '60', 'disabled' => 'disabled')); |
|
|
|
|
//$form->applyFilter('tutor_name', 'html_filter'); |
|
|
|
|
|
|
|
|
|
if ($course_validation_feature) { |
|
|
|
|
|
|
|
|
|
// Description of the requested course. |
|
|
|
|
$form->addElement('textarea', 'description', get_lang('Description'), array('class' => 'span6', 'rows' => '3')); |
|
|
|
|
//$form->addRule('description', get_lang('ThisFieldIsRequired'), 'required'); |
|
|
|
|
|
|
|
|
|
// Objectives of the requested course. |
|
|
|
|
$form->addElement('textarea', 'objetives', get_lang('Objectives'), array('class' => 'span6', 'rows' => '3')); |
|
|
|
|
//$form->addRule('objetives', get_lang('ThisFieldIsRequired'), 'required'); |
|
|
|
|
|
|
|
|
|
// Target audience of the requested course. |
|
|
|
|
$form->addElement('textarea', 'target_audience', get_lang('TargetAudience'), array('class' => 'span6', 'rows' => '3')); |
|
|
|
|
//$form->addRule('target_audience', get_lang('ThisFieldIsRequired'), 'required'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Course language. |
|
|
|
@ -276,8 +265,6 @@ if ($form->validate()) { |
|
|
|
|
$content = $form->return_form(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$tpl->assign('actions', $actions); |
|
|
|
|
$tpl->assign('message', $message); |
|
|
|
|
$tpl->assign('content', $content); |
|
|
|
|