use of org.olat.collaboration.CalendarToolSettingsController in project OpenOLAT by OpenOLAT.
the class BGConfigToolsStepController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
boolean first = true;
String containerPage = velocity_root + "/tool_config_container.html";
String[] availableTools = CollaborationToolsFactory.getInstance().getAvailableTools().clone();
for (String k : availableTools) {
if (k.equals(CollaborationTools.TOOL_CHAT) || k.equals(CollaborationTools.TOOL_NEWS)) {
continue;
}
String[] keys = new String[] { "on" };
String[] values = new String[] { translate("collabtools.named." + k) };
String i18n = first ? "config.tools.desc" : null;
MultipleSelectionElement selectEl = uifactory.addCheckboxesHorizontal(k, i18n, formLayout, keys, values);
selectEl.addActionListener(FormEvent.ONCHANGE);
toolList.add(selectEl);
ToolConfig config = new ToolConfig(k);
config.configContainer = FormLayoutContainer.createCustomFormLayout("config.container." + k, getTranslator(), containerPage);
config.configContainer.contextPut("tool", k);
config.configContainer.setVisible(false);
config.configContainer.setRootForm(mainForm);
formLayout.add(config.configContainer);
config.enableEl = uifactory.addRadiosHorizontal("config.enable." + k, null, config.configContainer, enableKeys, enableValues);
config.enableEl.addActionListener(FormEvent.ONCHANGE);
config.enableEl.select("off", true);
enableList.add(config.enableEl);
config.enableEl.setUserObject(config);
if (k.equals(CollaborationTools.TOOL_CALENDAR)) {
config.calendarCtrl = new CalendarToolSettingsController(ureq, getWindowControl(), mainForm, CollaborationTools.CALENDAR_ACCESS_OWNERS);
config.configContainer.add("calendar", config.calendarCtrl.getInitialFormItem());
config.calendarCtrl.getInitialFormItem().setVisible(false);
} else if (k.equals(CollaborationTools.TOOL_FOLDER)) {
// add folder access configuration
config.folderCtrl = new FolderToolSettingsController(ureq, getWindowControl(), mainForm, CollaborationTools.FOLDER_ACCESS_OWNERS);
config.configContainer.add("folder", config.folderCtrl.getInitialFormItem());
config.folderCtrl.getInitialFormItem().setVisible(false);
// add quota configuration for admin only
if (ureq.getUserSession().getRoles().isOLATAdmin()) {
Quota quota = quotaManager.createQuota(null, null, null);
config.quotaCtrl = new BGConfigQuotaController(ureq, getWindowControl(), quota, mainForm);
config.configContainer.add("quota", config.quotaCtrl.getInitialFormItem());
config.quotaCtrl.getInitialFormItem().setVisible(false);
}
}
selectEl.setUserObject(config);
first = false;
}
}
use of org.olat.collaboration.CalendarToolSettingsController in project openolat by klemens.
the class BGConfigToolsStepController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
boolean first = true;
String containerPage = velocity_root + "/tool_config_container.html";
String[] availableTools = CollaborationToolsFactory.getInstance().getAvailableTools().clone();
for (String k : availableTools) {
if (k.equals(CollaborationTools.TOOL_CHAT) || k.equals(CollaborationTools.TOOL_NEWS)) {
continue;
}
String[] keys = new String[] { "on" };
String[] values = new String[] { translate("collabtools.named." + k) };
String i18n = first ? "config.tools.desc" : null;
MultipleSelectionElement selectEl = uifactory.addCheckboxesHorizontal(k, i18n, formLayout, keys, values);
selectEl.addActionListener(FormEvent.ONCHANGE);
toolList.add(selectEl);
ToolConfig config = new ToolConfig(k);
config.configContainer = FormLayoutContainer.createCustomFormLayout("config.container." + k, getTranslator(), containerPage);
config.configContainer.contextPut("tool", k);
config.configContainer.setVisible(false);
config.configContainer.setRootForm(mainForm);
formLayout.add(config.configContainer);
config.enableEl = uifactory.addRadiosHorizontal("config.enable." + k, null, config.configContainer, enableKeys, enableValues);
config.enableEl.addActionListener(FormEvent.ONCHANGE);
config.enableEl.select("off", true);
enableList.add(config.enableEl);
config.enableEl.setUserObject(config);
if (k.equals(CollaborationTools.TOOL_CALENDAR)) {
config.calendarCtrl = new CalendarToolSettingsController(ureq, getWindowControl(), mainForm, CollaborationTools.CALENDAR_ACCESS_OWNERS);
config.configContainer.add("calendar", config.calendarCtrl.getInitialFormItem());
config.calendarCtrl.getInitialFormItem().setVisible(false);
} else if (k.equals(CollaborationTools.TOOL_FOLDER)) {
// add folder access configuration
config.folderCtrl = new FolderToolSettingsController(ureq, getWindowControl(), mainForm, CollaborationTools.FOLDER_ACCESS_OWNERS);
config.configContainer.add("folder", config.folderCtrl.getInitialFormItem());
config.folderCtrl.getInitialFormItem().setVisible(false);
// add quota configuration for admin only
if (ureq.getUserSession().getRoles().isOLATAdmin()) {
Quota quota = quotaManager.createQuota(null, null, null);
config.quotaCtrl = new BGConfigQuotaController(ureq, getWindowControl(), quota, mainForm);
config.configContainer.add("quota", config.quotaCtrl.getInitialFormItem());
config.quotaCtrl.getInitialFormItem().setVisible(false);
}
}
selectEl.setUserObject(config);
first = false;
}
}
Aggregations