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);
}
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());
}
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();
}
}
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;
}
}
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());
}
Aggregations