use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class TranslationToolI18nItemEditCrumbController method updateCompareArea.
private void updateCompareArea(UserRequest ureq) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
if (compareSwitch.isSelected(0)) {
// Add target value
String compareValue = i18nMgr.getLocalizedString(currentItem.getBundleName(), currentItem.getKey(), null, compareLocale, customizingMode, false, false, false, 0);
compareArea.setValue(compareValue);
// save settings as gui prefs
guiPrefs.put(I18nModule.class, I18nModule.GUI_PREFS_PREFERRED_COMPARE_LANG, compareLocale.toString());
guiPrefs.putAndSave(I18nModule.class, I18nModule.GUI_PREFS_COMPARE_LANG_ENABLED, Boolean.TRUE);
} else {
guiPrefs.putAndSave(I18nModule.class, I18nModule.GUI_PREFS_COMPARE_LANG_ENABLED, Boolean.FALSE);
}
// update GUI
this.flc.contextPut("compareSwitchEnabled", Boolean.valueOf(compareSwitch.isSelected(0)));
this.flc.contextPut("compareLanguageKey", compareLocale.toString());
}
use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class MSCourseNodeRunController method saveOpenPanel.
private void saveOpenPanel(UserRequest ureq, String panelId, boolean newValue) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
if (guiPrefs != null) {
guiPrefs.putAndSave(MSCourseNodeRunController.class, getOpenPanelId(panelId), new Boolean(newValue));
}
myContent.contextPut("in-" + panelId, new Boolean(newValue));
}
use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class CheckListRunController method isPanelOpen.
private boolean isPanelOpen(UserRequest ureq, String panelId, boolean def) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
Boolean showConfig = (Boolean) guiPrefs.get(CheckListRunController.class, getOpenPanelId(panelId));
return showConfig == null ? def : showConfig.booleanValue();
}
use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class HighScoreRunController method doLoadShowConfig.
/**
* loads GUI preferences
*/
private void doLoadShowConfig(UserRequest ureq) {
// add as listener to form layout for later dispatchinf of gui prefs changes
this.flc.getFormItemComponent().addListener(this);
// init showConfig from user prefs
Boolean showConfig = Boolean.TRUE;
if (ureq != null) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
showConfig = (Boolean) guiPrefs.get(HighScoreRunController.class, GUIPREF_KEY_HIGHSCORE + nodeID);
if (showConfig == null) {
showConfig = Boolean.TRUE;
}
}
// expose initial value to velocity
this.flc.contextPut("showConfig", Boolean.valueOf(showConfig));
}
use of org.olat.core.util.prefs.Preferences in project OpenOLAT by OpenOLAT.
the class AbstractTeacherOverviewController method saveAllTeachersSwitch.
private void saveAllTeachersSwitch(UserRequest ureq, boolean newValue) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
if (guiPrefs != null) {
guiPrefs.putAndSave(AbstractTeacherOverviewController.class, switchPrefsId, new Boolean(newValue));
}
if (newValue) {
allTeachersSwitch.setIconLeftCSS("o_icon o_icon-lg o_icon_toggle_on");
allTeachersSwitch.setTooltip(translate("all.teachers.switch.tooltip.on"));
} else {
allTeachersSwitch.setIconLeftCSS("o_icon o_icon-lg o_icon_toggle_off");
allTeachersSwitch.setTooltip(translate("all.teachers.switch.tooltip.off"));
}
allTeachersSwitch.setUserObject(newValue);
}
Aggregations