Skip to content

Commit f67d2a3

Browse files
committed
Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x
2 parents e3be5dc + 45a6736 commit f67d2a3

File tree

4 files changed

+60
-30
lines changed

4 files changed

+60
-30
lines changed

main/lp/learnpath.class.php

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,17 +1911,18 @@ public function get_navigation_bar($barId = '')
19111911
$previousText = get_lang('ScormPrevious');
19121912
$nextText = get_lang('ScormNext');
19131913
$fullScreenText = get_lang('ScormExitFullScreen');
1914+
$lessonsText = get_lang('LearningPathList');
19141915

19151916
$settings = api_get_configuration_value('lp_view_settings');
19161917
$display = isset($settings['display']) ? $settings['display'] : false;
19171918
$reportingIcon = '
1918-
<a class="icon-toolbar"
1919-
id="stats_link"
1920-
href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lpId.'"
1921-
onclick="window.parent.API.save_asset(); return true;"
1922-
target="content_name" title="'.$reportingText.'">
1923-
<span class="fa fa-info"></span><span class="sr-only">'.$reportingText.'</span>
1924-
</a>';
1919+
<a class="icon-toolbar"
1920+
id="stats_link"
1921+
href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lpId.'"
1922+
onclick="window.parent.API.save_asset(); return true;"
1923+
target="content_name" title="'.$reportingText.'">
1924+
<span class="fa fa-info"></span><span class="sr-only">'.$reportingText.'</span>
1925+
</a>';
19251926

19261927
if (!empty($display)) {
19271928
$showReporting = isset($display['show_reporting_icon']) ? $display['show_reporting_icon'] : true;
@@ -1939,36 +1940,45 @@ public function get_navigation_bar($barId = '')
19391940
$nextIcon = '';
19401941
if ($hideArrows === false) {
19411942
$previousIcon = '
1942-
<a class="icon-toolbar" id="scorm-previous" href="#"
1943-
onclick="switch_item('.$mycurrentitemid.',\'previous\');return false;" title="'.$previousText.'">
1944-
<span class="fa fa-chevron-left"></span><span class="sr-only">'.$previousText.'</span>
1945-
</a>';
1943+
<a class="icon-toolbar" id="scorm-previous" href="#"
1944+
onclick="switch_item('.$mycurrentitemid.',\'previous\');return false;" title="'.$previousText.'">
1945+
<span class="fa fa-chevron-left"></span><span class="sr-only">'.$previousText.'</span>
1946+
</a>';
19461947

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

1955+
$lessonsIcon = '
1956+
<a class="icon-toolbar" id="lessons-link" href="lp_controller.php?'.api_get_cidreq(true).'&reduced=true&isStudentView=true&hide_course_breadcrumb=true"
1957+
onclick="window.parent.API.save_asset(); return true;"
1958+
target="content_name" title="'.$lessonsText.'">
1959+
<span class="fa fa-star"></span><span class="sr-only">'.$lessonsText.'</span>
1960+
</a>';
1961+
19541962
if ($this->mode === 'fullscreen') {
19551963
$navbar = '
1956-
<span id="'.$barId.'" class="buttons">
1957-
'.$reportingIcon.'
1958-
'.$previousIcon.'
1959-
'.$nextIcon.'
1960-
<a class="icon-toolbar" id="view-embedded"
1961-
href="lp_controller.php?action=mode&mode=embedded" target="_top" title="'.$fullScreenText.'">
1962-
<span class="fa fa-columns"></span><span class="sr-only">'.$fullScreenText.'</span>
1963-
</a>
1964-
</span>';
1964+
<span id="'.$barId.'" class="buttons">
1965+
'.$reportingIcon.'
1966+
'.$previousIcon.'
1967+
'.$nextIcon.'
1968+
'.$lessonsIcon.'
1969+
<a class="icon-toolbar" id="view-embedded"
1970+
href="lp_controller.php?action=mode&mode=embedded" target="_top" title="'.$fullScreenText.'">
1971+
<span class="fa fa-columns"></span><span class="sr-only">'.$fullScreenText.'</span>
1972+
</a>
1973+
</span>';
19651974
} else {
19661975
$navbar = '
1967-
<span id="'.$barId.'" class="buttons text-right">
1968-
'.$reportingIcon.'
1969-
'.$previousIcon.'
1970-
'.$nextIcon.'
1971-
</span>';
1976+
<span id="'.$barId.'" class="buttons text-right">
1977+
'.$reportingIcon.'
1978+
'.$previousIcon.'
1979+
'.$nextIcon.'
1980+
'.$lessonsIcon.'
1981+
</span>';
19721982
}
19731983

19741984
return $navbar;

main/lp/lp_controller.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,6 +1732,7 @@ function(reponse) {
17321732
]);
17331733
break;
17341734
default:
1735+
$reduced = isset($_GET['reduced']) && $_GET['reduced'] == 'true';
17351736
require 'lp_list.php';
17361737
break;
17371738
}

main/lp/lp_list.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,8 @@ function confirmation(name) {
10311031
}
10321032
}
10331033

1034-
$template = new Template($nameTools);
1034+
$reduced = (isset($reduced) && $reduced);
1035+
$template = new Template($nameTools, !$reduced);
10351036
$template->assign('first_session_category', $firstSessionCategoryId);
10361037
$template->assign('session_star_icon', Display::return_icon('star.png', get_lang('Session')));
10371038
$template->assign('subscription_settings', $subscriptionSettings);

main/template/default/learnpath/list.tpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66
return false;
77
}
88
}
9+
10+
document.addEventListener("DOMContentLoaded", function () {
11+
const urlParams = new URLSearchParams(window.location.search);
12+
if (urlParams.has("reduced")) {
13+
document.body.addEventListener("click", function (event) {
14+
let target = event.target;
15+
while (target && target.tagName !== "A" && target.tagName !== "BUTTON") {
16+
target = target.parentElement;
17+
}
18+
if (target && target.tagName === "A" && target.href) {
19+
event.preventDefault();
20+
let newUrl = new URL(target.href, window.location.origin);
21+
newUrl.searchParams.delete("reduced");
22+
window.top.location.href = newUrl.href;
23+
}
24+
});
25+
}
26+
});
927
</script>
1028
{% set configuration = 'lp_category_accordion'|api_get_configuration_value %}
1129
<div class="lp-accordion panel-group" id="lp-accordion" role="tablist" aria-multiselectable="true">

0 commit comments

Comments
 (0)