Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/main/lp/learnpath.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ public function get_navigation_bar($barId = '')
$reportingIcon = '
<a class="icon-toolbar"
id="stats_link"
href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lpId.'"
href="lp_controller.php?action=stats&origin=learnpath&'.api_get_cidreq(true).'&lp_id='.$lpId.'"
onclick="window.parent.API.save_asset(); return true;"
target="content_name" title="'.$reportingText.'">
'.$icon.'<span class="sr-only">'.$reportingText.'</span>
Expand Down
34 changes: 22 additions & 12 deletions public/main/lp/scorm_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function APIobject() {
olms.lms_auto_forward_video = <?php echo (int) $oLP->auto_forward_video; ?>;

var courseUrl = '?cid='+olms.lms_course_id+'&sid='+olms.lms_session_id+'&lp_id='+olms.lms_lp_id;
var statsUrl = 'lp_controller.php' + courseUrl + '&action=stats';
var statsUrl = 'lp_controller.php' + courseUrl + '&action=stats&origin=learnpath';

/**
* Add the "addListeners" function to the "onload" event of the window and
Expand Down Expand Up @@ -249,6 +249,16 @@ function getContentFrame() {
return $f;
}

function setContentFrameSrc(src) {
var $frame = getContentFrame();
if (!$frame.length) {
logit_lms("[LP] Content iframe not found (#content_id / #content_id_blank).", 0);
return false;
}
$frame.attr("src", src);
return true;
}

$(function() {
var $frame = getContentFrame();

Expand Down Expand Up @@ -1723,18 +1733,18 @@ function switch_item(current_item, next_item) {
var mysrc = buildLpContentSrc(targetItemId);

<?php if ('fullscreen' === $oLP->mode) { ?>
var w = window.open("" + mysrc, "content_id", "toolbar=0,location=0,status=0,scrollbars=1,resizable=1");
if (w) {
w.onload = function () {
olms.info_lms_item[0] = currentItemId;
};
w.onunload = function () {
olms.info_lms_item[0] = currentItemId;
};
}
var w = window.open("" + mysrc, "content_id", "toolbar=0,location=0,status=0,scrollbars=1,resizable=1");
if (w) {
w.onload = function () {
olms.info_lms_item[0] = currentItemId;
};
w.onunload = function () {
olms.info_lms_item[0] = currentItemId;
};
}
<?php } else { ?>
log_in_log("Loading " + mysrc + " in iframe", 2);
$("#content_id").attr("src", mysrc);
log_in_log("Loading " + mysrc + " in iframe", 2);
setContentFrameSrc(mysrc);
<?php } ?>

// (6) Update nav buttons visibility
Expand Down
6 changes: 3 additions & 3 deletions src/CoreBundle/Resources/views/LearnPath/menubar.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{% set toc_hidden = (toc_hidden|default(0) + 0) %}
{% set show_left_column = (show_left_column|default(1) + 0) %}
{% set show_toolbar_by_default = (show_toolbar_by_default|default(0) + 0) %}
{# Force the toolbar open when TOC is hidden so navigation is always visible #}
{% set force_open = (show_toolbar_by_default == 1) or (toc_hidden == 1 and menu_location != 'top') %}
{# Do not force-open the toolbar; user controls it via hamburger #}
{% set force_open = (show_toolbar_by_default == 1) %}
{% if navigation_in_the_middle %}
<style>
.c-menu-left { top: 50% !important; }
Expand Down Expand Up @@ -42,7 +42,7 @@
>
<i class="mdi-home mdi" aria-hidden="true"></i>
</a>
<span data-lp-menu="nav">
<span data-lp-menu="nav" class="lp-menu-nav">
{{ navigation_bar }}
</span>
</div>
Expand Down
Loading
Loading