Skip to content

Commit bb86ee5

Browse files
author
\nrlucke
committed
add pdf export
1 parent c8dd8c1 commit bb86ee5

85 files changed

Lines changed: 1464 additions & 126 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ end_of_line = lf
1212
charset = utf-8
1313
trim_trailing_whitespace = true
1414

15+
[*.php]
16+
indent_size = 4
17+
1518
[*.md]
1619
trim_trailing_whitespace = false

Courseware.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ public function getInfoTemplate($courseId)
266266

267267
public function perform($unconsumedPath)
268268
{
269+
define("K_TCPDF_CALLS_IN_HTML", true);
270+
269271
if ((!$this->isActivated($this->container['cid']))&& ($_SERVER['REQUEST_METHOD'] === 'GET')) {
270272
throw new AccessDeniedException('plugin not activated for this course!');
271273
}

assets/less/block_manager.less

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,32 @@
1414
flex-direction: row;
1515
flex-wrap: wrap;
1616
align-items: flex-start;
17+
18+
.action-menu-item {
19+
.set-groups {
20+
.assets-bg-icon("blue/group3.svg");
21+
}
22+
.set-users{
23+
.assets-bg-icon("blue/headache.svg");
24+
}
25+
.edit-element{
26+
.assets-bg-icon("blue/edit.svg");
27+
}
28+
.remove-element{
29+
.assets-bg-icon("blue/trash.svg");
30+
}
31+
.add-child-element {
32+
.assets-bg-icon("blue/add.svg");
33+
}
34+
a {
35+
padding-left: 32px;
36+
background-repeat: no-repeat;
37+
background-position-x: left;
38+
background-size: 24px;
39+
line-height: 34px;
40+
background-position-y: 3px;
41+
}
42+
}
1743
}
1844
.cw-blockmanager-wrapper {
1945
border: solid thin #28497c;
@@ -664,31 +690,6 @@
664690
padding: 1em 1em 1em 3em;
665691
}
666692
}
667-
.action-menu-item {
668-
.set-groups {
669-
.assets-bg-icon("blue/group3.svg");
670-
}
671-
.set-users{
672-
.assets-bg-icon("blue/headache.svg");
673-
}
674-
.edit-element{
675-
.assets-bg-icon("blue/edit.svg");
676-
}
677-
.remove-element{
678-
.assets-bg-icon("blue/trash.svg");
679-
}
680-
.add-child-element {
681-
.assets-bg-icon("blue/add.svg");
682-
}
683-
a {
684-
padding-left: 32px;
685-
background-repeat: no-repeat;
686-
background-position-x: left;
687-
background-size: 24px;
688-
line-height: 34px;
689-
background-position-y: 3px;
690-
}
691-
}
692693

693694
/* DIALOGS */
694695
.modal-backdrop {

assets/static/courseware.css

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,34 @@ button.cw-reset-progress-button:hover {
11301130
-ms-flex-align: start;
11311131
align-items: flex-start;
11321132
}
1133+
#block_manager-index #cw-blockmanager-content .action-menu-item .set-groups {
1134+
background-image: url("../../../../assets/images/icons/blue/group3.svg");
1135+
background-image: url("../../../../../assets/images/icons/blue/group3.svg");
1136+
}
1137+
#block_manager-index #cw-blockmanager-content .action-menu-item .set-users {
1138+
background-image: url("../../../../assets/images/icons/blue/headache.svg");
1139+
background-image: url("../../../../../assets/images/icons/blue/headache.svg");
1140+
}
1141+
#block_manager-index #cw-blockmanager-content .action-menu-item .edit-element {
1142+
background-image: url("../../../../assets/images/icons/blue/edit.svg");
1143+
background-image: url("../../../../../assets/images/icons/blue/edit.svg");
1144+
}
1145+
#block_manager-index #cw-blockmanager-content .action-menu-item .remove-element {
1146+
background-image: url("../../../../assets/images/icons/blue/trash.svg");
1147+
background-image: url("../../../../../assets/images/icons/blue/trash.svg");
1148+
}
1149+
#block_manager-index #cw-blockmanager-content .action-menu-item .add-child-element {
1150+
background-image: url("../../../../assets/images/icons/blue/add.svg");
1151+
background-image: url("../../../../../assets/images/icons/blue/add.svg");
1152+
}
1153+
#block_manager-index #cw-blockmanager-content .action-menu-item a {
1154+
padding-left: 32px;
1155+
background-repeat: no-repeat;
1156+
background-position-x: left;
1157+
background-size: 24px;
1158+
line-height: 34px;
1159+
background-position-y: 3px;
1160+
}
11331161
#block_manager-index .cw-blockmanager-wrapper {
11341162
border: solid thin #28497c;
11351163
border-top: none;
@@ -1332,12 +1360,14 @@ button.cw-reset-progress-button:hover {
13321360
background-image: url("../../../../../assets/images/icons/white/link-intern.svg");
13331361
}
13341362
#block_manager-index .cw-blockmanager-wrapper ul#cw-action-selection li #cw-export-download,
1335-
#block_manager-index .cw-blockmanager-wrapper ul#cw-action-selection li #cw-export-html-download {
1363+
#block_manager-index .cw-blockmanager-wrapper ul#cw-action-selection li #cw-export-html-download,
1364+
#block_manager-index .cw-blockmanager-wrapper ul#cw-action-selection li #cw-export-pdf-download {
13361365
background-image: url("../../../../assets/images/icons/blue/download.svg");
13371366
background-image: url("../../../../../assets/images/icons/blue/download.svg");
13381367
}
13391368
#block_manager-index .cw-blockmanager-wrapper ul#cw-action-selection li #cw-export-download:hover,
1340-
#block_manager-index .cw-blockmanager-wrapper ul#cw-action-selection li #cw-export-html-download:hover {
1369+
#block_manager-index .cw-blockmanager-wrapper ul#cw-action-selection li #cw-export-html-download:hover,
1370+
#block_manager-index .cw-blockmanager-wrapper ul#cw-action-selection li #cw-export-pdf-download:hover {
13411371
background-image: url("../../../../assets/images/icons/white/download.svg");
13421372
background-image: url("../../../../../assets/images/icons/white/download.svg");
13431373
}

