Minor - format code

pull/2487/head
jmontoyaa 9 years ago
parent 9f9e5278a7
commit cb29b4ab51
  1. 9
      main/lp/lp_add_item.php
  2. 35
      main/lp/lp_view.php

@ -79,10 +79,9 @@ $(function() {
$('.lp_resource_element').click(function() { $('.lp_resource_element').click(function() {
window.location.href = $('a', this).attr('href'); window.location.href = $('a', this).attr('href');
}); });
CKEDITOR.on('instanceReady', function (e) {
CKEDITOR.on('instanceReady', function (e) {
showTemplates('content_lp'); showTemplates('content_lp');
}); });
}); });
</script>"; </script>";
@ -203,9 +202,7 @@ $(document).ready(function() {
// document template for new document tab handler // document template for new document tab handler
$(document).on( 'shown.bs.tab', 'a[data-toggle="tab"]', function (e) { $(document).on( 'shown.bs.tab', 'a[data-toggle="tab"]', function (e) {
var id = e.target.id; var id = e.target.id;
if (id == 'subtab2') { if (id == 'subtab2') {
$('#frmModel').show(); $('#frmModel').show();
} else { } else {
@ -214,9 +211,7 @@ $(document).on( 'shown.bs.tab', 'a[data-toggle="tab"]', function (e) {
}) })
</script> </script>
<?php <?php
/* DISPLAY SECTION */ /* DISPLAY SECTION */
echo $learnPath->build_action_menu(); echo $learnPath->build_action_menu();
echo '<div class="row">'; echo '<div class="row">';
echo '<div id="lp_sidebar" class="col-md-4">'; echo '<div id="lp_sidebar" class="col-md-4">';

@ -54,7 +54,9 @@ $visibility = api_get_item_visibility(
$sessionId $sessionId
); );
if (!api_is_allowed_to_edit(false, true, false, false) && intval($visibility) == 0) { if (!api_is_allowed_to_edit(false, true, false, false) &&
intval($visibility) == 0
) {
api_not_allowed(true); api_not_allowed(true);
} }
@ -63,7 +65,6 @@ if (empty($_SESSION['oLP'])) {
} }
$debug = 0; $debug = 0;
if ($debug) { if ($debug) {
error_log('------ Entering lp_view.php -------'); error_log('------ Entering lp_view.php -------');
} }
@ -96,7 +97,7 @@ $user_id = api_get_user_id();
$platform_theme = api_get_setting('stylesheets'); // Platform's css. $platform_theme = api_get_setting('stylesheets'); // Platform's css.
$my_style = $platform_theme; $my_style = $platform_theme;
$htmlHeadXtra[] = '<script type="text/javascript"> $htmlHeadXtra[] = '<script>
<!-- <!--
var jQueryFrameReadyConfigPath = \''.api_get_jquery_web_path().'\'; var jQueryFrameReadyConfigPath = \''.api_get_jquery_web_path().'\';
--> -->
@ -115,7 +116,7 @@ if ($_SESSION['oLP']->mode == 'embedframe' || $_SESSION['oLP']->get_hide_toc_fra
$htmlHeadXtra[] = ''; $htmlHeadXtra[] = '';
} }
//Impress js // Impress js
if ($_SESSION['oLP']->mode == 'impress') { if ($_SESSION['oLP']->mode == 'impress') {
$lp_id = $_SESSION['oLP']->get_id(); $lp_id = $_SESSION['oLP']->get_id();
$url = api_get_path(WEB_CODE_PATH) . "lp/lp_impress.php?lp_id=$lp_id&" . api_get_cidreq(); $url = api_get_path(WEB_CODE_PATH) . "lp/lp_impress.php?lp_id=$lp_id&" . api_get_cidreq();
@ -187,8 +188,7 @@ if (!isset($src)) {
$file_info = pathinfo($file_info['path']); $file_info = pathinfo($file_info['path']);
} }
if ( if (isset($file_info['extension']) &&
isset($file_info['extension']) &&
api_strtolower(substr($file_info['extension'], 0, 3) == 'pdf') api_strtolower(substr($file_info['extension'], 0, 3) == 'pdf')
) { ) {
$src = api_get_path(WEB_CODE_PATH).'lp/lp_view_item.php?lp_item_id='.$lp_item_id.'&'.api_get_cidreq(); $src = api_get_path(WEB_CODE_PATH).'lp/lp_view_item.php?lp_item_id='.$lp_item_id.'&'.api_get_cidreq();
@ -244,8 +244,7 @@ if ($debug) {
error_log('$_GET[lp_item_id]: ' . intval($_GET['lp_item_id'])); error_log('$_GET[lp_item_id]: ' . intval($_GET['lp_item_id']));
} }
if ( if (!empty($_REQUEST['exeId']) &&
!empty($_REQUEST['exeId']) &&
isset($lp_id) && isset($lp_id) &&
isset($_GET['lp_item_id']) isset($_GET['lp_item_id'])
) { ) {
@ -259,8 +258,7 @@ if (
$safe_id = $lp_id; $safe_id = $lp_id;
$safe_exe_id = intval($_REQUEST['exeId']); $safe_exe_id = intval($_REQUEST['exeId']);
if ( if ($safe_id == strval(intval($safe_id)) &&
$safe_id == strval(intval($safe_id)) &&
$safe_item_id == strval(intval($safe_item_id)) $safe_item_id == strval(intval($safe_item_id))
) { ) {
$sql = 'SELECT start_date, exe_date, exe_result, exe_weighting, exe_exo_id $sql = 'SELECT start_date, exe_date, exe_result, exe_weighting, exe_exo_id
@ -331,8 +329,7 @@ if (
if (intval($_GET['fb_type']) > 0) { if (intval($_GET['fb_type']) > 0) {
$src = 'blank.php?msg=exerciseFinished'; $src = 'blank.php?msg=exerciseFinished';
} else { } else {
$src = api_get_path(WEB_CODE_PATH) . 'exercise/result.php?origin=learnpath&id=' . $safe_exe_id.'&'.api_get_cidreq(); $src = api_get_path(WEB_CODE_PATH).'exercise/result.php?origin=learnpath&id='.$safe_exe_id.'&'.api_get_cidreq();
if ($debug) { if ($debug) {
error_log('Calling URL: ' . $src); error_log('Calling URL: ' . $src);
} }
@ -349,7 +346,6 @@ $_setting['show_navigation_menu'] = 'false';
$scorm_css_header = true; $scorm_css_header = true;
$lp_theme_css = $_SESSION['oLP']->get_theme(); $lp_theme_css = $_SESSION['oLP']->get_theme();
// Sets the css theme of the LP this call is also use at the frames (toc, nav, message). // Sets the css theme of the LP this call is also use at the frames (toc, nav, message).
if ($_SESSION['oLP']->mode == 'fullscreen') { if ($_SESSION['oLP']->mode == 'fullscreen') {
$htmlHeadXtra[] = "<script>window.open('$src','content_id','toolbar=0,location=0,status=0,scrollbars=1,resizable=1');</script>"; $htmlHeadXtra[] = "<script>window.open('$src','content_id','toolbar=0,location=0,status=0,scrollbars=1,resizable=1');</script>";
} }
@ -369,7 +365,6 @@ $display_none = '';
$margin_left = '340px'; $margin_left = '340px';
//Media player code //Media player code
$display_mode = $_SESSION['oLP']->mode; $display_mode = $_SESSION['oLP']->mode;
$scorm_css_header = true; $scorm_css_header = true;
$lp_theme_css = $_SESSION['oLP']->get_theme(); $lp_theme_css = $_SESSION['oLP']->get_theme();
@ -449,14 +444,20 @@ if ($_SESSION['oLP']->get_preview_image()) {
} }
if ($_SESSION['oLP']->current == $_SESSION['oLP']->get_last()) { if ($_SESSION['oLP']->current == $_SESSION['oLP']->get_last()) {
$categories = Category::load(null, null, $course_code, null, null, $sessionId); $categories = Category::load(
null,
null,
$course_code,
null,
null,
$sessionId
);
if (!empty($categories)) { if (!empty($categories)) {
$gradebookEvaluations = $categories[0]->get_evaluations(); $gradebookEvaluations = $categories[0]->get_evaluations();
$gradebookLinks = $categories[0]->get_links(); $gradebookLinks = $categories[0]->get_links();
if ( if (count($gradebookEvaluations) === 0 &&
count($gradebookEvaluations) === 0 &&
count($gradebookLinks) === 1 && count($gradebookLinks) === 1 &&
$gradebookLinks[0]->get_type() == LINK_LEARNPATH && $gradebookLinks[0]->get_type() == LINK_LEARNPATH &&
$gradebookLinks[0]->get_ref_id() == $_SESSION['oLP']->lp_id $gradebookLinks[0]->get_ref_id() == $_SESSION['oLP']->lp_id

Loading…
Cancel
Save