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. 4
      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"
// $_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
/*CREATE TABLE IF NOT EXISTS notification_event (
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(
'#content_id, #content_id_blank',
$itemType,

@ -255,6 +255,8 @@
'style',
'width:100%; overflow:auto; position:auto; -webkit-overflow-scrolling:touch !important;'
);
{% if ios_hide_open_in_new_window == false %}
$('<a>')
.attr({
'id': 'btn-content-new-tab',
@ -272,6 +274,8 @@
.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
// second screen in learning paths on Apple devices
document.getElementById('content_id').setAttribute('style', 'overflow: auto;');

Loading…
Cancel
Save