use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.
the class BinderPageListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
super.initForm(formLayout, listener, ureq);
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
StringBuilder ownerSb = new StringBuilder();
for (Identity owner : owners) {
if (ownerSb.length() > 0)
ownerSb.append(", ");
ownerSb.append(userManager.getUserDisplayName(owner));
}
layoutCont.contextPut("owners", ownerSb.toString());
layoutCont.contextPut("binderKey", binder.getKey());
layoutCont.contextPut("binderTitle", StringHelper.escapeHtml(binder.getTitle()));
}
FlexiTableSortOptions options = new FlexiTableSortOptions();
options.setFromColumnModel(false);
options.setDefaultOrderBy(new SortKey(null, false));
tableEl.setSortSettings(options);
previousSectionLink = uifactory.addFormLink("section.paging.previous", formLayout, Link.BUTTON | Link.NONTRANSLATED);
previousSectionLink.setVisible(false);
previousSectionLink.setIconLeftCSS("o_icon o_icon_move_left");
nextSectionLink = uifactory.addFormLink("section.paging.next", formLayout, Link.BUTTON | Link.NONTRANSLATED);
nextSectionLink.setVisible(false);
nextSectionLink.setIconRightCSS("o_icon o_icon_move_right");
showAllSectionsLink = uifactory.addFormLink("section.paging.all", formLayout, Link.BUTTON);
showAllSectionsLink.setVisible(false);
if (secCallback.canAddSection()) {
newSectionButton = uifactory.addFormLink("create.new.section", formLayout, Link.BUTTON);
newSectionButton.setCustomEnabledLinkCSS("btn btn-primary o_sel_pf_new_section");
}
}
use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.
the class InvitationEmailController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
formLayout.setElementCssClass("o_sel_pf_invitation_form");
mailEl = uifactory.addTextElement("mail", "mail", 128, "", formLayout);
mailEl.setElementCssClass("o_sel_pf_invitation_mail");
mailEl.setMandatory(true);
mailEl.setNotEmptyCheck("map.share.empty.warn");
FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
formLayout.add(buttonsCont);
buttonsCont.setRootForm(mainForm);
uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
uifactory.addFormSubmitButton("validate.email", buttonsCont);
}
use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.
the class SectionDatesEditController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
uifactory.addStaticTextElement("title", "title", section.getTitle(), formLayout);
beginDateEl = uifactory.addDateChooser("begin.date", "begin.date", section.getBeginDate(), formLayout);
endDateEl = uifactory.addDateChooser("end.date", "end.date", section.getEndDate(), formLayout);
FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
buttonsCont.setRootForm(mainForm);
formLayout.add(buttonsCont);
if (section != null && section.getKey() != null) {
uifactory.addFormSubmitButton("save", buttonsCont);
} else {
uifactory.addFormSubmitButton("create.section", buttonsCont);
}
uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
}
use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.
the class AssignmentMoveController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
formLayout.setElementCssClass("o_sel_pf_edit_assignment_form");
List<Section> sections = portfolioService.getSections(binder);
String selectedKey = null;
int numOfSections = sections.size();
String[] theKeys = new String[numOfSections];
String[] theValues = new String[numOfSections];
for (int i = 0; i < numOfSections; i++) {
Long sectionKey = sections.get(i).getKey();
theKeys[i] = sectionKey.toString();
theValues[i] = (i + 1) + ". " + sections.get(i).getTitle();
if (section != null && section.getKey().equals(sectionKey)) {
selectedKey = theKeys[i];
}
}
sectionsEl = uifactory.addDropdownSingleselect("sections", "page.sections", formLayout, theKeys, theValues, null);
if (selectedKey != null) {
sectionsEl.select(selectedKey, true);
}
FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
buttonsCont.setRootForm(mainForm);
formLayout.add(buttonsCont);
uifactory.addFormSubmitButton("move", buttonsCont);
uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
}
use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.
the class EditHTMLTaskController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
formLayout.setElementCssClass("o_sel_course_gta_edit_task_form");
String title = task.getTitle() == null ? "" : task.getTitle();
titleEl = uifactory.addTextElement("title", "task.title", 128, title, formLayout);
titleEl.setElementCssClass("o_sel_course_gta_upload_task_title");
titleEl.setMandatory(true);
String description = task.getDescription() == null ? "" : task.getDescription();
descriptionEl = uifactory.addTextAreaElement("descr", "task.description", 2048, 10, -1, true, description, formLayout);
contentEditor = new HTMLEditorController(ureq, getWindowControl(), taskContainer, task.getFilename(), null, "media", true, false, false, mainForm);
contentEditor.getRichTextConfiguration().disableMedia();
contentEditor.getRichTextConfiguration().setAllowCustomMediaFactory(false);
listenTo(contentEditor);
FormItem editorItem = contentEditor.getInitialFormItem();
editorItem.setLabel("task.file", null);
formLayout.add(editorItem);
FormLayoutContainer buttonCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
buttonCont.setRootForm(mainForm);
formLayout.add(buttonCont);
uifactory.addFormSubmitButton("save", buttonCont);
uifactory.addFormCancelButton("cancel", buttonCont, ureq, getWindowControl());
}
Aggregations