Search in sources :

Example 16 with FormLayoutContainer

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

the class CertificateChooserController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    List<CertificateTemplate> templates = certificatesManager.getTemplates();
    templatesKeys = new String[templates.size() + 1];
    templatesValues = new String[templates.size() + 1];
    templatesKeys[0] = "def";
    templatesValues[0] = "Default";
    int count = 1;
    for (CertificateTemplate template : templates) {
        templatesKeys[count] = template.getKey().toString();
        templatesValues[count++] = template.getName();
    }
    publicTemplatesEl = uifactory.addDropdownSingleselect("public.templates", formLayout, templatesKeys, templatesValues, null);
    FormLayoutContainer selectButtonCont = FormLayoutContainer.createButtonLayout("selectButton", getTranslator());
    selectButtonCont.setRootForm(mainForm);
    formLayout.add(selectButtonCont);
    selectLink = uifactory.addFormLink("select", selectButtonCont, Link.BUTTON);
    uifactory.addSpacerElement("spaceman", formLayout, false);
    fileEl = uifactory.addFileElement(getWindowControl(), "template.file", formLayout);
    fileEl.addActionListener(FormEvent.ONCHANGE);
    String[] orientationValues = new String[] { translate("portrait"), translate("landscape") };
    orientationEl = uifactory.addRadiosVertical("orientation", formLayout, orientationKeys, orientationValues);
    orientationEl.select(orientationKeys[0], true);
    orientationEl.setVisible(false);
    formatEl = uifactory.addRadiosVertical("format", formLayout, formatKeys, formatKeys);
    formatEl.select(formatKeys[0], true);
    formatEl.setVisible(false);
    FormLayoutContainer buttonCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    buttonCont.setRootForm(mainForm);
    formLayout.add(buttonCont);
    uploadLink = uifactory.addFormLink("upload", buttonCont, Link.BUTTON);
    uifactory.addFormCancelButton("cancel", buttonCont, ureq, getWindowControl());
}
Also used : CertificateTemplate(org.olat.course.certificate.CertificateTemplate) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 17 with FormLayoutContainer

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

the class CourseLeaveDialogBoxController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    StringBuilder groupToLeaveNames = new StringBuilder();
    for (BusinessGroup group : groupsToLeave) {
        if (groupToLeaveNames.length() > 0)
            groupToLeaveNames.append(", ");
        groupToLeaveNames.append(group.getName());
    }
    StringBuilder repoEntryToLeaveNames = new StringBuilder();
    for (RepositoryEntry entry : repoEntriesToLeave) {
        if (repoEntryToLeaveNames.length() > 0)
            repoEntryToLeaveNames.append(", ");
        repoEntryToLeaveNames.append(entry.getDisplayname());
    }
    String identityName = UserManager.getInstance().getUserDisplayName(leavingIdentity);
    String leaveText;
    if (groupsToLeave.isEmpty()) {
        leaveText = translate("unsubscribe.text", new String[] { identityName, repoEntryToLeaveNames.toString() });
    } else {
        leaveText = translate("unsubscribe.withgroups.text", new String[] { identityName, repoEntryToLeaveNames.toString(), groupToLeaveNames.toString() });
    }
    uifactory.addStaticTextElement("leaving.desc", null, leaveText, formLayout);
    String[] values = new String[] { translate("dialog.modal.bg.mail.text") };
    sendMail = uifactory.addCheckboxesHorizontal("send.mail", null, formLayout, keys, values);
    if (!groupsToDelete.isEmpty()) {
        String deletMsg = translate("unsubscribe.group.del");
        uifactory.addStaticTextElement("delete.desc", null, deletMsg, formLayout);
        String[] delValues = new String[] { translate("group.delete.confirmation") };
        groupDeleteEl = uifactory.addCheckboxesHorizontal("group.del", null, formLayout, keys, delValues);
        groupDeleteEl.select(keys[0], true);
    }
    FormLayoutContainer buttonsContainer = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    buttonsContainer.setRootForm(mainForm);
    formLayout.add(buttonsContainer);
    uifactory.addFormSubmitButton("deleteButton", "ok", buttonsContainer);
    uifactory.addFormCancelButton("cancel", buttonsContainer, ureq, getWindowControl());
}
Also used : BusinessGroup(org.olat.group.BusinessGroup) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 18 with FormLayoutContainer

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

the class SystemRegistrationAdminController method initForm.

