use of org.olat.core.commons.modules.singlepage.SinglePageController in project OpenOLAT by OpenOLAT.
the class SubmitDocumentsController method doView.
private void doView(UserRequest ureq, String filename) {
if (viewDocCtrl != null)
return;
viewDocCtrl = new SinglePageController(ureq, getWindowControl(), documentsContainer, filename, false);
listenTo(viewDocCtrl);
cmc = new CloseableModalController(getWindowControl(), translate("close"), viewDocCtrl.getInitialComponent(), true, filename);
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.commons.modules.singlepage.SinglePageController in project openolat by klemens.
the class SPRunController method doInlineIntegration.
private void doInlineIntegration(UserRequest ureq, boolean hasEditRightsTo) {
boolean allowRelativeLinks = config.getBooleanSafe(SPEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS);
// create the possibility to float
OLATResourceable ores = OresHelper.createOLATResourceableInstance(ICourse.class, userCourseEnv.getCourseEnvironment().getCourseResourceableId());
DeliveryOptions deliveryOptions = (DeliveryOptions) config.get(SPEditController.CONFIG_KEY_DELIVERYOPTIONS);
spCtr = new SinglePageController(ureq, getWindowControl(), courseFolderContainer, fileName, allowRelativeLinks, null, ores, deliveryOptions, userCourseEnv.getCourseEnvironment().isPreview());
spCtr.setAllowDownload(true);
// only for inline integration: register for controller event to forward a olatcmd to the course,
// and also to remember latest position in the script
listenTo(spCtr);
// enable edit mode if user has the according rights
if (hasEditRightsTo) {
spCtr.allowPageEditing();
// set the link tree model to internal for the HTML editor
if (linkTreeModel != null) {
spCtr.setInternalLinkTreeModel(linkTreeModel);
}
}
// create clone wrapper layout
CloneLayoutControllerCreatorCallback clccc = new CloneLayoutControllerCreatorCallback() {
public ControllerCreator createLayoutControllerCreator(UserRequest uureq, final ControllerCreator contentControllerCreator) {
return BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(uureq, new ControllerCreator() {
public Controller createController(UserRequest lureq, WindowControl lwControl) {
// Wrap in column layout, popup window needs a layout controller
Controller ctr = contentControllerCreator.createController(lureq, lwControl);
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(), userCourseEnv.getCourseEnvironment()));
// Controller titledCtrl = TitledWrapperHelper.getWrapper(lureq, lwControl, ctr, courseNode, "o_sp_icon");
layoutCtr.addDisposableChildController(ctr);
return layoutCtr;
}
});
}
};
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), spCtr, courseNode, "o_sp_icon");
if (ctrl instanceof CloneableController) {
cloneC = new CloneController(ureq, getWindowControl(), (CloneableController) ctrl, clccc);
listenTo(cloneC);
main.setContent(cloneC.getInitialComponent());
} else {
throw new AssertException("Controller must be cloneable");
}
}
use of org.olat.core.commons.modules.singlepage.SinglePageController in project openolat by klemens.
the class GTAAvailableTaskController method doPreview.
private void doPreview(UserRequest ureq, String filename) {
if (filename != null && filename.endsWith(".html")) {
VFSContainer tasksContainer = gtaManager.getTasksContainer(courseEnv, gtaNode);
previewCtrl = new SinglePageController(ureq, getWindowControl(), tasksContainer, filename, false);
listenTo(previewCtrl);
cmc = new CloseableModalController(getWindowControl(), translate("close"), previewCtrl.getInitialComponent(), true, filename);
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.core.commons.modules.singlepage.SinglePageController in project openolat by klemens.
the class DirectoryController method doDownload.
private void doDownload(UserRequest ureq, File file) {
if (file.getName().endsWith(".html")) {
previewCtrl = new SinglePageController(ureq, getWindowControl(), documentsContainer, file.getName(), false);
listenTo(previewCtrl);
cmc = new CloseableModalController(getWindowControl(), translate("close"), previewCtrl.getInitialComponent(), true, file.getName());
listenTo(cmc);
cmc.activate();
} else {
MediaResource mdr = new FileMediaResource(file, true);
ureq.getDispatchResult().setResultingMediaResource(mdr);
}
}
use of org.olat.core.commons.modules.singlepage.SinglePageController in project openolat by klemens.
the class DocumentPoolInfoPageController method doViewInfoPage.
private void doViewInfoPage(UserRequest ureq) {
cleanUp();
VFSContainer container = docPoolModule.getInfoPageContainer();
indexCtrl = new SinglePageController(ureq, getWindowControl(), container, "index.html", false);
listenTo(indexCtrl);
mainVC.put("index", indexCtrl.getInitialComponent());
}
Aggregations