Search in sources :

Example 31 with ChiefController

use of org.olat.core.gui.control.ChiefController in project openolat by klemens.

the class CourseRuntimeController method addCustomCSS.

private void addCustomCSS(UserRequest ureq) {
    ICourse course = CourseFactory.loadCourse(getRepositoryEntry());
    CustomCSS customCSS = CourseFactory.getCustomCourseCss(ureq.getUserSession(), course.getCourseEnvironment());
    ChiefController cc = getWindowControl().getWindowBackOffice().getChiefController();
    if (cc != null) {
        if (customCSS == null) {
            cc.removeCurrentCustomCSSFromView();
        } else {
            cc.addCurrentCustomCSSToView(customCSS);
        }
    }
    setCustomCSS(customCSS);
}
Also used : CustomCSS(org.olat.core.gui.components.htmlheader.jscss.CustomCSS) ICourse(org.olat.course.ICourse) ChiefController(org.olat.core.gui.control.ChiefController)

Example 32 with ChiefController

use of org.olat.core.gui.control.ChiefController in project openolat by klemens.

the class CourseRuntimeController method removeCustomCSS.

private void removeCustomCSS() {
    ChiefController cc = getWindowControl().getWindowBackOffice().getChiefController();
    if (cc != null) {
        cc.removeCurrentCustomCSSFromView();
    }
    setCustomCSS(null);
    setCourseClosedMessage(getUserCourseEnvironment());
}
Also used : ChiefController(org.olat.core.gui.control.ChiefController)

Example 33 with ChiefController

use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.

the class SmsPhoneElement method doEdit.

private void doEdit(UserRequest ureq) {
    ChiefController chief = Windows.getWindows(ureq).getChiefController();
    WindowControl wControl = chief.getWindowControl();
    if (wControl != null) {
        smsPhoneCtrl = new SmsPhoneController(ureq, wControl, handler, editedUser);
        smsPhoneCtrl.addControllerListener(this);
        String propLabel = CoreSpringFactory.getImpl(UserManager.class).getPropertyHandlerTranslator(getTranslator()).translate(handler.i18nFormElementLabelKey());
        String title = getTranslator().translate("sms.title", new String[] { propLabel });
        cmc = new CloseableModalController(wControl, "close", smsPhoneCtrl.getInitialComponent(), true, title);
        cmc.suppressDirtyFormWarningOnClose();
        cmc.activate();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ChiefController(org.olat.core.gui.control.ChiefController) WindowControl(org.olat.core.gui.control.WindowControl)

Example 34 with ChiefController

use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.

the class IsAssessmentModeFunction method call.

/**
 * @see com.neemsoft.jmep.FunctionCB#call(java.lang.Object[])
 */
@Override
public Object call(Object[] inStack) {
    /*
		 * expression check only if cev != null
		 */
    CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
    if (cev != null) {
        // return a valid value to continue with condition evaluation test
        return defaultValue();
    }
    WindowControl wControl = getUserCourseEnv().getWindowControl();
    if (wControl == null) {
        return ConditionInterpreter.INT_FALSE;
    }
    ChiefController chiefController = wControl.getWindowBackOffice().getChiefController();
    if (chiefController == null) {
        return ConditionInterpreter.INT_FALSE;
    }
    OLATResourceable lockedResource = chiefController.getLockResource();
    if (lockedResource == null) {
        return ConditionInterpreter.INT_FALSE;
    }
    Long resourceableId = getUserCourseEnv().getCourseEnvironment().getCourseResourceableId();
    if (lockedResource.getResourceableId().equals(resourceableId)) {
        RepositoryEntry entry = getUserCourseEnv().getCourseEnvironment().getCourseGroupManager().getCourseEntry();
        AssessmentModeManager assessmentModeMgr = CoreSpringFactory.getImpl(AssessmentModeManager.class);
        boolean inAssessment = assessmentModeMgr.isInAssessmentMode(entry, new Date());
        return inAssessment ? ConditionInterpreter.INT_TRUE : ConditionInterpreter.INT_FALSE;
    } else {
        return ConditionInterpreter.INT_FALSE;
    }
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) CourseEditorEnv(org.olat.course.editor.CourseEditorEnv) ChiefController(org.olat.core.gui.control.ChiefController) RepositoryEntry(org.olat.repository.RepositoryEntry) WindowControl(org.olat.core.gui.control.WindowControl) AssessmentModeManager(org.olat.course.assessment.AssessmentModeManager) Date(java.util.Date)

Example 35 with ChiefController

use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.

the class CourseRuntimeController method removeCustomCSS.

private void removeCustomCSS() {
    ChiefController cc = getWindowControl().getWindowBackOffice().getChiefController();
    if (cc != null) {
        cc.removeCurrentCustomCSSFromView();
    }
    setCustomCSS(null);
    setCourseClosedMessage(getUserCourseEnvironment());
}
Also used : ChiefController(org.olat.core.gui.control.ChiefController)

Aggregations

ChiefController (org.olat.core.gui.control.ChiefController)58 UserRequest (org.olat.core.gui.UserRequest)10 UserRequestImpl (org.olat.core.gui.UserRequestImpl)10 IOException (java.io.IOException)8 Window (org.olat.core.gui.components.Window)8 InvalidRequestParameterException (org.olat.core.gui.components.form.flexible.impl.InvalidRequestParameterException)8 WindowControl (org.olat.core.gui.control.WindowControl)8 OLATRuntimeException (org.olat.core.logging.OLATRuntimeException)8 ArrayList (java.util.ArrayList)6 BaseFullWebappController (org.olat.core.commons.fullWebApp.BaseFullWebappController)6 StringOutput (org.olat.core.gui.render.StringOutput)6 URLBuilder (org.olat.core.gui.render.URLBuilder)6 AssertException (org.olat.core.logging.AssertException)6 UserSession (org.olat.core.util.UserSession)6 HttpSession (javax.servlet.http.HttpSession)4 BaseFullWebappControllerParts (org.olat.core.commons.fullWebApp.BaseFullWebappControllerParts)4 Windows (org.olat.core.gui.Windows)4 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)4 RedirectMediaResource (org.olat.core.gui.media.RedirectMediaResource)4 ContextEntry (org.olat.core.id.context.ContextEntry)4