// Build-up JSON graph for system theme.
JSONObject root = new JSONObject();
JSONObject themeObject;
for ( String systemThemeName : themeManager.getSystemThemeIds() ) {
Theme theme = themeManager.getSystemTheme( systemThemeName );
themeObject = new JSONObject();
root.put( theme.getId(), themeObject );
themeObject.put( "rootDir", theme.getThemeRootDir() );
for ( ThemeResource res : theme.getResources() ) {
themeObject.append( "resources", res.getLocation() );
}
}
out.write( ( "var core_theme_tree = " + root.toString() + ";\n\n" ).getBytes() );
out.write( "// Inject the theme script to handle the insertion of requested theme resources\n\n".getBytes() );
ModuleThemeInfo moduleThemeinfo = themeManager.getModuleThemeInfo( moduleName );
if ( moduleThemeinfo != null ) {
// Build-up JSON graph for module theme.
root = new JSONObject();
for ( Theme theme : moduleThemeinfo.getModuleThemes() ) {
themeObject = new JSONObject();
root.put( theme.getName(), themeObject );
themeObject.put( "rootDir", theme.getThemeRootDir() );
for ( ThemeResource res : theme.getResources() ) {
themeObject.append( "resources", res.getLocation() );
}
}
out.write( ( "var module_theme_tree = " + root.toString() + ";\n\n" ).getBytes() );