Search in sources :

Example 41 with FormLayoutContainer

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");
    }
}
Also used : FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) SortKey(org.olat.core.commons.persistence.SortKey) Identity(org.olat.core.id.Identity)

Example 42 with FormLayoutContainer

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);
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 43 with FormLayoutContainer

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());
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 44 with FormLayoutContainer

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());
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) Section(org.olat.modules.portfolio.Section)

Example 45 with FormLayoutContainer

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());
}
Also used : HTMLEditorController(org.olat.core.commons.editor.htmleditor.HTMLEditorController) FormItem(org.olat.core.gui.components.form.flexible.FormItem) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Aggregations

FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)844 ArrayList (java.util.ArrayList)96 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)76 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)76 Date (java.util.Date)56 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)56 TextElement (org.olat.core.gui.components.form.flexible.elements.TextElement)42 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)40 FormItem (org.olat.core.gui.components.form.flexible.FormItem)38 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)32 Translator (org.olat.core.gui.translator.Translator)30 Identity (org.olat.core.id.Identity)30 VFSContainer (org.olat.core.util.vfs.VFSContainer)28 File (java.io.File)26 MultipleSelectionElement (org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement)26 BusinessGroup (org.olat.group.BusinessGroup)26 HashMap (java.util.HashMap)22 HashSet (java.util.HashSet)22 TextFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer)22 StaticTextElement (org.olat.core.gui.components.form.flexible.elements.StaticTextElement)20