use of org.olat.core.gui.components.htmlheader.jscss.CustomCSS in project OpenOLAT by OpenOLAT.
the class CourseRuntimeController method addCustomCSS.
private void addCustomCSS(UserRequest ureq) {
ICourse course = CourseFactory.loadCourse(getRepositoryEntry());
CustomCSS customCSS = CourseFactory.getCustomCourseCss(ureq.getUserSession(), course.getCourseEnvironment());
ChiefController cc = getWindowControl().getWindowBackOffice().getChiefController();
if (cc != null) {
if (customCSS == null) {
cc.removeCurrentCustomCSSFromView();
} else {
cc.addCurrentCustomCSSToView(customCSS);
}
}
setCustomCSS(customCSS);
}
use of org.olat.core.gui.components.htmlheader.jscss.CustomCSS in project OpenOLAT by OpenOLAT.
the class CourseLayoutHelper method getCustomCSS.
/**
* get CustomCSS preconfigured according to choosen course theme
* @param usess
* @param courseEnvironment
* @return
*/
public static CustomCSS getCustomCSS(UserSession usess, CourseEnvironment courseEnvironment) {
VFSContainer courseContainer = getCSSBaseFolder(courseEnvironment);
CustomCSS customCSS = null;
// check for existing main.css and iframe.css
if (isCourseThemeFolderValid(courseContainer)) {
customCSS = new CustomCSS(courseContainer, MAIN_CSS, IFRAME_CSS, usess);
} else if (courseContainer != null && courseContainer.resolve(courseEnvironment.getCourseConfig().getCssLayoutRef()) != null) {
// legacy fallback
customCSS = new CustomCSS(courseContainer, courseEnvironment.getCourseConfig().getCssLayoutRef(), usess);
}
return customCSS;
}
use of org.olat.core.gui.components.htmlheader.jscss.CustomCSS in project OpenOLAT by OpenOLAT.
the class ModifyCourseEvent method getCustomCourseCss.
/**
* Create a custom css object for the course layout. This can then be set on a
* MainLayoutController to activate the course layout
*
* @param usess The user session
* @param courseEnvironment the course environment
* @return The custom course css or NULL if no course css is available
*/
public static CustomCSS getCustomCourseCss(UserSession usess, CourseEnvironment courseEnvironment) {
CustomCSS customCSS = null;
CourseConfig courseConfig = courseEnvironment.getCourseConfig();
if (courseConfig.hasCustomCourseCSS()) {
// Notify the current tab that it should load a custom CSS
return CourseLayoutHelper.getCustomCSS(usess, courseEnvironment);
}
return customCSS;
}
Aggregations