Skip to content

Commit

Permalink
Add option to setting to hide lp navigation with arrows see BT#14938
Browse files Browse the repository at this point in the history
New option in setting added "hide_lp_arrow_navigation":

$_configuration['lp_view_settings'] = [
    'display' => [
        'show_reporting_icon' => true,
        'hide_lp_arrow_navigation' => false,
    ],
];
  • Loading branch information
jmontoyaa committed Oct 29, 2018
1 parent a16f361 commit 744479d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
7 changes: 6 additions & 1 deletion main/install/configuration.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,12 @@
//$_configuration['send_two_inscription_confirmation_mail'] = false;

// LP view custom settings
// $_configuration['lp_view_settings'] = ['display' => ['show_reporting_icon' => true]];
/*$_configuration['lp_view_settings'] = [
'display' => [
'show_reporting_icon' => true,
'hide_lp_arrow_navigation' => false,
],
];*/

// Force to hide the invisible course documents in sessions
//$_configuration['hide_invisible_course_documents_in_sessions'] = false;
Expand Down
33 changes: 22 additions & 11 deletions main/lp/learnpath.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2022,26 +2022,37 @@ public function get_navigation_bar($idBar = null, $display = null)
<span class="fa fa-info"></span><span class="sr-only">'.$reportingText.'</span>
</a>';



if (!empty($display)) {
$showReporting = isset($display['show_reporting_icon']) ? $display['show_reporting_icon'] : true;
if ($showReporting == false) {
$reportingIcon = '';
}
}

$previousIcon = '
<a class="icon-toolbar" id="scorm-previous" href="#"
onclick="switch_item('.$mycurrentitemid.',\'previous\');return false;" title="'.$previousText.'">
<span class="fa fa-chevron-left"></span><span class="sr-only">'.$previousText.'</span>
</a>';
$hideArrows = false;
if (isset($settings['display']) && isset($settings['display']['hide_lp_arrow_navigation'])) {
$hideArrows = $settings['display']['hide_lp_arrow_navigation'];
}

$nextIcon = '
<a class="icon-toolbar" id="scorm-next" href="#"
onclick="switch_item('.$mycurrentitemid.',\'next\');return false;" title="'.$nextText.'">
<span class="fa fa-chevron-right"></span><span class="sr-only">'.$nextText.'</span>
</a>';
$previousIcon = '';
$nextIcon = '';
if ($hideArrows === false) {
$previousIcon = '
<a class="icon-toolbar" id="scorm-previous" href="#"
onclick="switch_item('.$mycurrentitemid.',\'previous\');return false;" title="'.$previousText.'">
<span class="fa fa-chevron-left"></span><span class="sr-only">'.$previousText.'</span>
</a>';

$nextIcon = '
<a class="icon-toolbar" id="scorm-next" href="#"
onclick="switch_item('.$mycurrentitemid.',\'next\');return false;" title="'.$nextText.'">
<span class="fa fa-chevron-right"></span><span class="sr-only">'.$nextText.'</span>
</a>';
}

if ($this->mode == 'fullscreen') {
if ($this->mode === 'fullscreen') {
$navbar = '
<span id="'.$idBar.'" class="buttons">
'.$reportingIcon.'
Expand Down

0 comments on commit 744479d

Please sign in to comment.