use of org.olat.core.gui.components.form.flexible.elements.StaticTextElement in project openolat by klemens.
the class EPCollectStepForm00 method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
title = uifactory.addTextElement("title", "artefact.title", 500, artefact.getTitle(), formLayout);
title.setElementCssClass("o_sel_ep_artefact_metadata_title");
title.setMandatory(true);
title.setNotEmptyCheck("artefact.title.not.empty");
title.setNotLongerThanCheck(512, "artefact.title.too.long");
title.setVisible(!simpleMode);
descript = uifactory.addRichTextElementForStringDataMinimalistic("description", "artefact.description", artefact.getDescription(), 7, -1, formLayout, getWindowControl());
descript.setMaxLength(4000);
descript.setNotLongerThanCheck(4000, "artefact.description.too.long");
String artSource = artefact.getSource();
if (StringHelper.containsNonWhitespace(artSource) && !simpleMode) {
uifactory.addStaticTextElement("artefact.source", artSource, formLayout);
}
Date artDate = artefact.getCreationDate();
if (artDate == null)
artDate = new Date();
StaticTextElement date = uifactory.addStaticTextElement("artefact.date", Formatter.getInstance(getLocale()).formatDateAndTime(artDate), formLayout);
date.setVisible(!simpleMode);
String busPath = artefact.getBusinessPath();
if (StringHelper.containsNonWhitespace(busPath) && !simpleMode) {
BusinessControlFactory bCF = BusinessControlFactory.getInstance();
List<ContextEntry> ceList = bCF.createCEListFromString(busPath);
String busLink = bCF.getAsURIString(ceList, true);
if (StringHelper.containsNonWhitespace(busLink)) {
String finalPath = "<a href=\"" + busLink + "\">" + busLink + "</a>";
uifactory.addStaticTextElement("artefact.link", finalPath, formLayout);
}
}
if (!isUsedInStepWizzard()) {
// add form buttons
uifactory.addFormSubmitButton("stepform.submit", formLayout);
}
}
use of org.olat.core.gui.components.form.flexible.elements.StaticTextElement in project openolat by klemens.
the class PreviewLA method getFormItem.
/**
* @see org.olat.course.config.ui.courselayout.attribs.AbstractLayoutAttribute#getFormItem(java.lang.String, org.olat.core.gui.components.form.flexible.FormItemContainer)
*/
@Override
public FormItem getFormItem(String compName, FormItemContainer formLayout) {
FormUIFactory uifact = FormUIFactory.getInstance();
String textEl = new String("<span style=\"" + getAttributeValue() + "\">" + formLayout.getTranslator().translate("preview.sample") + "</span>");
StaticTextElement fi = uifact.addStaticTextElement(compName, null, textEl, formLayout);
return fi;
}
use of org.olat.core.gui.components.form.flexible.elements.StaticTextElement in project openolat by klemens.
the class FormUIFactory method addStaticTextElement.
/**
* Add a static text.
* @param name
* @param i18nLabel
* @param translatedText
* @param formLayout
* @return
*/
public StaticTextElement addStaticTextElement(String name, String i18nLabel, String translatedText, FormItemContainer formLayout) {
StaticTextElement ste = new StaticTextElementImpl(name, translatedText == null ? "" : translatedText);
setLabelIfNotNull(i18nLabel, ste);
formLayout.add(ste);
return ste;
}
use of org.olat.core.gui.components.form.flexible.elements.StaticTextElement in project openolat by klemens.
the class EditDueDatesController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
ModuleConfiguration config = gtaNode.getModuleConfiguration();
Date assignmentDueDate = task.getAssignmentDueDate();
assignmentDueDateEl = uifactory.addDateChooser("assignment.duedate", assignmentDueDate, formLayout);
assignmentDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardAssignmentDueDate = gtaManager.getAssignmentDueDate(task, assessedIdentity, assessedGroup, gtaNode, courseEntry, false);
setDueDateExplanation(assignmentDueDateEl, standardAssignmentDueDate);
assignmentDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT));
Date submissionDueDate = task.getSubmissionDueDate();
submissionDueDateEl = uifactory.addDateChooser("submission.duedate", submissionDueDate, formLayout);
submissionDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardSubmissionDueDate = gtaManager.getSubmissionDueDate(task, assessedIdentity, assessedGroup, gtaNode, courseEntry, false);
setDueDateExplanation(submissionDueDateEl, standardSubmissionDueDate);
boolean submissionDeadline = config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT);
submissionDueDateEl.setVisible(submissionDeadline);
if (submissionDeadline && task.getTaskStatus().ordinal() > TaskProcess.submit.ordinal()) {
StaticTextElement warningReopenEl = uifactory.addStaticTextElement("reopen", translate("warning.reopen"), formLayout);
warningReopenEl.setElementCssClass("o_gta_reopen_warning");
warningReopenEl.setLabel(null, null);
}
Date revisionsDueDate = task.getRevisionsDueDate();
revisionDueDateEl = uifactory.addDateChooser("revisions.duedate", revisionsDueDate, formLayout);
revisionDueDateEl.setDateChooserTimeEnabled(true);
revisionDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD));
Date solutionDueDate = task.getSolutionDueDate();
solutionDueDateEl = uifactory.addDateChooser("solution.duedate", solutionDueDate, formLayout);
solutionDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardSolutionDueDate = gtaManager.getSolutionDueDate(task, assessedIdentity, assessedGroup, gtaNode, courseEntry, true);
setDueDateExplanation(solutionDueDateEl, standardSolutionDueDate);
solutionDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION));
FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
formLayout.add(buttonsCont);
uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
uifactory.addFormSubmitButton("save", buttonsCont);
}
use of org.olat.core.gui.components.form.flexible.elements.StaticTextElement in project openolat by klemens.
the class EditMultipleDueDatesController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
ModuleConfiguration config = gtaNode.getModuleConfiguration();
assignmentDueDateEl = uifactory.addDateChooser("assignment.duedate", null, formLayout);
assignmentDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardAssignmentDueDate = gtaManager.getAssignmentDueDate(null, null, null, gtaNode, courseEntry, false);
setDueDateExplanation(assignmentDueDateEl, standardAssignmentDueDate);
assignmentDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_ASSIGNMENT));
submissionDueDateEl = uifactory.addDateChooser("submission.duedate", null, formLayout);
submissionDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardSubmissionDueDate = gtaManager.getSubmissionDueDate(null, null, null, gtaNode, courseEntry, false);
setDueDateExplanation(submissionDueDateEl, standardSubmissionDueDate);
boolean submissionDeadline = config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT);
submissionDueDateEl.setVisible(submissionDeadline);
if (submissionDeadline) {
for (Task task : tasks) {
if (task.getTaskStatus().ordinal() > TaskProcess.submit.ordinal()) {
StaticTextElement warningReopenEl = uifactory.addStaticTextElement("reopen", translate("warning.reopen"), formLayout);
warningReopenEl.setElementCssClass("o_gta_reopen_warning");
warningReopenEl.setLabel(null, null);
break;
}
}
}
revisionDueDateEl = uifactory.addDateChooser("revisions.duedate", null, formLayout);
revisionDueDateEl.setDateChooserTimeEnabled(true);
revisionDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD));
solutionDueDateEl = uifactory.addDateChooser("solution.duedate", null, formLayout);
solutionDueDateEl.setDateChooserTimeEnabled(true);
DueDate standardSolutionDueDate = gtaManager.getSolutionDueDate(null, null, null, gtaNode, courseEntry, false);
setDueDateExplanation(solutionDueDateEl, standardSolutionDueDate);
solutionDueDateEl.setVisible(config.getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION));
FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
formLayout.add(buttonsCont);
uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
uifactory.addFormSubmitButton("save", buttonsCont);
}
Aggregations