Search in sources :

Example 61 with Preferences

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());
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Example 62 with Preferences

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));
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Example 63 with Preferences

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();
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Example 64 with Preferences

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));
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Example 65 with Preferences

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);
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Aggregations

Preferences (org.olat.core.util.prefs.Preferences)92 ArrayList (java.util.ArrayList)12 I18nModule (org.olat.core.util.i18n.I18nModule)8 WindowManager (org.olat.core.gui.WindowManager)6 ContextEntry (org.olat.core.id.context.ContextEntry)6 UserSession (org.olat.core.util.UserSession)6 HashSet (java.util.HashSet)4 Locale (java.util.Locale)4 Map (java.util.Map)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 UserTool (org.olat.admin.user.tools.UserTool)4 UserToolExtension (org.olat.admin.user.tools.UserToolExtension)4 Component (org.olat.core.gui.components.Component)4 FlexiTableSort (org.olat.core.gui.components.form.flexible.elements.FlexiTableSort)4 ProgressBar (org.olat.core.gui.components.progressbar.ProgressBar)4 HistoryPoint (org.olat.core.id.context.HistoryPoint)4 I18nItem (org.olat.core.util.i18n.I18nItem)4 LocationHistory (org.olat.modules.lecture.model.LocationHistory)4 Date (java.util.Date)2 List (java.util.List)2