use of org.olat.course.condition.Condition in project openolat by klemens.
the class IQEditController method event.
@Override
public void event(UserRequest urequest, Controller source, Event event) {
if (source == accessibilityCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondContr.getCondition();
courseNode.setPreConditionAccess(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == configurationCtrl) {
if (event == NodeEditController.NODECONFIG_CHANGED_EVENT) {
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
layoutConfigurationCtrl.updateEditController(urequest);
}
} else if (source == highScoreNodeConfigController) {
if (event == Event.DONE_EVENT) {
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == layoutConfigurationCtrl) {
if (event == NodeEditController.NODECONFIG_CHANGED_EVENT) {
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
configurationCtrl.updateEditController(urequest, false);
layoutConfigurationCtrl.updateEditController(urequest);
}
}
}
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 klemens.
the class ChecklistEditController method event.
/**
* {@inheritDoc}
*/
@Override
protected 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 == checklistFormContr && event == Event.CHANGED_EVENT) {
// checklist = ChecklistManager.getInstance().saveChecklist(checklist);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
} else if (source == manageController && event == Event.DONE_EVENT) {
cmcManage.deactivate();
} else if (event == NodeEditController.NODECONFIG_CHANGED_EVENT) {
// update title and description according to the course node
Checklist cl = ChecklistManager.getInstance().loadChecklist(checklist);
cl.setTitle(courseNode.getShortTitle());
cl.setDescription(courseNode.getLongTitle());
checklist = ChecklistManager.getInstance().saveChecklist(cl);
}
}
Aggregations