Search in sources :

Example 6 with IFrameDisplayController

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);
    }
}
Also used : IFrameDisplayController(org.olat.core.gui.control.generic.iframe.IFrameDisplayController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) FileMediaResource(org.olat.core.gui.media.FileMediaResource) File(java.io.File)

Aggregations

IFrameDisplayController (org.olat.core.gui.control.generic.iframe.IFrameDisplayController)6 VFSContainer (org.olat.core.util.vfs.VFSContainer)4 File (java.io.File)2 Component (org.olat.core.gui.components.Component)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 FileMediaResource (org.olat.core.gui.media.FileMediaResource)2