use of org.olat.course.condition.Condition in project openolat by klemens.
the class InfoCourseNode method getPreConditionEdit.
/**
* Default set the write privileges to coaches and admin only
* @return
*/
public Condition getPreConditionEdit() {
if (preConditionEdit == null) {
preConditionEdit = new Condition();
preConditionEdit.setEasyModeCoachesAndAdmins(true);
preConditionEdit.setConditionExpression(preConditionEdit.getConditionFromEasyModeConfiguration());
preConditionEdit.setExpertMode(false);
}
preConditionEdit.setConditionId(EDIT_CONDITION_ID);
return preConditionEdit;
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class CalEditController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
public void event(UserRequest ureq, Controller source, Event event) {
if (source == displayForm) {
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == accessCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessCondContr.getCondition();
calCourseNode.setPreConditionAccess(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == editCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = editCondContr.getCondition();
calCourseNode.setPreConditionEdit(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class BCCourseNodeEditController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest urequest, Controller source, Event event) {
if (source == uploaderCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = uploaderCondContr.getCondition();
bcNode.setPreConditionUploaders(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == downloaderCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = downloaderCondContr.getCondition();
bcNode.setPreConditionDownloaders(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == folderPathChoose) {
if (bcNode.getModuleConfiguration().getStringValue(CONFIG_SUBPATH, "").startsWith("/_sharedfolder")) {
accessabiliryContent.contextPut("uploadable", false);
} else {
accessabiliryContent.contextPut("uploadable", true);
}
fireEvent(urequest, event);
} else if (cmc == source) {
cleanUp();
}
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class FOCourseNodeEditController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest urequest, Controller source, Event event) {
if (source == readerCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = readerCondContr.getCondition();
foNode.setPreConditionReader(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == posterCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = posterCondContr.getCondition();
foNode.setPreConditionPoster(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == moderatorCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = moderatorCondContr.getCondition();
foNode.setPreConditionModerator(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == settingsCtrl) {
if (event == Event.CHANGED_EVENT) {
String pseudoAllowed = settingsCtrl.isPseudonymPostAllowed() ? "true" : "false";
foNode.getModuleConfiguration().setStringValue(PSEUDONYM_POST_ALLOWED, pseudoAllowed);
String defaultPseudo = settingsCtrl.isDefaultPseudonym() ? "true" : "false";
foNode.getModuleConfiguration().setStringValue(PSEUDONYM_POST_DEFAULT, defaultPseudo);
String guestAllowed = settingsCtrl.isGuestPostAllowed() ? "true" : "false";
foNode.getModuleConfiguration().setStringValue(GUEST_POST_ALLOWED, guestAllowed);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class PortfolioCourseNodeEditController method event.
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == accessibilityCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondContr.getCondition();
courseNode.setPreConditionAccess(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == configForm) {
if (event == Event.DONE_EVENT) {
configForm.getUpdatedConfig();
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
textForm.loadMapOrBinder();
textForm.updateUI();
configContent.setDirty(true);
}
} else if (source == textForm) {
if (event == Event.DONE_EVENT) {
textForm.getUpdatedConfig();
configForm.setDirtyFromOtherForm(false);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
} else if (event == Event.CHANGED_EVENT) {
// disable modification in other forms!
configForm.setDirtyFromOtherForm(true);
}
} else if (source == scoringController) {
if (event == Event.CANCELLED_EVENT) {
if (hasLogEntries) {
scoringController.setDisplayOnly(true);
}
configContent.contextPut("isOverwriting", new Boolean(false));
return;
} else if (event == Event.DONE_EVENT) {
scoringController.updateModuleConfiguration(config);
updateHighscoreTab();
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == highScoreNodeConfigController) {
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
Aggregations