use of org.olat.core.gui.control.winmgr.JSCommand in project openolat by klemens.
the class RunMainController method updateCourseDataAttributes.
private void updateCourseDataAttributes(CourseNode calledCourseNode) {
StringBuilder sb = new StringBuilder();
sb.append("try {var oocourse = jQuery('.o_course_run');");
if (calledCourseNode == null) {
sb.append("oocourse.removeAttr('data-nodeid');");
} else {
sb.append("oocourse.attr('data-nodeid','");
sb.append(Formatter.escapeDoubleQuotes(calledCourseNode.getIdent()));
sb.append("');");
}
sb.append("oocourse=null;}catch(e){}");
JSCommand jsc = new JSCommand(sb.toString());
WindowControl wControl = getWindowControl();
if (wControl != null && wControl.getWindowBackOffice() != null) {
wControl.getWindowBackOffice().sendCommandTo(jsc);
}
// course title already set by BaseFullWebappController on tab activate
if (calledCourseNode != null) {
String newTitle = courseTitle + " - " + calledCourseNode.getShortTitle();
getWindowControl().getWindowBackOffice().getWindow().setTitle(getTranslator(), newTitle);
}
}
Aggregations