/**
 * @see org.olat.core.gui.components.form.flexible.impl.FormBasicController#initForm(org.olat.core.gui.components.form.flexible.FormItemContainer,
 *      org.olat.core.gui.control.Controller, org.olat.core.gui.UserRequest)
 */
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // always send statistics
    FormLayoutContainer settingsCont = FormLayoutContainer.createDefaultFormLayout("settings", getTranslator());
    formLayout.add("settings", settingsCont);
    String[] publishKeys = new String[] { YES };
    String[] publishValues = new String[] { translate("registration.publishWebSiteSelection", new String[] { Settings.getServerContextPathURI() }) };
    publishWebSiteSelection = uifactory.addCheckboxesVertical("registration.publishWebSiteSelection", null, settingsCont, publishKeys, publishValues, 1);
    publishWebSiteSelection.addActionListener(FormEvent.ONCLICK);
    boolean publishWebsiteConfig = registrationModule.isPublishWebsite();
    publishWebSiteSelection.select(YES, publishWebsiteConfig);
    // Add website description
    String webSiteDesc = registrationModule.getWebsiteDescription();
    webSiteDescription = uifactory.addTextAreaElement("registration.webSiteDescription", 5, 60, webSiteDesc, settingsCont);
    webSiteDescription.setLabel("registration.webSiteDescription", new String[] { Settings.getServerContextPathURI() });
    webSiteDescription.addActionListener(FormEvent.ONCHANGE);
    flc.contextPut("webSiteURL", Settings.getServerContextPathURI());
    String location = registrationModule.getLocation();
    locationBox = uifactory.addTextElement("registration.location", "registration.location", -1, location, settingsCont);
    locationBox.setExampleKey("registration.location.example", null);
    locationBox.setVisible(publishWebSiteSelection.isSelected(0));
    String locationCSV = registrationModule.getLocationCoordinates();
    if (locationCSV != null) {
        flc.contextPut("locationCoordinates", locationCSV);
    }
    String[] annonceKeys = new String[] { YES };
    String[] annonceValues = new String[] { translate("registration.addToAnnounceListSelection") };
    addToAnnounceListSelection = uifactory.addCheckboxesVertical("registration.addToAnnounceListSelection", null, settingsCont, annonceKeys, annonceValues, 1);
    addToAnnounceListSelection.addActionListener(FormEvent.ONCLICK);
    addToAnnounceListSelection.select(YES, registrationModule.isNotifyReleases());
    String emailValue = registrationModule.getEmail();
    email = uifactory.addTextElement("registration.email", "registration.email", 60, emailValue, settingsCont);
    email.setVisible(addToAnnounceListSelection.isSelected(0));
    // Add submit button
    FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    settingsCont.add(buttonsCont);
    uifactory.addFormSubmitButton("save", buttonsCont);
    Set<Map.Entry<String, String>> properties = registrationManager.getRegistrationPropertiesMessage().entrySet();
    flc.contextPut("properties", properties);
    flc.contextPut("isRegisteredWeb", Boolean.valueOf(publishWebsiteConfig));
    flc.contextPut("isRegisteredStatistics", Boolean.valueOf(true));
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 19 with FormLayoutContainer

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

the class UserSessionConfigAdminController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    int sessionTimeout = sessionModule.getSessionTimeout();
    sessionTimeoutEl = uifactory.addIntegerElement("session.timeout", "session.timeout.label", sessionTimeout, formLayout);
    int initialSessionAuth = sessionModule.getSessionTimeoutAuthenticated();
    sessionTimeoutAuthEl = uifactory.addIntegerElement("session.timeout.auth", "session.timeout.auth.label", initialSessionAuth, formLayout);
    int maxSessions = adminModule.getMaxSessions();
    maxSessionsEl = uifactory.addIntegerElement("max.sessions", "max.sessions.label", maxSessions, formLayout);
    FormLayoutContainer buttonsLayout = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
    formLayout.add(buttonsLayout);
    saveLink = uifactory.addFormLink("save", "save", null, buttonsLayout, Link.BUTTON);
    uifactory.addSpacerElement("spacer-1", formLayout, false);
    nbrSessionsEl = uifactory.addIntegerElement("nbr.session", "nbr.session.label", 0, formLayout);
    FormLayoutContainer buttonsLayout2 = FormLayoutContainer.createButtonLayout("buttons2", getTranslator());
    formLayout.add(buttonsLayout2);
    invalidateOldSessionLink = uifactory.addFormLink("kill.old", "oldest.session.button", null, buttonsLayout2, Link.BUTTON);
    invalidateAllSessionLink = uifactory.addFormLink("kill.all", "session.admin.invalidate.all.link", null, buttonsLayout2, Link.BUTTON);
    uifactory.addSpacerElement("spacer-2", formLayout, false);
    FormLayoutContainer buttonsLayout3 = FormLayoutContainer.createButtonLayout("buttons3", getTranslator());
    formLayout.add(buttonsLayout3);
    blockLoginLink = uifactory.addFormLink("block.login.all", "session.admin.block.login.link", null, buttonsLayout3, Link.BUTTON);
    allowLoginLink = uifactory.addFormLink("allow.login.all", "session.admin.allow.login.link", null, buttonsLayout3, Link.BUTTON);
    updateLoginBlock();
    @SuppressWarnings("deprecation") boolean clusterMode = CoordinatorManager.getInstance().getCoordinator().isClusterMode();
    if (clusterMode) {
        rejectDMZRequestsLink = uifactory.addFormLink("block.dmz.node", "session.admin.reject.dmz.requests.link", null, buttonsLayout3, Link.BUTTON);
        allowDMZRequestsLink = uifactory.addFormLink("allow.dmz.node", "session.admin.allow.dmz.requests.link", null, buttonsLayout3, Link.BUTTON);
        updateDmzBlock();
    }
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 20 with FormLayoutContainer

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

the class CoreFunctionsController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // server informations
    FormLayoutContainer serverCont = FormLayoutContainer.createDefaultFormLayout("functions", getTranslator());
    formLayout.add(serverCont);
    formLayout.add("functions", serverCont);
    MultipleSelectionElement clusterEl = uifactory.addCheckboxesHorizontal("webdav", "core.webdav", serverCont, new String[] { "xx" }, new String[] { "" });
    clusterEl.setEnabled(false);
    clusterEl.select("xx", CoreSpringFactory.getImpl(WebDAVModule.class).isEnabled());
    MultipleSelectionElement jsMathEl = uifactory.addCheckboxesHorizontal("jsmath", "core.jsMath", serverCont, new String[] { "xx" }, new String[] { "" });
    jsMathEl.setEnabled(false);
    jsMathEl.select("xx", Boolean.TRUE);
    MultipleSelectionElement restEl = uifactory.addCheckboxesHorizontal("restapi", "core.restapi", serverCont, new String[] { "xx" }, new String[] { "" });
    restEl.setEnabled(false);
    RestModule restModule = CoreSpringFactory.getImpl(RestModule.class);
    restEl.select("xx", restModule.isEnabled());
}
Also used : RestModule(org.olat.restapi.RestModule) MultipleSelectionElement(org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement) 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