use of org.olat.course.condition.Condition in project openolat by klemens.
the class MSCourseNodeEditController 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 ureq, Controller source, Event event) {
if (source == accessibilityCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondContr.getCondition();
msNode.setPreConditionAccess(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == modConfigController) {
if (event == Event.CANCELLED_EVENT) {
if (modConfigController != null) {
removeAsListenerAndDispose(modConfigController);
}
modConfigController = new MSEditFormController(ureq, getWindowControl(), msNode.getModuleConfiguration());
listenTo(modConfigController);
configurationVC.put("mseditform", modConfigController.getInitialComponent());
if (hasLogEntries) {
modConfigController.setDisplayOnly(true);
}
configurationVC.contextPut("isOverwriting", new Boolean(false));
return;
} else if (event == Event.DONE_EVENT) {
modConfigController.updateModuleConfiguration(msNode.getModuleConfiguration());
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
updateHighscoreTab();
} else if (source == highScoreNodeConfigController) {
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
use of org.olat.course.condition.Condition in project openolat by klemens.
the class CalCourseNode 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 WikiEditController 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 urequest, Controller source, Event event) {
if (source == searchController) {
cmcSearchController.deactivate();
// repository search controller done
if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) {
RepositoryEntry re = searchController.getSelectedEntry();
if (re != null) {
setWikiRepoReference(re, moduleConfiguration);
content.contextPut("showPreviewLink", Boolean.TRUE);
String displayname = StringHelper.escapeHtml(re.getDisplayname());
previewLink = LinkFactory.createCustomLink("command.preview", "command.preview", displayname, Link.NONTRANSLATED, content, this);
previewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_preview");
previewLink.setCustomEnabledLinkCSS("o_preview");
previewLink.setTitle(getTranslator().translate("command.preview"));
// no securitycheck on wiki, editable by everybody
editLink = LinkFactory.createButtonSmall("edit", content, this);
// fire event so the updated config is saved by the
// editormaincontroller
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
// else cancelled repo search
} else if (source == accessCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessCondContr.getCondition();
wikiCourseNode.setPreConditionAccess(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == editCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = editCondContr.getCondition();
wikiCourseNode.setPreConditionEdit(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == cmcWikiCtr) {
if (event == CloseableModalController.CLOSE_MODAL_EVENT) {
cmcWikiCtr.dispose();
wikiCtr.dispose();
}
}
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class AbstractCourseNodeWebService method createExpertCondition.
protected Condition createExpertCondition(String conditionId, String expertRules) {
Condition cond = new Condition();
cond.setConditionExpression(expertRules);
cond.setExpertMode(true);
cond.setConditionId(conditionId);
return cond;
}
use of org.olat.course.condition.Condition in project OpenOLAT by OpenOLAT.
the class ENEditController method init.
/**
* @param config
* @param ureq
* @param enCourseNode
* @param course
* @param euce
*/
private void init(ModuleConfiguration config, UserRequest ureq, ENCourseNode enCourseNode, ICourse courseP, UserCourseEnvironment euceP) {
this.moduleConfiguration = config;
this.courseNode = enCourseNode;
this.euce = euceP;
myContent = createVelocityContainer("edit");
doFormInit(ureq);
// Accessibility precondition
Condition accessCondition = courseNode.getPreConditionAccess();
accessibilityCondContr = new ConditionEditController(ureq, getWindowControl(), euceP, accessCondition, AssessmentHelper.getAssessableNodes(courseP.getEditorTreeModel(), enCourseNode));
listenTo(accessibilityCondContr);
// not needed: setInitialComponent(myContent) since tabbable controller
}
Aggregations