use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class EditLectureBlockController method updateLocationsPrefs.
private void updateLocationsPrefs(UserRequest ureq) {
String location = lectureBlock.getLocation();
if (StringHelper.containsNonWhitespace(location)) {
List<LocationHistory> newLocations = new ArrayList<>(locations);
LocationHistory newLocation = new LocationHistory(location, new Date());
if (locations.contains(newLocation)) {
int index = locations.indexOf(newLocation);
locations.get(index).setLastUsed(new Date());
} else {
newLocations.add(newLocation);
Collections.sort(newLocations, new LocationDateComparator());
if (newLocations.size() > 10) {
// pack it in a new list for XStream
newLocations = new ArrayList<>(newLocations.subList(0, 10));
}
}
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
if (guiPrefs != null) {
guiPrefs.putAndSave(LectureBlock.class, getLocationsPrefsId(), newLocations);
}
}
}
use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class CheckListRunController method saveOpenPanel.
private void saveOpenPanel(UserRequest ureq, String panelId, boolean newValue) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
if (guiPrefs != null) {
guiPrefs.putAndSave(CheckListRunController.class, getOpenPanelId(panelId), Boolean.valueOf(newValue));
}
flc.getFormItemComponent().contextPut("in-" + panelId, Boolean.valueOf(newValue));
}
use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class MSCourseNodeRunController method isPanelOpen.
private boolean isPanelOpen(UserRequest ureq, String panelId, boolean def) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
Boolean showConfig = (Boolean) guiPrefs.get(MSCourseNodeRunController.class, getOpenPanelId(panelId));
return showConfig == null ? def : showConfig.booleanValue();
}
use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class PortfolioCourseNodeRunController method isPanelOpen.
private boolean isPanelOpen(UserRequest ureq, String panelId, boolean def) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
Boolean showConfig = (Boolean) guiPrefs.get(PortfolioCourseNodeRunController.class, getOpenPanelId(panelId));
return showConfig == null ? def : showConfig.booleanValue();
}
use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class IQRunController method saveOpenPanel.
private void saveOpenPanel(UserRequest ureq, String panelId, boolean newValue) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
if (guiPrefs != null) {
guiPrefs.putAndSave(IQRunController.class, getOpenPanelId(panelId), new Boolean(newValue));
}
myContent.contextPut("in-" + panelId, new Boolean(newValue));
}
Aggregations