use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class AbstractTeacherOverviewController method isAllTeachersSwitch.
private boolean isAllTeachersSwitch(UserRequest ureq, boolean def) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
Boolean showConfig = (Boolean) guiPrefs.get(AbstractTeacherOverviewController.class, switchPrefsId);
return showConfig == null ? def : showConfig.booleanValue();
}
use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class EditLectureBlockController method getLocations.
private List<LocationHistory> getLocations(UserRequest ureq) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
List<LocationHistory> showConfig = guiPrefs.getList(LectureBlock.class, getLocationsPrefsId(), LocationHistory.class);
return showConfig == null ? new ArrayList<>() : showConfig;
}
use of org.olat.core.util.prefs.Preferences in project openolat by klemens.
the class ShareLinkController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
UserSession usess = ureq.getUserSession();
if (source == shareLinkVC && "setLandingPage".equals(event.getCommand()) && usess != null && usess.isAuthenticated()) {
HistoryPoint p = usess.getLastHistoryPoint();
if (p != null && StringHelper.containsNonWhitespace(p.getBusinessPath())) {
List<ContextEntry> ces = p.getEntries();
String landingPage = BusinessControlFactory.getInstance().getAsURIString(ces, true);
int start = landingPage.indexOf("/url/");
if (start != -1) {
// start with / after /url
landingPage = landingPage.substring(start + 4);
}
// update user prefs
Preferences prefs = usess.getGuiPreferences();
prefs.put(WindowManager.class, "landing-page", landingPage);
prefs.save();
getWindowControl().getWindowBackOffice().sendCommandTo(new JSCommand("showInfoBox(\"" + translate("info.header") + "\",\"" + translate("landingpage.set.message") + "\");"));
}
}
}
use of org.olat.core.util.prefs.Preferences in project openolat by klemens.
the class MetadatasController method openPanel.
private void openPanel(UserRequest ureq) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
String guiPref = (String) guiPrefs.get(MetadatasController.class, GUIPREF_KEY_OPEN_PANEL);
String openPanel = guiPref != null ? guiPrefToPanel(guiPref) : "general";
mainVC.contextRemove("in-general");
mainVC.contextRemove("in-question");
mainVC.contextRemove("in-rights");
mainVC.contextRemove("in-technical");
mainVC.contextRemove("in-ratings");
mainVC.contextRemove("in-pools");
mainVC.contextRemove("in-shares");
mainVC.contextPut("in-" + openPanel, "in");
}
use of org.olat.core.util.prefs.Preferences in project openolat by klemens.
the class EditLectureBlockController method getLocations.
private List<LocationHistory> getLocations(UserRequest ureq) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
List<LocationHistory> showConfig = guiPrefs.getList(LectureBlock.class, getLocationsPrefsId(), LocationHistory.class);
return showConfig == null ? new ArrayList<>() : showConfig;
}
Aggregations