// add new event to calendar
String calendarID = ureq.getParameter(PARAM_ID);
fireEvent(ureq, new KalendarGUIAddEvent(calendarID, new Date()));
} else if (command.equals(CMD_TOGGLE_DISPLAY)) {
String calendarID = ureq.getParameter(PARAM_ID);
KalendarRenderWrapper calendarWrapper = findKalendarRenderWrapper(calendarID);
KalendarConfig config = calendarWrapper.getKalendarConfig();
config.setVis(!config.isVis());
CalendarManagerFactory.getInstance().getCalendarManager().saveKalendarConfigForIdentity(
config, calendarWrapper.getKalendar(), ureq);
fireEvent(ureq, Event.CHANGED_EVENT);
} else if (command.equals(CMD_CHOOSE_COLOR)) {
String calendarID = ureq.getParameter(PARAM_ID);
lastCalendarWrapper = findKalendarRenderWrapper(calendarID);
removeAsListenerAndDispose(colorChooser);
colorChooser = new CalendarColorChooserController(getLocale(), getWindowControl(), lastCalendarWrapper.getKalendarConfig().getCss());
listenTo(colorChooser);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), translate("close"), colorChooser.getInitialComponent());
cmc.activate();
listenTo(cmc);
} else if (command.equals(CMD_ICAL_FEED)) {
String calendarID = ureq.getParameter(PARAM_ID);
KalendarRenderWrapper calendarWrapper = findKalendarRenderWrapper(calendarID);
String calFeedLink = ICalTokenGenerator.getIcalFeedLink(calendarWrapper.getKalendar().getType(), calendarID, ureq.getIdentity());
exportController = new CalendarExportController(getLocale(), getWindowControl(), calFeedLink);
listenTo(exportController);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), translate("close"), exportController.getInitialComponent());
cmc.activate();
listenTo(cmc);
} else if (command.equals(CMD_ICAL_REGENERATE)) {
currentCalendarID = ureq.getParameter(PARAM_ID);
confirmRegenerateDialog = activateOkCancelDialog(ureq, translate("cal.icalfeed.regenerate.title"), translate("cal.icalfeed.regenerate.warning"), confirmRegenerateDialog);
} else if (command.equals(CMD_ICAL_REMOVE_FEED)) {
currentCalendarID = ureq.getParameter(PARAM_ID);
confirmRemoveDialog = activateOkCancelDialog(ureq, translate("cal.icalfeed.remove.title"), translate("cal.icalfeed.remove.confirmation_message"), confirmRemoveDialog);
} else if (command.equals(CMD_UNSUBSCRIBE)) {
currentCalendarID = ureq.getParameter(PARAM_ID);
KalendarRenderWrapper calendarWrapper = findKalendarRenderWrapper(currentCalendarID);
CalendarSubscription subscription = new CourseCalendarSubscription(calendarWrapper.getKalendar(), ureq.getUserSession().getGuiPreferences());
subscription.unsubscribe();
for (Iterator<KalendarRenderWrapper> it=calendars.iterator(); it.hasNext(); ) {
KalendarRenderWrapper calendar = it.next();
if (calendarWrapper.getKalendar().getCalendarID().equals(calendar.getKalendar().getCalendarID())) {
it.remove();
}
}
configVC.contextPut("calendars", calendars);
fireEvent(ureq, Event.CHANGED_EVENT);