Minor fixing PHP warnings

skala
Julio Montoya 13 years ago
parent 958fb37997
commit 4b5f07b04e
  1. 14
      main/newscorm/lp_add.php
  2. 4
      main/newscorm/lp_controller.php

@ -8,10 +8,10 @@
* @author Roan Embrechts, refactoring and code cleaning
* @author Yannick Warnier <ywarnier@beeznest.org> - cleaning and update for new SCORM tool
* @author Julio Montoya <gugli100@gmail.com> Adding formvalidator support
*
*
* @package chamilo.learnpath
*/
/**
/**
* Code
*/
$this_section = SECTION_COURSES;
@ -62,15 +62,15 @@ function activate_end_date() {
} else {
document.getElementById(\'end_date_div\').style.display = \'none\';
}
}
}
</script>';
/* Constants and variables */
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$isStudentView = (int) $_REQUEST['isStudentView'];
$learnpath_id = (int) $_REQUEST['lp_id'];
$isStudentView = isset($_REQUEST['isStudentView']) ? $_REQUEST['isStudentView'] : null;
$learnpath_id = isset($_REQUEST['lp_id']) ? $_REQUEST['lp_id'] : null;
/* MAIN CODE */
@ -138,7 +138,7 @@ $form->addElement('datepicker', 'publicated_on', get_lang('PublicationDate'), ar
$form->addElement('html','</div>');
//End date
$form->addElement('checkbox', 'activate_end_date_check', null, get_lang('EnableEndTime'), array('onclick' => 'activate_end_date()'));
$form->addElement('checkbox', 'activate_end_date_check', null, get_lang('EnableEndTime'), array('onclick' => 'activate_end_date()'));
$form->addElement('html','<div id="end_date_div" style="display:none;">');
$form->addElement('datepicker', 'expired_on', get_lang('ExpirationDate'), array('form_name'=>'lp_add'), 5);
$form->addElement('html','</div>');
@ -150,7 +150,7 @@ $defaults['activate_start_date_check'] = 1;
$defaults['publicated_on'] = date('Y-m-d 08:00:00');
$defaults['expired_on'] = date('Y-m-d 08:00:00',time()+84600);
$form->setDefaults($defaults);
$form->setDefaults($defaults);
$form->addElement('style_submit_button', 'Submit',get_lang('CreateLearningPath'),'class="save"');

@ -319,8 +319,8 @@ switch ($action) {
api_not_allowed(true);
}
if ($debug > 0) error_log('New LP - add_lp action triggered', 0);
$_REQUEST['lp_name'] = trim($_REQUEST['lp_name']);
if (!empty($_REQUEST['lp_name'])) {
if (isset($_REQUEST['lp_name']) && !empty($_REQUEST['lp_name'])) {
$_REQUEST['lp_name'] = trim($_REQUEST['lp_name']);
$_SESSION['refresh'] = 1;
if (isset($_SESSION['post_time']) && $_SESSION['post_time'] == $_REQUEST['post_time']) {

Loading…
Cancel
Save