Update from 1.11.x

pull/2881/head
Julio Montoya 7 years ago
parent 2b4dde79d6
commit 9672242023
  1. 2
      main/lp/lp_controller.php
  2. 1
      main/messages/outbox.php
  3. 10
      src/ThemeBundle/Resources/views/LearnPath/scorm_list.html.twig
  4. 243
      src/ThemeBundle/Resources/views/LearnPath/view.html.twig

@ -88,7 +88,7 @@ $htmlHeadXtra[] = '
connectWith: "#lp_item_list", connectWith: "#lp_item_list",
placeholder: "ui-state-highlight", //defines the yellow highlight placeholder: "ui-state-highlight", //defines the yellow highlight
start: function(event, ui) { start: function(event, ui) {
$(ui.item).css("width", "160px"); $(ui.item).css("width", "350px");
$(ui.item).find(".item_data").attr("style", ""); $(ui.item).find(".item_data").attr("style", "");
}, },
stop: function(event, ui) { stop: function(event, ui) {

@ -66,6 +66,7 @@ if (isset($_REQUEST['action'])) {
$keyword = ''; $keyword = '';
$social_right_content = ''; $social_right_content = '';
if ($allowSocial) { if ($allowSocial) {
// Block Social Menu
$social_menu_block = SocialManager::show_social_menu('messages'); $social_menu_block = SocialManager::show_social_menu('messages');
$actionsLeft = '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. $actionsLeft = '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
Display::return_icon('back.png', get_lang('Back'), [], 32).'</a>'; Display::return_icon('back.png', get_lang('Back'), [], 32).'</a>';

@ -15,7 +15,7 @@
{% else %} {% else %}
<div class="item {{ item.css_level }}" title="{{ item.description }}"> <div class="item {{ item.css_level }}" title="{{ item.description }}">
<a name="atoc_{{ item.id }}"></a> <a name="atoc_{{ item.id }}"></a>
<a class="items-list" href="#" <a data-type="type-{{ item.type }}" class="items-list" href="#"
onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;"> onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;">
{{ item.title }} {{ item.title }}
</a> </a>
@ -27,6 +27,7 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
{% if data_panel is not empty %} {% if data_panel is not empty %}
<div id="learning_path_toc" class="scorm-collapse"> <div id="learning_path_toc" class="scorm-collapse">
<div class="scorm-title"> <div class="scorm-title">
@ -41,7 +42,7 @@
<li id="toc_{{ item.id }}" class="{{ item.class }} item-{{ item.type }}"> <li id="toc_{{ item.id }}" class="{{ item.class }} item-{{ item.type }}">
<div class="sub-item type-{{ item.type }}"> <div class="sub-item type-{{ item.type }}">
<a name="atoc_{{ item.id }}"></a> <a name="atoc_{{ item.id }}"></a>
<a class="item-action" href="#" <a data-type="type-{{ item.type }}" class="item-action" href="#"
onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;"> onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;">
<i class="fa fa-chevron-circle-right" aria-hidden="true"></i> <i class="fa fa-chevron-circle-right" aria-hidden="true"></i>
{{ item.title }} {{ item.title }}
@ -53,7 +54,6 @@
{% endif %} {% endif %}
{% for item in data_panel.are_parents %} {% for item in data_panel.are_parents %}
<div class="panel panel-default {{ item.parent ? 'lower':'higher' }}" data-lp-id="{{ item.id }}" <div class="panel panel-default {{ item.parent ? 'lower':'higher' }}" data-lp-id="{{ item.id }}"
{{ item.parent ? 'data-lp-parent="' ~ item.parent ~ '"' : '' }}> {{ item.parent ? 'data-lp-parent="' ~ item.parent ~ '"' : '' }}>
<div class="status-heading"> <div class="status-heading">
@ -80,21 +80,19 @@
class="{{ subitem.class }} {{ subitem.type }} {{ counter == final ? 'final':'' }}"> class="{{ subitem.class }} {{ subitem.type }} {{ counter == final ? 'final':'' }}">
<div class="sub-item item-{{ subitem.type }}"> <div class="sub-item item-{{ subitem.type }}">
<a name="atoc_{{ subitem.id }}"></a> <a name="atoc_{{ subitem.id }}"></a>
<a class="item-action" href="#" <a data-type="type-{{ subitem.type }}" class="item-action" href="#"
onclick="switch_item('{{ subitem.current_id }}','{{ subitem.id }}'); return false;"> onclick="switch_item('{{ subitem.current_id }}','{{ subitem.id }}'); return false;">
<i class="fa fa-chevron-circle-right" aria-hidden="true"></i> <i class="fa fa-chevron-circle-right" aria-hidden="true"></i>
{{ subitem.title }} {{ subitem.title }}
</a> </a>
</div> </div>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
{% endif %} {% endif %}

@ -23,12 +23,93 @@
</div> </div>
{% endif %} {% endif %}
</div> </div>
{% if show_audio_player %} {% if show_audio_player %}
<div id="lp_media_file" class="audio-scorm"> <div id="lp_media_file" class="audio-scorm">
{{ media_player }} {{ media_player }}
</div> </div>
{% endif %} {% endif %}
{% if lp_accumulate_work_time != '' %}
{% set lp_progress %}
<style>
#timer .container{display:table;background:#777;color:#eee;font-weight:bold;width:100%;text-align:center;text-shadow:1px 1px 4px #999;}
#timer .container div{display:table-cell;font-size:24px;padding:0px;width:20px;}
#timer .container .divider{width:10px;color:#ddd;}
#btn-comenzar{box-sizing:border-box;background:#eee;border:none;margin:0 auto;padding:20px;width:100%;font-size:30px;color:#777;}
#btn-comenzar:hover{background:#fff;}
</style>
<script>
$(function() {
var timerData = {
hour: parseInt($("#hour").text()),
minute: parseInt($("#minute").text()),
second: parseInt($("#second").text())
};
//window.timerInterval = null;
clearInterval(window.timerInterval);
window.timerInterval = setInterval(function(){
// Seconds
timerData.second++;
if (timerData.second >= 60) {
timerData.second = 0;
timerData.minute++;
}
// Minutes
if (timerData.minute >= 60) {
timerData.minute = 0;
timerData.hour++;
}
$("#hour").text(timerData.hour < 10 ? '0' + timerData.hour : timerData.hour);
$("#minute").text(timerData.minute < 10 ? '0' + timerData.minute : timerData.minute);
$("#second").text(timerData.second < 10 ? '0' + timerData.second : timerData.second);
}, 1000);
})
</script>
<div class="row">
<div class="col-xs-4">
<b>
{{ "ProgressSpentInLp"|get_lang|format(lp_accumulate_work_time) }}
</b>
</div>
<div class="col-xs-8">
<div id="progress_bar">
{{ progress_bar }}
</div>
</div>
</div>
<div class="row">
<div class="col-xs-4">
<b>
{{ "TimeSpentInLp"|get_lang|format(lp_accumulate_work_time) }}
</b>
</div>
<div class="col-xs-8">
<div id="timer">
<div class="container">
<div id="hour">{{ hour }}</div>
<div class="divider">:</div>
<div id="minute">{{ minute }}</div>
<div class="divider">:</div>
<div id="second">{{ second }}</div>
<div id="slash"> / </div>
<div>{{ hour_min }}</div>
</div>
</div>
</div>
</div>
{% endset %}
{% else %}
{% set lp_progress %}
<div id="progress_bar">
{{ progress_bar }}
</div>
{% endset %}
{% endif %}
{% if gamification_mode == 1 %} {% if gamification_mode == 1 %}
<!--- gamification --> <!--- gamification -->
<div id="scorm-gamification"> <div id="scorm-gamification">
@ -47,23 +128,20 @@
{% endif %} {% endif %}
</div> </div>
<div class="col-xs-6 text-right"> <div class="col-xs-6 text-right">
{{ "XPoints"|trans|format(gamification_points) }} {{ "XPoints"|get_lang|format(gamification_points) }}
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 navegation-bar"> <div class="col-xs-12 navegation-bar">
<div id="progress_bar"> {{ lp_progress }}
{{ progress_bar }}
</div>
</div> </div>
</div> </div>
</div> </div>
<!--- end gamification --> <!--- end gamification -->
{% else %} {% else %}
<div id="progress_bar"> {{ lp_progress }}
{{ progress_bar }}
</div>
{% endif %} {% endif %}
{{ teacher_toc_buttons }} {{ teacher_toc_buttons }}
</div> </div>
</div> </div>
@ -77,52 +155,77 @@
{# end left zone #} {# end left zone #}
{% endif %} {% endif %}
<div id="lp_navigation_elem" class="navegation-bar"> {# Right zone #}
{% if show_left_column == 1 %}
<a href="#" title = "{{ 'Expand'|trans }}" id="lp-view-expand-toggle" class="icon-toolbar expand" role="button">
{% if lp_mode == 'embedframe' %}
<span class="fa fa-compress" aria-hidden="true"></span>
<span class="sr-only">{{ 'Expand'|trans }}</span>
{% else %}
<span class="fa fa-expand" aria-hidden="true"></span>
<span class="sr-only">{{ 'Expand'|trans }}</span>
{% endif %}
</a>
{% endif %}
<a id="home-course" title = "{{ 'Home'|trans }}" href="{{ button_home_url }}" class="icon-toolbar" target="_self" onclick="javascript: window.parent.API.save_asset();">
<em class="fa fa-home"></em> <span class="hidden-xs hidden-sm"></span>
</a>
{{ navigation_bar }}
</div>
{# right zone #}
<div id="learning_path_right_zone" class="{{ show_left_column == 1 ? 'content-scorm' : 'no-right-col' }}"> <div id="learning_path_right_zone" class="{{ show_left_column == 1 ? 'content-scorm' : 'no-right-col' }}">
<div class="lp-view-zone-container"> <div class="lp-view-zone-container">
<div class="lp-view-tabs"> <div class="lp-view-tabs">
<div id="navTabsbar" class="nav-tabs-bar"> <div id="navTabsbar" class="nav-tabs-bar">
<ul id="navTabs" class="nav nav-tabs" role="tablist"> <ul id="navTabs" class="nav nav-tabs tabs-right" role="tablist">
<li role="presentation" class="active"> <li role="presentation" class="active">
<a href="#lp-view-content" title="{{ 'Lesson'|trans }}" aria-controls="lp-view-content" role="tab" data-toggle="tab"> <a href="#lp-view-content" title="{{ 'Lesson'|get_lang }}"
aria-controls="lp-view-content" role="tab" data-toggle="tab">
<span class="fa fa-book fa-2x fa-fw" aria-hidden="true"></span> <span class="fa fa-book fa-2x fa-fw" aria-hidden="true"></span>
<span class="sr-only">{{ 'Lesson'|trans }}</span> <span class="sr-only">{{ 'Lesson'|get_lang }}</span>
</a> </a>
</li> </li>
<li role="presentation"> <li role="presentation">
<a href="#lp-view-forum" title="{{ 'Forum'|trans }}" aria-controls="lp-view-forum" role="tab" data-toggle="tab"> <a href="#lp-view-forum" title="{{ 'Forum'|get_lang }}"
aria-controls="lp-view-forum" role="tab" data-toggle="tab">
<span class="fa fa-commenting-o fa-2x fa-fw" aria-hidden="true"></span> <span class="fa fa-commenting-o fa-2x fa-fw" aria-hidden="true"></span>
<span class="sr-only">{{ 'Forum'|trans }}</span> <span class="sr-only">{{ 'Forum'|get_lang }}</span>
</a> </a>
</li> </li>
</ul> </ul>
</div> </div>
<div class="tab-content"> <nav id="btn-menu-float" class="circular-menu">
<div class="circle">
{% if show_left_column == 1 %}
<a href="#" title = "{{ 'Expand'|get_lang }}" id="lp-view-expand-toggle"
class="icon-toolbar expand" role="button">
{% if lp_mode == 'embedframe' %}
<span class="fa fa-compress" aria-hidden="true"></span>
<span class="sr-only">{{ 'Expand'|get_lang }}</span>
{% else %}
<span class="fa fa-expand" aria-hidden="true"></span>
<span class="sr-only">{{ 'Expand'|get_lang }}</span>
{% endif %}
</a>
{% endif %}
<a id="home-course"
title = "{{ 'Home'|get_lang }}"
href="{{ button_home_url }}"
class="icon-toolbar" target="_self"
onclick="javascript: window.parent.API.save_asset();">
<em class="fa fa-home"></em> <span class="hidden-xs hidden-sm"></span>
</a>
{{ navigation_bar }}
</div>
<a class="menu-button fa fa-bars icons" href="#"></a>
</nav>
<div id="tab-iframe" class="tab-content">
<div role="tabpanel" class="tab-pane active" id="lp-view-content"> <div role="tabpanel" class="tab-pane active" id="lp-view-content">
<div id="wrapper-iframe"> <div id="wrapper-iframe">
{% if lp_mode == 'fullscreen' %} {% if lp_mode == 'fullscreen' %}
<iframe id="content_id_blank" name="content_name_blank" src="blank.php" style="width:100%; height:100%" border="0" frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe> <iframe
id="content_id_blank"
name="content_name_blank"
src="blank.php"
style="width:100%; height:100%"
border="0"
frameborder="0"
allowfullscreen="true"
webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
{% else %} {% else %}
<iframe id="content_id" name="content_name" src="{{ iframe_src }}" style="width:100%; height:100%" border="0" frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe> <iframe
id="content_id"
name="content_name"
src="{{ iframe_src }}"
style="width:100%; height:100%"
border="0"
frameborder="0"
allowfullscreen="true"
webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
{% endif %} {% endif %}
</div> </div>
</div> </div>
@ -136,49 +239,43 @@
</div> </div>
<script> <script>
(function () { document.querySelector('.menu-button').onclick = function(e) {
e.preventDefault(); document.querySelector('.circle').classList.toggle('open');
}
var LPViewUtils = { var LPViewUtils = {
setHeightLPToc: function () { setHeightLPToc: function () {
var scormInfoHeight = $('#scorm-info').outerHeight(true); var scormInfoHeight = $('#scorm-info').outerHeight(true);
$('#learning_path_toc').css({ $('#learning_path_toc').css({
top: scormInfoHeight top: scormInfoHeight
}); });
} }
}; };
$(document).on('ready', function () { $(function() {
if (/iPhone|iPod|iPad/.test(navigator.userAgent)) { if (/iPhone|iPod|iPad/.test(navigator.userAgent)) {
// Fix an issue where you cannot scroll below first screen in // Fix an issue where you cannot scroll below first screen in
// learning paths on Apple devices // learning paths on Apple devices
document.getElementById('wrapper-iframe') document.getElementById('wrapper-iframe').setAttribute(
.setAttribute(
'style', 'style',
'width:100%; overflow:auto; position:auto; -webkit-overflow-scrolling:touch !important;' 'width:100%; overflow:auto; position:auto; -webkit-overflow-scrolling:touch !important;'
); );
// Fix another issue whereby buttons do not react to click below // Fix another issue whereby buttons do not react to click below
// second screen in learning paths on Apple devices // second screen in learning paths on Apple devices
document.getElementById('content_id') document.getElementById('content_id').setAttribute('style', 'overflow: auto;');
.setAttribute(
'style',
'overflow: auto;'
);
} }
{% if lp_mode == 'embedframe' %} {% if lp_mode == 'embedframe' %}
//$('#learning_path_main').addClass('lp-view-collapsed'); //$('#learning_path_main').addClass('lp-view-collapsed');
$('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) { $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
e.preventDefault(); e.preventDefault();
$('#learning_path_main').toggleClass('lp-view-collapsed'); $('#learning_path_main').toggleClass('lp-view-collapsed');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-compress'); $('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-expand'); $('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
var className = $('#lp-view-expand-toggle span.fa').attr('class'); var className = $('#lp-view-expand-toggle span.fa').attr('class');
if (className == 'fa fa-expand') { if (className == 'fa fa-expand') {
$(this).attr('title', '{{ "Expand" | trans }}'); $(this).attr('title', '{{ "Expand" | get_lang }}');
} else { } else {
$(this).attr('title', '{{ "Collapse" | trans }}'); $(this).attr('title', '{{ "Collapse" | get_lang }}');
} }
if($('#navTabsbar').is(':hidden')){ if($('#navTabsbar').is(':hidden')){
@ -186,28 +283,19 @@
} else { } else {
$('#navTabsbar').hide(); $('#navTabsbar').hide();
} }
}); });
{% else %} {% else %}
$('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) { $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
e.preventDefault(); e.preventDefault();
$('#learning_path_main').toggleClass('lp-view-collapsed'); $('#learning_path_main').toggleClass('lp-view-collapsed');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-expand'); $('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
$('#lp-view-expand-toggle span.fa').toggleClass('fa-compress'); $('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
var className = $('#lp-view-expand-toggle span.fa').attr('class'); var className = $('#lp-view-expand-toggle span.fa').attr('class');
if (className == 'fa fa-expand') { if (className == 'fa fa-expand') {
$(this).attr('title', '{{ "Expand" | trans }}'); $(this).attr('title', '{{ "Expand" | get_lang }}');
} else {
$(this).attr('title', '{{ "Collapse" | trans }}');
}
if($('#navTabsbar').is(':hidden')){
$('#navTabsbar').show();
} else { } else {
$('#navTabsbar').hide(); $(this).attr('title', '{{ "Collapse" | get_lang }}');
} }
}); });
{% endif %} {% endif %}
@ -218,27 +306,27 @@
$('a#ui-option').on('click', function (e) { $('a#ui-option').on('click', function (e) {
e.preventDefault(); e.preventDefault();
var icon = $(this).children('.fa'); var icon = $(this).children('.fa');
if (icon.is('.fa-chevron-up')) { if (icon.is('.fa-chevron-up')) {
icon.removeClass('fa-chevron-up').addClass('fa-chevron-down'); icon.removeClass('fa-chevron-up').addClass('fa-chevron-down');
return; return;
} }
icon.removeClass('fa-chevron-down').addClass('fa-chevron-up'); icon.removeClass('fa-chevron-down').addClass('fa-chevron-up');
}); });
LPViewUtils.setHeightLPToc(); LPViewUtils.setHeightLPToc();
$('.image-avatar img').load(function () {
LPViewUtils.setHeightLPToc();
});
$('.scorm_item_normal a, #scorm-previous, #scorm-next').on('click', function () { $('.scorm_item_normal a, #scorm-previous, #scorm-next').on('click', function () {
$('.lp-view-tabs').animate({opacity: 0}, 500); $('.lp-view-tabs').animate({opacity: 0}, 500);
}); });
$('#learning_path_right_zone #lp-view-content iframe').on('load', function () { $('#learning_path_right_zone #lp-view-content iframe').on('load', function () {
$('.lp-view-tabs a[href="#lp-view-content"]').tab('show'); $('.lp-view-tabs a[href="#lp-view-content"]').tab('show');
$('.lp-view-tabs').animate({opacity: 1}, 500); $('.lp-view-tabs').animate({opacity: 1}, 500);
}); });
@ -298,34 +386,21 @@
{% endif %} {% endif %}
})(); })();
{% endif %} {% endif %}
{% if disable_js_in_lp_view == 0 %} {% if disable_js_in_lp_view == 0 %}
$(function() {
$('iframe#content_id').on('load', function () { $('iframe#content_id').on('load', function () {
if ('link' !== olms.lms_item_type) { var arr = ['link', 'sco'];
$.frameReady(function () { if ($.inArray(olms.lms_item_type, arr) == -1) {
}, 'top.content_name', { {{ frame_ready }}
load: [
{type: 'script', id: '_fr1', src: '{{ _p.web }}web/assets/jquery/dist/jquery.min.js'},
{type: 'script', id: '_fr7', src: '{{ _p.web }}web/assets/MathJax/MathJax.js?config=AM_HTMLorMML'},
{type: 'script', id: '_fr4', src: '{{ _p.web }}web/assets/jquery-ui/jquery-ui.min.js'},
{type: 'stylesheet', id: '_fr5', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/jquery-ui.min.css'},
{type: 'stylesheet', id: '_fr6', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/theme.css'},
{type: 'script', id: '_fr2', src: '{{ _p.web_lib }}javascript/jquery.highlight.js'},
{type: 'script', id: '_fr3', src: '{{ _p.web_main }}glossary/glossary.js.php?{{ _p.web_cid_query }}'},
{type: 'script', id: '_media1', src: '{{ _p.web }}web/assets/mediaelement/build/mediaelement-and-player.min.js'},
{type: 'stylesheet', id: '_media2', src: '{{ _p.web }}web/assets/mediaelement/build/mediaelementplayer.min.css'},
{type: 'script', id: '_media3', src: '{{ _p.web_lib }}javascript/iframe-js-loader.js'}
]
});
} }
}); });
{% endif %}
}); });
{% endif %}
$(window).on('resize', function () { $(window).on('resize', function () {
LPViewUtils.setHeightLPToc(); LPViewUtils.setHeightLPToc();
}); });
})(); });
</script> </script>
{% endautoescape %} {% endautoescape %}
{% endblock %} {% endblock %}
Loading…
Cancel
Save