Search in sources :

Example 26 with FormLayoutContainer

use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.

the class WeeklyCalendarController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
    Collections.sort(calendarWrappers, KalendarComparator.getInstance());
    calendarEl = new FullCalendarElement(ureq, "weeklyCalendar", calendarWrappers, getTranslator());
    formLayout.add("calendar", calendarEl);
    calendarEl.setConfigurationEnabled(true);
    calendarEl.setAggregatedFeedEnabled(true);
    calendarEl.setAlwaysVisibleCalendar(getCallerKalendarRenderWrapper());
    if (formLayout instanceof FormLayoutContainer) {
        FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
        if (!isGuest && !calendarWrappers.isEmpty()) {
            subsContext = calendarNotificationsManager.getSubscriptionContext(calendarWrappers.get(0));
            // if sc is null, then no subscription is desired
            if (subsContext != null) {
                csc = getContextualSubscriptionController(ureq, calendarWrappers.get(0), subsContext);
                layoutCont.put("calsubscription", csc.getInitialComponent());
            }
        }
    }
}
Also used : FullCalendarElement(org.olat.commons.calendar.ui.components.FullCalendarElement) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 27 with FormLayoutContainer

use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.

the class ExternalLinksController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormTitle("tab.links.extern");
    String page = VELOCITY_ROOT + "/calExternalLinks.html";
    linksContainer = FormLayoutContainer.createCustomFormLayout("links", getTranslator(), page);
    formLayout.add(linksContainer);
    linksContainer.setRootForm(mainForm);
    for (LinkWrapper link : externalLinks) {
        addNewFormLink(link, linksContainer);
    }
    linksContainer.contextPut("links", externalLinks);
    FormLayoutContainer buttonLayout = FormLayoutContainer.createButtonLayout("ok-cancel", getTranslator());
    formLayout.add(buttonLayout);
    buttonLayout.setRootForm(mainForm);
    uifactory.addFormSubmitButton("ok", "save", buttonLayout);
    uifactory.addFormCancelButton("cancel", buttonLayout, ureq, getWindowControl());
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 28 with FormLayoutContainer

use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.

the class ChecklistAuthorOptionsForm method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FormLayoutContainer mainLayout = FormLayoutContainer.createHorizontalFormLayout("mainLayout", getTranslator());
    formLayout.add(mainLayout);
    if (canManage) {
        manageCheckpointsBtn = uifactory.addFormLink("manageCheckpointsButton", "cl.manage.button", "", mainLayout, Link.BUTTON);
    }
    if (canEdit) {
        configCheckpointsBtn = uifactory.addFormLink("configCheckpointsButton", "cl.config.button", "", mainLayout, Link.BUTTON);
    }
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 29 with FormLayoutContainer

use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.

the class LandingPagesAdminController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormTitle("landingpages.title");
    // add the table
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.position.i18nKey(), RCols.position.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.role.i18nKey(), RCols.role.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.userAttributeKey.i18nKey(), RCols.userAttributeKey.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.userAttributeValue.i18nKey(), RCols.userAttributeValue.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.landingPage.i18nKey(), RCols.landingPage.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RCols.landingPageChooser.i18nKey(), RCols.landingPageChooser.ordinal()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("up", -1, "up", new StaticFlexiCellRenderer("", "up", "o_icon o_icon-lg o_icon_move_up", translate("up"))));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("down", -1, "down", new StaticFlexiCellRenderer("", "down", "o_icon o_icon-lg o_icon_move_down", translate("down"))));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("add", translate("add"), "add"));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("delete", translate("delete"), "delete"));
    // pack the rules
    Rules rules = lpModule.getRules();
    List<Rule> ruleList = new ArrayList<>(rules.getRules());
    if (ruleList.isEmpty()) {
        ruleList.add(new Rule());
    }
    List<RuleWrapper> wrappers = new ArrayList<>();
    int i = 0;
    for (Rule rule : ruleList) {
        wrappers.add(initRuleWrapper(++i, rule, formLayout));
    }
    if (formLayout instanceof FormLayoutContainer) {
        FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
        layoutCont.contextPut("rules", wrappers);
    }
    model = new RulesDataModel(columnsModel, wrappers);
    tableEl = uifactory.addTableElement(getWindowControl(), "rules", model, getTranslator(), formLayout);
    tableEl.setCustomizeColumns(false);
    tableEl.setRendererType(FlexiTableRendererType.classic);
    FormLayoutContainer buttonLayout = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    formLayout.add("buttons", buttonLayout);
    saveButton = uifactory.addFormSubmitButton("save", buttonLayout);
}
Also used : StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) ArrayList(java.util.ArrayList) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) Rule(org.olat.admin.landingpages.model.Rule) Rules(org.olat.admin.landingpages.model.Rules) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 30 with FormLayoutContainer

use of org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer in project OpenOLAT by OpenOLAT.

the class VersionMaintenanceForm method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // First add title and context help
    setFormTitle("version.maintenance.title");
    setFormDescription("version.maintenance.intro");
    orphanSizeEl = uifactory.addStaticTextElement("version.orphan.size", "version.orphan.size", "???", formLayout);
    FormLayoutContainer buttonsLayout = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    formLayout.add(buttonsLayout);
    orphanSize = uifactory.addFormLink("version.orphan.size.calc", buttonsLayout, Link.BUTTON);
    showOrphanLink = uifactory.addFormLink("version.show.orphans", buttonsLayout, Link.BUTTON);
    cleanUpLink = uifactory.addFormLink("version.clean.up", buttonsLayout, Link.BUTTON);
    FormLayoutContainer buttons2Layout = FormLayoutContainer.createButtonLayout("buttons2", getTranslator());
    formLayout.add(buttons2Layout);
    pruneLink = uifactory.addFormLink("version.prune.history", buttons2Layout, Link.BUTTON);
}
Also used : 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