Search in sources :

Example 1 with FullCalendarElement

use of org.olat.commons.calendar.ui.components.FullCalendarElement in project OpenOLAT by OpenOLAT.

the class WeeklyCalendarController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
    Collections.sort(calendarWrappers, KalendarComparator.getInstance());
    calendarEl = new FullCalendarElement(ureq, "weeklyCalendar", calendarWrappers, getTranslator());
    formLayout.add("calendar", calendarEl);
    calendarEl.setConfigurationEnabled(true);
    calendarEl.setAggregatedFeedEnabled(true);
    calendarEl.setAlwaysVisibleCalendar(getCallerKalendarRenderWrapper());
    if (formLayout instanceof FormLayoutContainer) {
        FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
        if (!isGuest && !calendarWrappers.isEmpty()) {
            subsContext = calendarNotificationsManager.getSubscriptionContext(calendarWrappers.get(0));
            // if sc is null, then no subscription is desired
            if (subsContext != null) {
                csc = getContextualSubscriptionController(ureq, calendarWrappers.get(0), subsContext);
                layoutCont.put("calsubscription", csc.getInitialComponent());
            }
        }
    }
}
Also used : FullCalendarElement(org.olat.commons.calendar.ui.components.FullCalendarElement) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Example 2 with FullCalendarElement

use of org.olat.commons.calendar.ui.components.FullCalendarElement in project openolat by klemens.

the class WeeklyCalendarController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    boolean isGuest = ureq.getUserSession().getRoles().isGuestOnly();
    Collections.sort(calendarWrappers, KalendarComparator.getInstance());
    calendarEl = new FullCalendarElement(ureq, "weeklyCalendar", calendarWrappers, getTranslator());
    formLayout.add("calendar", calendarEl);
    calendarEl.setConfigurationEnabled(true);
    calendarEl.setAggregatedFeedEnabled(true);
    calendarEl.setAlwaysVisibleCalendar(getCallerKalendarRenderWrapper());
    if (formLayout instanceof FormLayoutContainer) {
        FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
        if (!isGuest && !calendarWrappers.isEmpty()) {
            subsContext = calendarNotificationsManager.getSubscriptionContext(calendarWrappers.get(0));
            // if sc is null, then no subscription is desired
            if (subsContext != null) {
                csc = getContextualSubscriptionController(ureq, calendarWrappers.get(0), subsContext);
                layoutCont.put("calsubscription", csc.getInitialComponent());
            }
        }
    }
}
Also used : FullCalendarElement(org.olat.commons.calendar.ui.components.FullCalendarElement) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)

Aggregations

FullCalendarElement (org.olat.commons.calendar.ui.components.FullCalendarElement)2 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)2