Minor - format code

1.9.x
Julio Montoya 12 years ago
parent 9b8d08ea15
commit 48d917cc2b
  1. 2
      main/course_home/course_home.php
  2. 7
      main/inc/lib/main_api.lib.php
  3. 6
      main/newscorm/lp_controller.php
  4. 22
      main/newscorm/lp_view.php
  5. 1
      main/newscorm/scorm_api.php
  6. 102
      main/template/default/layout/main_header.tpl
  7. 6
      main/template/default/layout/menu.tpl

@ -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();

@ -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());
}

@ -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[] = '<script>
<!--
@ -325,6 +324,7 @@ if (!$lp_found || (!empty($_REQUEST['lp_id']) && $_SESSION['oLP']->get_id() != $
switch ($type) {
case 1:
if ($debug > 0) error_log('New LP - found row - type dokeos - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
$oLP = new learnpath(api_get_course_id(), $lp_id, api_get_user_id());
if ($oLP !== false) { $lp_found = true; } else { error_log($oLP->error, 0); }
break;
@ -335,12 +335,12 @@ if (!$lp_found || (!empty($_REQUEST['lp_id']) && $_SESSION['oLP']->get_id() != $
break;
case 3:
if ($debug > 0) error_log('New LP - found row - type aicc - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
$oLP = new aicc(api_get_course_id(),$lp_id,api_get_user_id());
$oLP = new aicc(api_get_course_id(), $lp_id, api_get_user_id());
if ($oLP !== false) { $lp_found = true; } else { error_log($oLP->error, 0); }
break;
default:
if ($debug > 0) error_log('New LP - found row - type other - Calling constructor with '.api_get_course_id().' - '.$lp_id.' - '.api_get_user_id(), 0);
$oLP = new learnpath(api_get_course_id(),$lp_id,api_get_user_id());
$oLP = new learnpath(api_get_course_id(), $lp_id, api_get_user_id());
if ($oLP !== false) { $lp_found = true; } else { error_log($oLP->error, 0); }
break;
}

@ -217,7 +217,9 @@ if ($type_quiz && !empty($_REQUEST['exeId']) && isset($lp_id) && isset($_GET['lp
if ($safe_id == strval(intval($safe_id)) && $safe_item_id == strval(intval($safe_item_id))) {
$sql = 'SELECT start_date, exe_date, exe_result, exe_weighting FROM ' . $TBL_TRACK_EXERCICES . ' WHERE exe_id = '.$safe_exe_id;
$sql = 'SELECT start_date, exe_date, exe_result, exe_weighting
FROM ' . $TBL_TRACK_EXERCICES . '
WHERE exe_id = '.$safe_exe_id;
$res = Database::query($sql);
$row_dates = Database::fetch_array($res);
@ -228,11 +230,18 @@ if ($type_quiz && !empty($_REQUEST['exeId']) && isset($lp_id) && isset($_GET['lp
$score = (float)$row_dates['exe_result'];
$max_score = (float)$row_dates['exe_weighting'];
$sql_upd_max_score = "UPDATE $TBL_LP_ITEM SET max_score = '$max_score' WHERE c_id = $course_id AND id = '".$safe_item_id."'";
Database::query($sql_upd_max_score);
$sql = "UPDATE $TBL_LP_ITEM SET max_score = '$max_score'
WHERE c_id = $course_id AND id = '".$safe_item_id."'";
Database::query($sql);
$sql_last_attempt = "SELECT id FROM $TBL_LP_ITEM_VIEW WHERE c_id = $course_id AND lp_item_id = '$safe_item_id' AND lp_view_id = '".$_SESSION['oLP']->lp_view_id."' order by id desc limit 1";
$res_last_attempt = Database::query($sql_last_attempt);
$sql = "SELECT id FROM $TBL_LP_ITEM_VIEW
WHERE
c_id = $course_id AND
lp_item_id = '$safe_item_id' AND
lp_view_id = '".$_SESSION['oLP']->lp_view_id."'
ORDER BY id DESC
LIMIT 1";
$res_last_attempt = Database::query($sql);
if (Database::num_rows($res_last_attempt)) {
$row_last_attempt = Database::fetch_row($res_last_attempt);
@ -258,7 +267,7 @@ if ($type_quiz && !empty($_REQUEST['exeId']) && isset($lp_id) && isset($_GET['lp
}
$_SESSION['oLP']->set_previous_item($lp_item_id);
$nameTools = Security :: remove_XSS($_SESSION['oLP']->get_name());
$nameTools = Security::remove_XSS($_SESSION['oLP']->get_name());
$save_setting = api_get_setting('show_navigation_menu');
global $_setting;
@ -317,6 +326,7 @@ if (Database::num_rows($res_media) > 0) {
}
}
}
echo '<div id="learning_path_main" style="width:100%;height:100%;">';
$is_allowed_to_edit = api_is_allowed_to_edit(null, true, false, false);
if ($is_allowed_to_edit) {

@ -45,6 +45,7 @@ if (!is_object($oItem)) {
}
$autocomplete_when_80pct = 0;
$user = api_get_user_info();
header('Content-type: text/javascript');
?>var scorm_logs=<?php echo ((empty($oLP->scorm_debug) or (!api_is_course_admin() && !api_is_platform_admin()) )?'0':'3');?>; //debug log level for SCORM. 0 = none, 1=light, 2=a lot, 3=all - displays logs in log frame

@ -24,69 +24,67 @@
{{ help_content }}
{{ bug_notification_link }}
</ul>
{# topbar #}
{% include "default/layout/topbar.tpl" %}
<header>
<div class="row">
<div id="header_left" class="span4">
{# logo #}
{{ logo }}
<div class="row">
<div id="header_left" class="span4">
{# logo #}
{{ logo }}
{# plugin_header left #}
{% if plugin_header_left is not null %}
<div id="plugin_header_left">
{{ plugin_header_left }}
</div>
{% endif %}
</div>
<div id="header_center" class="span3">
{# plugin_header center #}
{% if plugin_header_center is not null %}
<div id="plugin_header_center">
{{ plugin_header_center }}
</div>
{% endif %}
&nbsp;
</div>
<div id="header_right" class="span5">
<ul id="notifications" class="nav nav-pills pull-right">
{{ notification_menu }}
</ul>
{# plugin_header left #}
{% if plugin_header_left is not null %}
<div id="plugin_header_left">
{{ plugin_header_left }}
</div>
{% endif %}
</div>
<div id="header_center" class="span3">
{# plugin_header center #}
{% if plugin_header_center is not null %}
<div id="plugin_header_center">
{{ plugin_header_center }}
</div>
{% endif %}
&nbsp;
</div>
<div id="header_right" class="span5">
<ul id="notifications" class="nav nav-pills pull-right">
{{ notification_menu }}
</ul>
{# plugin_header right #}
{% if plugin_header_right is not null %}
<div id="plugin_header_right">
{{ plugin_header_right }}
</div>
{% endif %}
&nbsp;
</div>
{# plugin_header right #}
{% if plugin_header_right is not null %}
<div id="plugin_header_right">
{{ plugin_header_right }}
</div>
{% endif %}
&nbsp;
</div>
</div>
{% if plugin_header_main %}
<div class="row">
<div class="span12">
<div id="plugin_header_main">
{{ plugin_header_main }}
</div>
{% if plugin_header_main %}
<div class="row">
<div class="span12">
<div id="plugin_header_main">
{{ plugin_header_main }}
</div>
</div>
{% endif %}
<div class="container">
{# menu #}
{% include "default/layout/menu.tpl" %}
</div>
{# breadcrumb #}
{{ breadcrumb }}
</header>
{% endif %}
<div class="container">
{# menu #}
{% include "default/layout/menu.tpl" %}
</div>
{# breadcrumb #}
{{ breadcrumb }}
</header>
<div id="main" class="container">
<div id="main" class="container">
<div id="top_main_content" class="row">
<div id="top_main_content" class="row">
{# course navigation links/shortcuts need to be activated by the admin #}
{% include "default/layout/course_navigation.tpl" %}
{# course navigation links/shortcuts need to be activated by the admin #}
{% include "default/layout/course_navigation.tpl" %}
{% endif %}

@ -45,12 +45,12 @@
</li>
</ul>
{% else %}
{# direct login to course - no visible if logged and on the index page #}
{# Direct login to course - no visible if logged and on the index page #}
{% if course_code != "" %}
<ul class="nav pull-right">
<li class="dropdown" style="color:white;">
<a href='{{ _p.web }}/main/auth/gotocourse.php?firstpage={{ course_code }}'>
{{ "LoginEnter"|get_lang }}
<a href='{{ _p.web }}main/auth/gotocourse.php?firstpage={{ course_code }}'>
{{ "LoginEnter" | get_lang }}
</a>
</li>
</ul>

Loading…
Cancel
Save