Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java
===================================================================
diff -u -rfe06d16b234341fc965d9b40494e6a2fb4cb9438 -r7676f06ab1c200a434600195e4380a30a7b8264b
--- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java (.../AuthoringAction.java) (revision fe06d16b234341fc965d9b40494e6a2fb4cb9438)
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java (.../AuthoringAction.java) (revision 7676f06ab1c200a434600195e4380a30a7b8264b)
@@ -129,6 +129,9 @@
Math.min(accessList.size(), AuthoringAction.LEARNING_DESIGN_ACCESS_ENTRIES_LIMIT - 1));
Gson gson = new GsonBuilder().create();
request.setAttribute("access", gson.toJson(accessList));
+
+ request.setAttribute("licenses", getAuthoringService().getAvailableLicenses());
+
return mapping.findForward("openAutoring");
}
Index: lams_central/web/authoring/authoring.jsp
===================================================================
diff -u -rfe06d16b234341fc965d9b40494e6a2fb4cb9438 -r7676f06ab1c200a434600195e4380a30a7b8264b
--- lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision fe06d16b234341fc965d9b40494e6a2fb4cb9438)
+++ lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 7676f06ab1c200a434600195e4380a30a7b8264b)
@@ -281,22 +281,40 @@
-
-
+
+
Untitled
▼
- Description:
-
-
+ Description:
+
+ License:
+
+ ![]()
+
+
+ Additional license information:
+
+
Index: lams_central/web/css/authoring.css
===================================================================
diff -u -rb92a2c77d9fc93b3a4100d70f95d31a78c4b6792 -r7676f06ab1c200a434600195e4380a30a7b8264b
--- lams_central/web/css/authoring.css (.../authoring.css) (revision b92a2c77d9fc93b3a4100d70f95d31a78c4b6792)
+++ lams_central/web/css/authoring.css (.../authoring.css) (revision 7676f06ab1c200a434600195e4380a30a7b8264b)
@@ -344,14 +344,13 @@
}
#ldDescriptionDiv {
- margin-right: 15px;
background-color: rgb(219, 230, 252);
- text-align: center;
z-index: 1099;
}
#ldDescriptionDiv #ldDescriptionTitleContainer {
padding: 2px 0 0 0;
+ text-align: center;
font-family: "Lucida Console", Monaco, monospace;
font-size: 12px;
cursor: pointer;
@@ -363,19 +362,38 @@
}
#ldDescriptionDiv #ldDescriptionDetails {
+ padding: 0 0 5px 10px;
display: none;
}
-#ldDescriptionDiv #ldDescriptionLabelDescription {
+#ldDescriptionDiv .ldDescriptionLabel {
font-family: "Lucida Console", Monaco, monospace;
- text-align: left;
font-size: 12px;
}
#ldDescriptionDiv #ldDescriptionEditorContainer {
- margin-top: -15px;
+ margin: -15px 0 15px 0;
}
+#ldDescriptionDiv #ldDescriptionLicenseTextContainer,
+#ldDescriptionDiv #ldDescriptionLicenseImage,
+#ldDescriptionDiv #ldDescriptionLicenseButton {
+ display: none;
+}
+
+#ldDescriptionDiv #ldDescriptionLicenseImage {
+ vertical-align: text-bottom;
+ padding: 0 10px;
+}
+
+#ldDescriptionDiv #ldDescriptionLicenseTextContainer {
+ padding-top: 10px;
+}
+
+#ldDescriptionDiv #ldDescriptionLicenseText {
+ width: 99%;
+}
+
#canvas {
overflow: auto;
height: 725px;
Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js
===================================================================
diff -u -r8439bc40054ddba298eda9da46962adbcb954f37 -r7676f06ab1c200a434600195e4380a30a7b8264b
--- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 8439bc40054ddba298eda9da46962adbcb954f37)
+++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 7676f06ab1c200a434600195e4380a30a7b8264b)
@@ -723,6 +723,31 @@
layout.dialogs.push(layout.infoDialog);
+ // license widgets init
+ $('#ldDescriptionLicenseSelect').change(function(){
+ var option = $('option:selected', this);
+ if (option.val() == "0") {
+ $('#ldDescriptionLicenseTextContainer, #ldDescriptionLicenseImage, #ldDescriptionLicenseButton').hide();
+ } else {
+ if (option.attr('url')) {
+ $('#ldDescriptionLicenseTextContainer').hide();
+ $('#ldDescriptionLicenseImage').attr('src', option.attr('pictureURL')).show();
+ $('#ldDescriptionLicenseButton').show();
+ } else {
+ $('#ldDescriptionLicenseTextContainer').show();
+ $('#ldDescriptionLicenseImage, #ldDescriptionLicenseButton').hide();
+ }
+ }
+ });
+ $('#ldDescriptionLicenseButton').click(function(){
+ var option = $('#ldDescriptionLicenseSelect option:selected'),
+ url = option.attr('url');
+ if (url) {
+ var win = window.open(url, '_blank');
+ win.focus();
+ }
+ });
+
window.onbeforeunload = function(){
if (layout.modified &&
(layout.activities.length > 0
@@ -1070,6 +1095,8 @@
if (!isReadOnlyMode) {
$('#ldDescriptionFieldTitle').text('Untitled');
CKEDITOR.instances['ldDescriptionFieldDescription'].setData(null);
+ $('#ldDescriptionLicenseSelect').val(0);
+ $('#ldDescriptionLicenseText').text('');
GeneralLib.setModified(true);
}
@@ -1127,6 +1154,10 @@
if (!isReadOnlyMode) {
$('#ldDescriptionFieldTitle').html(GeneralLib.escapeHtml(ld.title));
CKEDITOR.instances['ldDescriptionFieldDescription'].setData(ld.description);
+ if (ld.licenseID) {
+ $('#ldDescriptionLicenseSelect').val(ld.licenseID || 0).change();
+ $('#ldDescriptionLicenseText').text(ld.licenseText);
+ }
}
var arrangeNeeded = false,
@@ -1974,7 +2005,6 @@
});
});
-
// serialise the sequence
var ld = {
// it is null if it is a new sequence
@@ -1994,7 +2024,10 @@
&& layout.ld.learningDesignID != learningDesignID
? 1 : 0,
'originalLearningDesignID' : null,
-
+ 'licenseID' : $('#ldDescriptionLicenseSelect').val(),
+ 'licenseText' : $('#ldDescriptionLicenseSelect').val() == "0"
+ || $('#ldDescriptionLicenseSelect option:selected').attr('url')
+ ? null : $('#ldDescriptionLicenseText').val(),
'activities' : activities,
'transitions' : transitions,
'groupings' : groupings,
@@ -2003,10 +2036,7 @@
'helpText' : null,
'duration' : null,
- 'licenseID' : null,
- 'licenseText' : null
};
-
// get LD details
$.ajax({
type : 'POST',
|