assets/static/courseware.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/static/courseware.js

Lines changed: 53 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -107473,31 +107473,35 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
107473107473
context.closePath();
107474107474
});
107475107475
},
107476-
fitTextToShape: function fitTextToShape(context, text, shape_width) {
107477-
var text_width = context.measureText(text).width;
107478-
if (text_width > shape_width) {
107479-
text = text.split(' ');
107480-
var line = "";
107481-
var word = " ";
107482-
var new_text = [];
107483-
do {
107484-
word = text.shift();
107485-
if (context.measureText(word).width >= shape_width) {
107486-
return [''];
107487-
}
107488-
line = line + word + " ";
107489-
if (context.measureText(line).width > shape_width) {
107490-
text.unshift(word);
107491-
line = line.substring(0, line.lastIndexOf(word));
107492-
new_text.push(line.trim());
107493-
line = "";
107494-
}
107495-
} while (text.length > 0);
107496-
new_text.push(line.trim());
107497-
return new_text;
107498-
} else {
107476+
fitTextToShape: function fitTextToShape(context, text, shapeWidth) {
107477+
shapeWidth = shapeWidth || 0;
107478+
107479+
var newText = [];
107480+
107481+
if (shapeWidth <= 0) {
107499107482
return [text];
107500107483
}
107484+
var words = text.split(' ');
107485+
var i = 1;
107486+
while (words.length > 0 && i <= words.length) {
107487+
var word = words.slice(0, i).join(' ');
107488+
var wordWidth = context.measureText(word).width + 2;
107489+
if (wordWidth > shapeWidth) {
107490+
if (i === 1) {
107491+
i = 2;
107492+
}
107493+
newText.push(words.slice(0, i - 1).join(' '));
107494+
words = words.splice(i - 1);
107495+
i = 1;
107496+
} else {
107497+
i++;
107498+
}
107499+
}
107500+
if (i > 0) {
107501+
newText.push(words.join(' '));
107502+
}
107503+
107504+
return newText;
107501107505
},
107502107506
mapImage: function mapImage() {
107503107507
var $img = this.$('.cw-image-from-canvas');
@@ -107747,32 +107751,35 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
107747107751
context.closePath();
107748107752
});
107749107753
},
107750-
fitTextToShape: function fitTextToShape(context, text, shape_width) {
107751-
var text_width = context.measureText(text).width;
107752-
if (text_width > shape_width) {
107753-
text = text.split(' ');
107754-
var line = "";
107755-
var word = " ";
107756-
var new_text = [];
107757-
do {
107758-
word = text.shift();
107759-
if (context.measureText(word).width >= shape_width) {
107760-
return ['#error'];
107761-
}
107762-
line = line + word + " ";
107763-
if (context.measureText(line).width > shape_width) {
107764-
text.unshift(word);
107765-
line = line.substring(0, line.lastIndexOf(word));
107766-
new_text.push(line.trim());
107767-
line = "";
107768-
}
107769-
} while (text.length > 0);
107770-
new_text.push(line.trim());
107754+
fitTextToShape: function fitTextToShape(context, text, shapeWidth) {
107755+
shapeWidth = shapeWidth || 0;
107771107756

107772-
return new_text;
107773-
} else {
107757+
var newText = [];
107758+
107759+
if (shapeWidth <= 0) {
107774107760
return [text];
107775107761
}
107762+
var words = text.split(' ');
107763+
var i = 1;
107764+
while (words.length > 0 && i <= words.length) {
107765+
var word = words.slice(0, i).join(' ');
107766+
var wordWidth = context.measureText(word).width + 2;
107767+
if (wordWidth > shapeWidth) {
107768+
if (i === 1) {
107769+
i = 2;
107770+
}
107771+
newText.push(words.slice(0, i - 1).join(' '));
107772+
words = words.splice(i - 1);
107773+
i = 1;
107774+
} else {
107775+
i++;
107776+
}
107777+
}
107778+
if (i > 0) {
107779+
newText.push(words.join(' '));
107780+
}
107781+
107782+
return newText;
107776107783
},
107777107784
hitTest: function hitTest(mouseX, mouseY, shape) {
107778107785
if (shape.type == 'arc') {

assets/static/courseware.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/vue/js/chunk-9ca2dfa4.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/vue/js/chunk-9ca2dfa4.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)