From 48d917cc2bb46105dd4ec9d9f0bed494fbbc6a58 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 6 Jun 2014 15:02:10 +0200 Subject: [PATCH] Minor - format code --- main/course_home/course_home.php | 2 +- main/inc/lib/main_api.lib.php | 7 +- main/newscorm/lp_controller.php | 6 +- main/newscorm/lp_view.php | 22 ++-- main/newscorm/scorm_api.php | 1 + main/template/default/layout/main_header.tpl | 102 +++++++++---------- main/template/default/layout/menu.tpl | 6 +- 7 files changed, 78 insertions(+), 68 deletions(-) diff --git a/main/course_home/course_home.php b/main/course_home/course_home.php index 8a45482cbd..f2d8f6467a 100755 --- a/main/course_home/course_home.php +++ b/main/course_home/course_home.php @@ -263,7 +263,7 @@ $tpl = new Template(null); $tpl->assign('message', $show_message); $tpl->assign('content', $content); -// direct login to course +// Direct login to course $tpl->assign('course_code', $course_code); $tpl->display_one_col_template(); diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index 0967fa3ff2..d08e705288 100755 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -1841,9 +1841,11 @@ function api_set_failure($failure_type) { */ function api_set_anonymous() { global $_user; + if (!empty($_user['user_id'])) { return false; } + $user_id = api_get_anonymous_id(); if ($user_id == 0) { return false; @@ -1851,8 +1853,8 @@ function api_set_anonymous() { Session::erase('_user'); $_user['user_id'] = $user_id; $_user['is_anonymous'] = true; - Session::write('_user',$_user); $GLOBALS['_user'] = $_user; + Session::write('_user', $_user); return true; } @@ -3071,8 +3073,8 @@ function api_not_allowed($print_headers = false, $message = null) } $tpl = new Template(null, $show_headers, $show_headers); - $tpl->assign('content', $msg); + $tpl->assign('content', $msg); if (($user_id!=0 && !api_is_anonymous()) && (!isset($course) || $course == -1) && empty($_GET['cidReq'])) { // if the access is not authorized and there is some login information // but the cidReq is not found, assume we are missing course data and send the user @@ -3095,7 +3097,6 @@ function api_not_allowed($print_headers = false, $message = null) $tpl->display_one_col_template(); exit; } - if (!is_null(api_get_course_id())) { api_set_firstpage_parameter(api_get_course_id()); } diff --git a/main/newscorm/lp_controller.php b/main/newscorm/lp_controller.php index 6aa5cb8508..ea8fba52f2 100755 --- a/main/newscorm/lp_controller.php +++ b/main/newscorm/lp_controller.php @@ -34,7 +34,6 @@ $language_file[] = 'exercice'; // Including the global initialization file. require_once '../inc/global.inc.php'; $current_course_tool = TOOL_LEARNPATH; - if (api_get_setting('show_glossary_in_documents') == 'ismanual' || api_get_setting('show_glossary_in_documents') == 'isautomatic' ) { $htmlHeadXtra[] = '