Admin: Learnpath: Add configuration setting 'lp_ios_hide_open_in_new_window_button' to remove button in lp on iOS - refs #4954

Author: Juan Cortizas Ponte <124381395+juancpbinario@users.noreply.github.com>
pull/4990/head
juancp-contidosdixitais 2 years ago committed by GitHub
parent 2c0f90ba0c
commit eb6e4d30ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      main/install/configuration.dist.php
  2. 7
      main/lp/lp_view.php
  3. 38
      main/template/default/learnpath/view.tpl

@ -1634,6 +1634,9 @@ requires extension "php-soap" sudo apt-get install php-soap
// LP view menu location. Options: "left" or "right" // LP view menu location. Options: "left" or "right"
// $_configuration['lp_menu_location'] = 'left'; // $_configuration['lp_menu_location'] = 'left';
// Hide the "Open in new window" button in learning paths when viewing long content (using the button disconnects SCORM tracking - more details in #4954)
//$_configuration['lp_ios_hide_open_in_new_window_button'] = false;
// Show notification events // Show notification events
/*CREATE TABLE IF NOT EXISTS notification_event ( /*CREATE TABLE IF NOT EXISTS notification_event (
id INT unsigned NOT NULL auto_increment PRIMARY KEY, id INT unsigned NOT NULL auto_increment PRIMARY KEY,

@ -656,6 +656,13 @@ $template->assign(
) )
); );
// Check if the 'Open in new window' button for IOs hosts must be hidden
$iosHideOpenInNewWindow = false;
if (api_get_configuration_value('lp_ios_hide_open_in_new_window_button') === true) {
$iosHideOpenInNewWindow = api_get_configuration_value('lp_ios_hide_open_in_new_window_button');
}
$template->assign('ios_hide_open_in_new_window', $iosHideOpenInNewWindow);
$frameReady = Display::getFrameReadyBlock( $frameReady = Display::getFrameReadyBlock(
'#content_id, #content_id_blank', '#content_id, #content_id_blank',
$itemType, $itemType,

@ -255,23 +255,27 @@
'style', 'style',
'width:100%; overflow:auto; position:auto; -webkit-overflow-scrolling:touch !important;' 'width:100%; overflow:auto; position:auto; -webkit-overflow-scrolling:touch !important;'
); );
$('<a>')
.attr({ {% if ios_hide_open_in_new_window == false %}
'id': 'btn-content-new-tab', $('<a>')
'target': '_blank', .attr({
'href': '{{ iframe_src }}' 'id': 'btn-content-new-tab',
}) 'target': '_blank',
.css({ 'href': '{{ iframe_src }}'
'position': 'absolute', })
'right': '5px', .css({
'top': '5px', 'position': 'absolute',
'z-index': '9999', 'right': '5px',
'font-weight': 'bold' 'top': '5px',
}) 'z-index': '9999',
.addClass('btn btn-default btn-sm') 'font-weight': 'bold'
.text('{{ 'OpenContentInNewTab'|get_lang|escape('js') }}') })
.prependTo('#wrapper-iframe'); .addClass('btn btn-default btn-sm')
$('#wrapper-iframe').css('position', 'relative'); .text('{{ 'OpenContentInNewTab'|get_lang|escape('js') }}')
.prependTo('#wrapper-iframe');
$('#wrapper-iframe').css('position', 'relative');
{% endif %}
// 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').setAttribute('style', 'overflow: auto;'); document.getElementById('content_id').setAttribute('style', 'overflow: auto;');

Loading…
Cancel
Save