Skip to content
Snippets Groups Projects
Commit 001d56f1 authored by srosse's avatar srosse
Browse files

OO-1808: show a message if the course element cannot deliver a view after an...

OO-1808: show a message if the course element cannot deliver a view after an author published the course
parent c9372c6f
No related branches found
No related tags found
No related merge requests found
......@@ -470,10 +470,10 @@ public abstract class DefaultController implements Controller, ControllerEventLi
}
protected WindowControl addToHistory(UserRequest ureq, Controller controller) {
WindowControl wControl;
WindowControl wControl = null;
if(controller instanceof DefaultController) {
wControl = ((DefaultController)controller).getWindowControl();
} else {
} else if(controller != null) {
wControl = controller.getWindowControlForDebug();
}
BusinessControlFactory.getInstance().addToHistory(ureq, wControl);
......
......@@ -138,6 +138,7 @@ public class STCourseNode extends AbstractAccessableCourseNode implements Assess
* org.olat.course.run.userview.UserCourseEnvironment,
* org.olat.course.run.userview.NodeEvaluation)
*/
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl,
final UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
updateModuleConfigDefaults(false);
......@@ -174,11 +175,12 @@ public class STCourseNode extends AbstractAccessableCourseNode implements Assess
spCtr.addLoggingResourceable(LoggingResourceable.wrap(this));
// create clone wrapper layout, allow popping into second window
CloneLayoutControllerCreatorCallback clccc = new CloneLayoutControllerCreatorCallback() {
public ControllerCreator createLayoutControllerCreator(final UserRequest ureq, final ControllerCreator contentControllerCreator) {
return BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, new ControllerCreator() {
@SuppressWarnings("synthetic-access")
@Override
public ControllerCreator createLayoutControllerCreator(final UserRequest uureq, final ControllerCreator contentControllerCreator) {
return BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(uureq, new ControllerCreator() {
@Override
public Controller createController(UserRequest lureq, WindowControl lwControl) {
// wrapp in column layout, popup window needs a layout controller
// 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()));
......@@ -192,7 +194,7 @@ public class STCourseNode extends AbstractAccessableCourseNode implements Assess
};
Controller wrappedCtrl = TitledWrapperHelper.getWrapper(ureq, wControl, spCtr, this, ICON_CSS_CLASS);
if(wrappedCtrl instanceof CloneableController) {
cont = new CloneController(ureq, wControl, (CloneableController)wrappedCtrl, clccc);
cont = new CloneController(ureq, wControl, (CloneableController)wrappedCtrl, clccc);
} else {
throw new AssertException("Need to be a cloneable");
}
......
......@@ -431,8 +431,14 @@ public class RunMainController extends MainLayoutBasicController implements Gene
}
} else if(currentNodeController instanceof Activateable2) {
((Activateable2)currentNodeController).activate(ureq, entries, state);
} else if(currentNodeController != null) {
contentP.setContent(currentNodeController.getInitialComponent());
} else {
MessageController msgCtrl = MessageUIFactory
.createWarnMessage(ureq, getWindowControl(), null, translate("msg.nodenotavailableanymore"));
listenTo(msgCtrl);
contentP.setContent(msgCtrl.getInitialComponent());
}
contentP.setContent(currentNodeController.getInitialComponent());
updateNextPrevious();
updateLastUsage(nclr.getCalledCourseNode());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment