|
|
|
|
@ -32,7 +32,7 @@ $language_file = 'learnpath'; |
|
|
|
|
/* Header and action code */ |
|
|
|
|
|
|
|
|
|
$currentstyle = api_get_setting('stylesheets'); |
|
|
|
|
$htmlHeadXtra[] = '<script type="text/javascript"> |
|
|
|
|
$htmlHeadXtra[] = '<script> |
|
|
|
|
function setFocus(){ |
|
|
|
|
$("#learnpath_title").focus(); |
|
|
|
|
} |
|
|
|
|
@ -41,7 +41,6 @@ $(document).ready(function () { |
|
|
|
|
setFocus(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function advanced_parameters() { |
|
|
|
|
if(document.getElementById(\'options\').style.display == \'none\') { |
|
|
|
|
document.getElementById(\'options\').style.display = \'block\'; |
|
|
|
|
@ -52,7 +51,6 @@ function advanced_parameters() { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function activate_start_date() { |
|
|
|
|
if(document.getElementById(\'start_date_div\').style.display == \'none\') { |
|
|
|
|
document.getElementById(\'start_date_div\').style.display = \'block\'; |
|
|
|
|
@ -67,8 +65,7 @@ function activate_end_date() { |
|
|
|
|
} else { |
|
|
|
|
document.getElementById(\'end_date_div\').style.display = \'none\'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
</script>'; |
|
|
|
|
|
|
|
|
|
/* Constants and variables */ |
|
|
|
|
@ -86,7 +83,7 @@ if ($action == 'add' && $type == 'learnpathitem') { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ((!$is_allowed_to_edit) || ($isStudentView)) { |
|
|
|
|
error_log('New LP - User not authorized in lp_add.php'); |
|
|
|
|
//error_log('New LP - User not authorized in lp_add.php'); |
|
|
|
|
header('location:lp_controller.php?action=view&lp_id='.$learnpath_id); |
|
|
|
|
} |
|
|
|
|
// From here on, we are admin because of the previous condition, so don't check anymore. |
|
|
|
|
@ -120,7 +117,6 @@ if ($_POST AND empty($_REQUEST['lp_name'])) { |
|
|
|
|
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form = new FormValidator('lp_add', 'post', 'lp_controller.php'); |
|
|
|
|
|
|
|
|
|
// Form title |
|
|
|
|
@ -150,7 +146,6 @@ $form->addElement('html','<div id="end_date_div" style="display:none;">'); |
|
|
|
|
$form->addElement('datepicker', 'expired_on', get_lang('ExpirationDate'), array('form_name'=>'exercise_admin'), 5); |
|
|
|
|
$form->addElement('html','</div>'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form->addElement('html','</div>'); |
|
|
|
|
|
|
|
|
|
$defaults['activate_start_date_check'] = 1; |
|
|
|
|
@ -164,4 +159,4 @@ $form->addElement('style_submit_button', 'Submit',get_lang('CreateLearningPath') |
|
|
|
|
|
|
|
|
|
$form->display(); |
|
|
|
|
// Footer |
|
|
|
|
Display::display_footer(); |
|
|
|
|
Display::display_footer(); |