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());
}
}
}
}
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());
}
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);
}
}
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);
}
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);
}
Aggregations