use of org.olat.core.gui.control.navigation.SiteViewSecurityCallback in project OpenOLAT by OpenOLAT.
the class SitesConfigurationController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == tableEl) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
if ("up".equals(se.getCommand())) {
SiteDefRow row = model.getObject(se.getIndex());
moveUp(row);
doUpdateOrders();
tableEl.getComponent().setDirty(true);
} else if ("down".equals(se.getCommand())) {
SiteDefRow row = model.getObject(se.getIndex());
moveDown(row);
doUpdateOrders();
tableEl.getComponent().setDirty(true);
}
}
} else if (source instanceof SingleSelection) {
if (source.getName().startsWith("site.security.") && source.getUserObject() instanceof SiteDefRow) {
SiteDefRow row = (SiteDefRow) source.getUserObject();
String selectCallbackId = row.getSecurityCallbackEl().getSelectedKey();
boolean needAlt = (securityCallbacks.containsKey(selectCallbackId) && securityCallbacks.get(selectCallbackId) instanceof SiteViewSecurityCallback);
if (row.getAlternativeControllerEl().isVisible() != needAlt) {
row.getAlternativeControllerEl().setVisible(needAlt);
tableEl.reset();
}
}
doSaveSettings();
} else if (source instanceof MultipleSelectionElement || source instanceof SingleSelection) {
doSaveSettings();
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.control.navigation.SiteViewSecurityCallback in project openolat by klemens.
the class SitesConfigurationController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == tableEl) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
if ("up".equals(se.getCommand())) {
SiteDefRow row = model.getObject(se.getIndex());
moveUp(row);
doUpdateOrders();
tableEl.getComponent().setDirty(true);
} else if ("down".equals(se.getCommand())) {
SiteDefRow row = model.getObject(se.getIndex());
moveDown(row);
doUpdateOrders();
tableEl.getComponent().setDirty(true);
}
}
} else if (source instanceof SingleSelection) {
if (source.getName().startsWith("site.security.") && source.getUserObject() instanceof SiteDefRow) {
SiteDefRow row = (SiteDefRow) source.getUserObject();
String selectCallbackId = row.getSecurityCallbackEl().getSelectedKey();
boolean needAlt = (securityCallbacks.containsKey(selectCallbackId) && securityCallbacks.get(selectCallbackId) instanceof SiteViewSecurityCallback);
if (row.getAlternativeControllerEl().isVisible() != needAlt) {
row.getAlternativeControllerEl().setVisible(needAlt);
tableEl.reset();
}
}
doSaveSettings();
} else if (source instanceof MultipleSelectionElement || source instanceof SingleSelection) {
doSaveSettings();
}
super.formInnerEvent(ureq, source, event);
}
Aggregations