use of org.olat.core.gui.control.generic.iframe.IFrameDisplayController in project openolat by klemens.
the class ReturnboxFullAccessCallback method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest ureq, Component source, Event event) {
if (source == taskLaunchButton) {
File fTaskfolder = new File(FolderConfig.getCanonicalRoot() + TACourseNode.getTaskFolderPathRelToFolderRoot(userCourseEnv.getCourseEnvironment(), node));
if (assignedTask.toLowerCase().endsWith(".html") || assignedTask.toLowerCase().endsWith(".htm") || assignedTask.toLowerCase().endsWith(".txt")) {
// render content for other users always in iframe
removeAsListenerAndDispose(iFrameCtr);
iFrameCtr = new IFrameDisplayController(ureq, getWindowControl(), fTaskfolder);
listenTo(iFrameCtr);
iFrameCtr.setCurrentURI(assignedTask);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), translate("close"), iFrameCtr.getInitialComponent());
listenTo(cmc);
cmc.activate();
} else {
ureq.getDispatchResult().setResultingMediaResource(new FileMediaResource(new File(fTaskfolder, assignedTask)));
}
} else if (source == cancelTaskButton) {
// confirm cancel task assignment
dialogBoxController = this.activateYesNoDialog(ureq, "", translate("task.cancel.reassign"), dialogBoxController);
}
}
Aggregations