diff --git a/main/course_home/course_home.php b/main/course_home/course_home.php index 7785f238d1..1c2eb6986d 100755 --- a/main/course_home/course_home.php +++ b/main/course_home/course_home.php @@ -189,15 +189,15 @@ if (!isset($coursesAlreadyVisited[$course_code])) { } /*Auto launch code */ -$show_autolunch_lp_warning = false; +$show_autolaunch_lp_warning = false; $auto_launch = api_get_course_setting('enable_lp_auto_launch'); if (!empty($auto_launch)) { $session_id = api_get_session_id(); if ($auto_launch == 2) { //LP list if (api_is_platform_admin() || api_is_allowed_to_edit()) { - $show_autolunch_lp_warning = true; + $show_autolaunch_lp_warning = true; } else { - $session_key = 'lp_autolunch_'.$session_id.'_'.api_get_course_int_id().'_'.api_get_user_id(); + $session_key = 'lp_autolaunch_'.$session_id.'_'.api_get_course_int_id().'_'.api_get_user_id(); if (!isset($_SESSION[$session_key])) { //redirecting to the LP $url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&id_session='.$session_id; @@ -213,28 +213,28 @@ if (!empty($auto_launch)) { if (!empty($session_id)) { $condition = api_get_session_condition($session_id); $sql = "SELECT id FROM $lp_table - WHERE c_id = $course_id AND autolunch = 1 $condition + WHERE c_id = $course_id AND autolaunch = 1 $condition LIMIT 1"; $result = Database::query($sql); - //If we found nothing in the session we just called the session_id = 0 autolunch + //If we found nothing in the session we just called the session_id = 0 autolaunch if (Database::num_rows($result) == 0) { $condition = ''; } else { - //great, there is an specific auto lunch for this session we leave the $condition + //great, there is an specific auto launch for this session we leave the $condition } } $sql = "SELECT id FROM $lp_table - WHERE c_id = $course_id AND autolunch = 1 $condition + WHERE c_id = $course_id AND autolaunch = 1 $condition LIMIT 1"; $result = Database::query($sql); if (Database::num_rows($result) > 0) { $lp_data = Database::fetch_array($result,'ASSOC'); if (!empty($lp_data['id'])) { if (api_is_platform_admin() || api_is_allowed_to_edit()) { - $show_autolunch_lp_warning = true; + $show_autolaunch_lp_warning = true; } else { - $session_key = 'lp_autolunch_'.$session_id.'_'.api_get_course_int_id().'_'.api_get_user_id(); + $session_key = 'lp_autolaunch_'.$session_id.'_'.api_get_course_int_id().'_'.api_get_user_id(); if (!isset($_SESSION[$session_key])) { //redirecting to the LP $url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$lp_data['id']; @@ -267,7 +267,7 @@ $content = Display::return_introduction_section(TOOL_COURSE_HOMEPAGE, array( the setting homepage_view is adjustable through the platform administration section */ -if ($show_autolunch_lp_warning) { +if ($show_autolaunch_lp_warning) { $show_message .= Display::return_message( get_lang('TheLPAutoLaunchSettingIsONStudentsWillBeRedirectToAnSpecificLP'), 'warning' diff --git a/main/coursecopy/classes/CourseBuilder.class.php b/main/coursecopy/classes/CourseBuilder.class.php index b882953aa7..9a911651d0 100755 --- a/main/coursecopy/classes/CourseBuilder.class.php +++ b/main/coursecopy/classes/CourseBuilder.class.php @@ -1211,7 +1211,7 @@ class CourseBuilder $obj->author, $obj->preview_image, $obj->use_max_score, - $obj->autolunch, + $obj->autolaunch, $obj->created_on, $obj->modified_on, $obj->publicated_on, diff --git a/main/coursecopy/classes/CourseCopyLearnpath.class.php b/main/coursecopy/classes/CourseCopyLearnpath.class.php index c4856ff72f..fda46c6dbe 100755 --- a/main/coursecopy/classes/CourseCopyLearnpath.class.php +++ b/main/coursecopy/classes/CourseCopyLearnpath.class.php @@ -129,7 +129,7 @@ class CourseCopyLearnpath extends Resource $author, $preview_image, $use_max_score, - $autolunch, + $autolaunch, $created_on, $modified_on, $publicated_on, @@ -156,7 +156,7 @@ class CourseCopyLearnpath extends Resource $this->visibility=$visibility; $this->use_max_score=$use_max_score; - $this->autolunch=$autolunch; + $this->autolaunch=$autolaunch; $this->created_on=$created_on; $this->modified_on=$modified_on; $this->publicated_on=$publicated_on; diff --git a/main/coursecopy/classes/CourseRestorer.class.php b/main/coursecopy/classes/CourseRestorer.class.php index e35924fe13..a404f19f42 100755 --- a/main/coursecopy/classes/CourseRestorer.class.php +++ b/main/coursecopy/classes/CourseRestorer.class.php @@ -2120,7 +2120,7 @@ class CourseRestorer "author = '".self::DBUTF8escapestring($lp->author)."', " . "preview_image = '".self::DBUTF8escapestring($lp->preview_image)."', " . "use_max_score = '".self::DBUTF8escapestring($lp->use_max_score)."', " . - "autolunch = '".self::DBUTF8escapestring($lp->autolunch)."', " . + "autolaunch = '".self::DBUTF8escapestring($lp->autolaunch)."', " . "created_on = '".self::DBUTF8escapestring($lp->created_on)."', " . "modified_on = '".self::DBUTF8escapestring($lp->modified_on)."', " . "publicated_on = '".self::DBUTF8escapestring($lp->publicated_on)."', " . diff --git a/main/inc/lib/login.lib.php b/main/inc/lib/login.lib.php index df9b8b817b..1d3efe4d47 100755 --- a/main/inc/lib/login.lib.php +++ b/main/inc/lib/login.lib.php @@ -414,7 +414,7 @@ class Login if (!empty($_SESSION)) { foreach ($_SESSION as $key => $session_item) { - if (strpos($key, 'lp_autolunch_') === false) { + if (strpos($key, 'lp_autolaunch_') === false) { continue; } else { if (isset($_SESSION[$key])) { diff --git a/main/inc/local.inc.php b/main/inc/local.inc.php index b0014a3504..1708bba533 100755 --- a/main/inc/local.inc.php +++ b/main/inc/local.inc.php @@ -878,7 +878,7 @@ if (isset($cidReset) && $cidReset) { if (!empty($_SESSION)) { foreach ($_SESSION as $key => $session_item) { - if (strpos($key, 'lp_autolunch_') === false) { + if (strpos($key, 'lp_autolaunch_') === false) { continue; } else { if (isset($_SESSION[$key])) { diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index bfdc7a3e5b..1a7aa8d314 100755 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -219,13 +219,13 @@ class learnpath Database::query($sql); $this->lp_view_id = Database::insert_id(); - $sql = "UPDATE $lp_table SET id = iid WHERE iid = ".$this->lp_view_id; + if ($this->debug > 2) { + error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - inserting new lp_view: ' . $sql, 0); + } + $sql = "UPDATE $lp_table SET id = iid WHERE iid = ".$this->lp_view_id; Database::query($sql); - if ($this->debug > 2) { - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - inserting new lp_view: ' . $sql_ins, 0); - } } // Initialise items. @@ -9864,20 +9864,20 @@ EOD; * @param int $lp_id * @param string $status */ - public function set_autolunch($lp_id, $status) + public function set_autolaunch($lp_id, $status) { $course_id = api_get_course_int_id(); $lp_id = intval($lp_id); $status = intval($status); $lp_table = Database::get_course_table(TABLE_LP_MAIN); - // Setting everything to autolunch = 0 - $attributes['autolunch'] = 0; + // Setting everything to autolaunch = 0 + $attributes['autolaunch'] = 0; $where = array('session_id = ? AND c_id = ? '=> array(api_get_session_id(), $course_id)); Database::update($lp_table, $attributes, $where); if ($status == 1) { - //Setting my lp_id to autolunch = 1 - $attributes['autolunch'] = 1; + //Setting my lp_id to autolaunch = 1 + $attributes['autolaunch'] = 1; $where = array('id = ? AND session_id = ? AND c_id = ?'=> array($lp_id, api_get_session_id(), $course_id)); Database::update($lp_table, $attributes, $where ); } diff --git a/main/newscorm/learnpathList.class.php b/main/newscorm/learnpathList.class.php index 83d2d96407..7a3eb8d941 100755 --- a/main/newscorm/learnpathList.class.php +++ b/main/newscorm/learnpathList.class.php @@ -168,7 +168,7 @@ class LearnpathList 'lp_scorm_debug' => $row['debug'], 'lp_display_order' => $row['display_order'], 'lp_preview_image' => stripslashes($row['preview_image']), - 'autolaunch' => $row['autolunch'], + 'autolaunch' => $row['autolaunch'], 'session_id' => $row['session_id'], 'created_on' => $row['created_on'], 'modified_on' => $row['modified_on'], diff --git a/main/newscorm/lp_controller.php b/main/newscorm/lp_controller.php index df383d6b58..13d6524187 100755 --- a/main/newscorm/lp_controller.php +++ b/main/newscorm/lp_controller.php @@ -60,7 +60,7 @@ form .label { color: #ffffff; text-transform: none; background: none; - border-radius: none; + border-radius: unset; color: #404040; float: left; line-height: 18px; @@ -592,9 +592,9 @@ switch ($action) { api_not_allowed(true); } if ($debug > 0) error_log('New LP - auto_launch action triggered', 0); - if (!$lp_found) { error_log('New LP - No learnpath given for set_autolunch', 0); require 'lp_list.php'; } + if (!$lp_found) { error_log('New LP - No learnpath given for set_autolaunch', 0); require 'lp_list.php'; } else { - $_SESSION['oLP']->set_autolunch($_GET['lp_id'], $_GET['status']); + $_SESSION['oLP']->set_autolaunch($_GET['lp_id'], $_GET['status']); require 'lp_list.php'; exit; } diff --git a/main/newscorm/lp_list.php b/main/newscorm/lp_list.php index 5924927369..34d835c4fa 100755 --- a/main/newscorm/lp_list.php +++ b/main/newscorm/lp_list.php @@ -196,7 +196,7 @@ foreach ($categories as $item) { $max = count($flat_list); $counter = 0; $current = 0; - $autolunch_exists = false; + $autolaunch_exists = false; foreach ($flat_list as $id => $details) { // Validation when belongs to a session. @@ -368,7 +368,7 @@ foreach ($categories as $item) { $dsp_reinit = null; $dsp_disk = null; $copy = null; - $lp_auto_lunch_icon = null; + $lp_auto_launch_icon = null; if ($is_allowed_to_edit) { @@ -657,18 +657,18 @@ foreach ($categories as $item) { api_get_self()."?".api_get_cidreq()."&action=copy&lp_id=$id" ); - /* Auto Lunch LP code */ + /* Auto launch LP code */ if (api_get_course_setting('enable_lp_auto_launch') == 1) { - if ($details['autolaunch'] == 1 && $autolunch_exists == false) { - $autolunch_exists = true; - $lp_auto_lunch_icon = ' '; } else { - $lp_auto_lunch_icon = ' autolunch = $autolunch; + $this->autolaunch = $autolaunch; return $this; } /** - * Get autolunch + * Get autolaunch * * @return integer */ - public function getAutolunch() + public function getAutolaunch() { - return $this->autolunch; + return $this->autolaunch; } /**