Skip to content
Snippets Groups Projects
Commit be913330 authored by Matthai Kurian's avatar Matthai Kurian
Browse files

OO-307: Added ways to configure short/long titles in course display

parent 368a8e0e
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,9 @@ public class NodeConfigFormController extends FormBasicController {
public final static int SHORT_TITLE_MAX_LENGTH =25;
private final static String[] displayOptionsKeys = new String[]{
CourseNode.DISPLAY_OPTS_SHORT_TITLE_DESCRIPTION_CONTENT,
CourseNode.DISPLAY_OPTS_TITLE_DESCRIPTION_CONTENT,
CourseNode.DISPLAY_OPTS_SHORT_TITLE_CONTENT,
CourseNode.DISPLAY_OPTS_TITLE_CONTENT,
CourseNode.DISPLAY_OPTS_CONTENT};
......@@ -155,7 +157,9 @@ public class NodeConfigFormController extends FormBasicController {
objectives.setMaxLength(4000);
String[] values = new String[]{
translate("nodeConfigForm.short_title_desc_content"),
translate("nodeConfigForm.title_desc_content"),
translate("nodeConfigForm.short_title_content"),
translate("nodeConfigForm.title_content"),
translate("nodeConfigForm.content_only")};
displayOptions = uifactory.addDropdownSingleselect("displayOptions", "nodeConfigForm.display_options", formLayout, displayOptionsKeys, values, null);
......
......@@ -415,7 +415,9 @@ nodeConfigForm.menutitle=Kurzer Titel
nodeConfigForm.save=Speichern
nodeConfigForm.title=Titel und Beschreibung des Kursbausteins
nodeConfigForm.display_options=Anzeige
nodeConfigForm.short_title_desc_content=Kurztitel, Beschreibung und Inhalt
nodeConfigForm.title_desc_content=Titel, Beschreibung und Inhalt
nodeConfigForm.short_title_content=Kurztitel und Inhalt
nodeConfigForm.title_content=Titel und Inhalt
nodeConfigForm.content_only=Nur Inhalt
nodeEdit.extLink=Externer Link
......
......@@ -407,7 +407,9 @@ nodeConfigForm.menutitle=Short title
nodeConfigForm.save=Save
nodeConfigForm.title=Title and description of course element
nodeConfigForm.title_content=Title and content
nodeConfigForm.short_title_content=Short title and content
nodeConfigForm.title_desc_content=Title, description and content
nodeConfigForm.short_title_desc_content=Short title, description and content
nodeEdit.extLink=External link
nodeEdit.intLink=Internal link (do not open in new window)
nodeEdit.links=Set link for this course element
......
......@@ -54,7 +54,9 @@ import org.olat.repository.RepositoryEntry;
*/
public interface CourseNode extends INode, ShortName {
public static final String DISPLAY_OPTS_SHORT_TITLE_DESCRIPTION_CONTENT = "shorttitle+desc+content";
public static final String DISPLAY_OPTS_TITLE_DESCRIPTION_CONTENT = "title+desc+content";
public static final String DISPLAY_OPTS_SHORT_TITLE_CONTENT = "shorttitle+content";
public static final String DISPLAY_OPTS_TITLE_CONTENT = "title+content";
public static final String DISPLAY_OPTS_CONTENT = "content";
......
......@@ -40,7 +40,7 @@ public class TitledWrapperHelper {
String displayOption = courseNode.getDisplayOption();
if(CourseNode.DISPLAY_OPTS_CONTENT.equals(displayOption)) {
return controller;
} else if (CourseNode.DISPLAY_OPTS_TITLE_CONTENT.equals(displayOption)) {
} else if (CourseNode.DISPLAY_OPTS_SHORT_TITLE_CONTENT.equals(displayOption)) {
TitleInfo titleInfo = new TitleInfo(null, courseNode.getShortTitle(), null, courseNode.getIdent());
titleInfo.setDescriptionCssClass("o_course_run_objectives");
TitledWrapperController titledController = new TitledWrapperController(ureq, wControl, controller, "o_course_run", titleInfo);
......@@ -48,13 +48,39 @@ public class TitledWrapperHelper {
titledController.setTitleCssClass(" b_with_small_icon_left " + iconCssClass + " ");
}
return titledController;
} else if (CourseNode.DISPLAY_OPTS_TITLE_CONTENT.equals(displayOption)) {
TitleInfo titleInfo = new TitleInfo(null, courseNode.getLongTitle(), null, courseNode.getIdent());
titleInfo.setDescriptionCssClass("o_course_run_objectives");
TitledWrapperController titledController = new TitledWrapperController(ureq, wControl, controller, "o_course_run", titleInfo);
if (StringHelper.containsNonWhitespace(iconCssClass)) {
titledController.setTitleCssClass(" b_with_small_icon_left " + iconCssClass + " ");
}
return titledController;
} else if (CourseNode.DISPLAY_OPTS_SHORT_TITLE_DESCRIPTION_CONTENT.equals(displayOption)) {
String title = courseNode.getShortTitle();
String description = null;
if (StringHelper.containsNonWhitespace(courseNode.getLearningObjectives())) {
if (StringHelper.containsNonWhitespace(title)) {
description = "<h4>" + title + "</h4>" + courseNode.getLearningObjectives();
} else {
description = courseNode.getLearningObjectives();
}
}
TitleInfo titleInfo = new TitleInfo(null, courseNode.getShortTitle(), description, courseNode.getIdent());
titleInfo.setDescriptionCssClass("o_course_run_objectives");
TitledWrapperController titledController = new TitledWrapperController(ureq, wControl, controller, "o_course_run", titleInfo);
if (StringHelper.containsNonWhitespace(iconCssClass)) {
titledController.setTitleCssClass(" b_with_small_icon_left " + iconCssClass + " ");
}
return titledController;
} else if (CourseNode.DISPLAY_OPTS_TITLE_DESCRIPTION_CONTENT.equals(displayOption)) {
String longTitle = courseNode.getLongTitle();
String title = courseNode.getLongTitle();
String description = null;
if (StringHelper.containsNonWhitespace(courseNode.getLearningObjectives())) {
if (StringHelper.containsNonWhitespace(longTitle)) {
description = "<h4>" + longTitle + "</h4>" + courseNode.getLearningObjectives();
if (StringHelper.containsNonWhitespace(title)) {
description = "<h4>" + title + "</h4>" + courseNode.getLearningObjectives();
} else {
description = courseNode.getLearningObjectives();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment