Skip to content

Commit cc09774

Browse files
committed
SAK-51198: Lesson Print All restore
1 parent 37ff2fe commit cc09774

File tree

6 files changed

+32
-1
lines changed

6 files changed

+32
-1
lines changed

Diff for: config/configuration/bundles/src/bundle/org/sakaiproject/config/bundle/default.sakai.properties

+5
Original file line numberDiff line numberDiff line change
@@ -4607,6 +4607,11 @@
46074607
# DEFAULT: false
46084608
# lessonbuilder.personalize.text=true
46094609

4610+
# Allows the user to print all the lesson pages using a button next to the "Print" option
4611+
# Nowadays, is not a good idea to turn on this property, as it can cause performance issues, if it's specially needed, then enable it
4612+
# DEFAULT: false
4613+
# lessonbuilder.printAll=true
4614+
46104615
## END LESSONBUILDER
46114616

46124617
# If you don't want to use ui.service as the Production name, use:

Diff for: lessonbuilder/api/src/resources/lessons.properties

+1
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ simplepage.edit_youtube=Edit YouTube Link Below
462462
simplepage.edit_movie=Edit Item Below
463463
simplepage.open_new_window=Open in new window
464464
simplepage.print_view=Print
465+
simplepage.print_all=Print All
465466
simplepage.edititems=Edit Items
466467
simplepage.itemstatus=Item Status
467468
simplepage.items=Items

Diff for: lessonbuilder/api/src/resources/lessons_es.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ simplepage.edit_youtubelink=Editar en el enlace de Youtube
460460
simplepage.edit_youtube=Editar el siguiente enlace de Youtube
461461
simplepage.edit_movie=Editar el siguiente \u00edtem
462462
simplepage.open_new_window=Abrir en una ventana nueva
463-
simplepage.print_view=Vista de impresi\u00f3n
463+
simplepage.print_view=Imprimir
464+
simplepage.print_all=Imprimir todo
464465
simplepage.edititems=Editar \u00edtems
465466
simplepage.itemstatus=Estado del \u00edtem
466467
simplepage.items=\u00cdtems

Diff for: lessonbuilder/tool/src/java/org/sakaiproject/lessonbuildertool/tool/producers/ShowPageProducer.java

+9
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,15 @@ public void fillComponents(UIContainer tofill, ViewParameters viewParams, Compon
690690
showAll.setSource("summary");
691691
UIInternalLink.make(tofill, "print-view", showAll)
692692
.decorate(new UITooltipDecorator(messageLocator.getMessage("simplepage.print_view")));
693+
694+
boolean isLessonPrintAllEnabled = ServerConfigurationService.getBoolean("lessonbuilder.printAll", false);
695+
696+
if (isLessonPrintAllEnabled) {
697+
UIOutput.make(tofill, "show-print-all");
698+
}
699+
700+
UIInternalLink.make(tofill, "print-all", showAll)
701+
.decorate(new UITooltipDecorator(messageLocator.getMessage("simplepage.print_all")));
693702
UIInternalLink.make(tofill, "show-pages", showAll)
694703
.decorate(new UITooltipDecorator(messageLocator.getMessage("simplepage.showallpages")));
695704

Diff for: lessonbuilder/tool/src/webapp/js/show-page.js

+9
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ $(window).load(function () {
3939
window.print();
4040
});
4141

42+
// Print all pages
43+
document.getElementById('print-all').addEventListener('click', function() {
44+
const url = printViewWithParameter(window.location.href);
45+
const win = window.open(url, '_blank');
46+
win.focus();
47+
win.print();
48+
return false;
49+
});
50+
4251
});
4352

4453
function fixAddBefore(href) {

Diff for: lessonbuilder/tool/src/webapp/templates/ShowPage.html

+6
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ <h2 id="toolbar-label" rsf:id="msg=simplepage.toolbar" class="lb-offscreen"></h2
146146
<span class="bi-printer" aria-hidden="true"></span>
147147
</a>
148148
</span>
149+
<span class="contentButton" rsf:id="show-print-all">
150+
<a role="button" href="#" rsf:id="print-all" id="print-all" class="btn btn-link my-1 Mrphs-toolTitleNav__link top-icon">
151+
<span rsf:id="msg=simplepage.print_all" class="Mrphs-itemTitle me-1 d-none d-xl-inline-block"></span>
152+
<span class="bi-printer-fill" aria-hidden="true"></span>
153+
</a>
154+
</span>
149155
<span class="contentButton">
150156
<a role="button" href="#" rsf:id="show-pages" id="show-pages" class="btn btn-link my-1 Mrphs-toolTitleNav__link top-icon">
151157
<span rsf:id="msg=simplepage.showallpages" class="Mrphs-itemTitle me-1 d-none d-lg-inline-block"></span>

0 commit comments

Comments
 (0)