public void event(UserRequest ureq, Controller source, Event event) {
if (source == idc) {
if (event instanceof OlatCmdEvent) {
//TODO:gs legacy code???
//FIXME:fj:b move to other place (whole class) since single page controller could be used generically
OlatCmdEvent oce = (OlatCmdEvent) event;
String nodeId = oce.getSubcommand();
ThreadLocalUserActivityLogger.log(CourseLoggingAction.COURSE_BROWSE_GOTO_NODE, getClass(),
CoreLoggingResourceable.wrapSpUri(GOTO_NID+nodeId));
// refire to listening controllers
fireEvent(ureq, event);
} else if (event instanceof NewIframeUriEvent) {
NewIframeUriEvent iframeEvent = (NewIframeUriEvent) event;
String newUri = iframeEvent.getNewUri();
setCurURI(newUri);
// log this uri change
ThreadLocalUserActivityLogger.log(CourseLoggingAction.NODE_SINGLEPAGE_GET_FILE, getClass(),
CoreLoggingResourceable.wrapSpUri(newUri));
}
} else if (source == htmlEditorController) {
htmlEditorController.dispose();
cmc.deactivate();
if (g_inIframe) {
idc.setCurrentURI(g_curURI);
} else {
cpc.setCurrentURI(g_curURI);
}
} else if (source == cpc) {
if (event instanceof OlatCmdEvent) {
OlatCmdEvent oce = (OlatCmdEvent) event;
String nodeId = oce.getSubcommand();
ThreadLocalUserActivityLogger.log(CourseLoggingAction.COURSE_BROWSE_GOTO_NODE, getClass(),
CoreLoggingResourceable.wrapSpUri(GOTO_NID+nodeId));
// refire to listening controllers
fireEvent(ureq, event);
}