Files
ofbiz-framework/framework/common/groovyScripts/InitTheme.groovy
T
Nicolas Malin aec57b51c5 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Third step, move macro ftl libraries and ftl template present on framework common to common theme
At this step, the common-theme is forced like the common component previously.

Main common screens present on CommonScreens.xml, LookupScreens.xml and HelpScreens.xml are moved to common screen with a forced rewrite to common-theme 
Warning this commit is going to follow with a other commit for CommonScreens.xml because LookupScreens.xml and HelpScreens.xml are recreated on common-theme, but to keep the history of CommonScreens.xml it was moved entirely, the second commit restore it with redirect call.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806091 13f79535-47bb-0310-9956-ffa450edef68
2017-08-24 21:55:06 +00:00

46 lines
1.9 KiB
Groovy

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.ofbiz.base.util.UtilProperties
def globalContext = context.globalContext;
if (!globalContext.userPreferences) {
Map userPreferencesResult = run service: 'getUserPreferenceGroup', with: ['userPrefGroupTypeId': 'GLOBAL_PREFERENCES']
globalContext.userPreferences = userPreferencesResult.userPrefMap
}
if (!globalContext.generalProperties) {
globalContext.generalProperties = UtilProperties.getResourceBundleMap('general', context.locale, context)
}
if (!globalContext.visualThemeId) {
globalContext.visualThemeId = userPreferences.VISUAL_THEME ? userPreferences.VISUAL_THEME : generalProperties.VISUAL_THEME
}
if (!globalContext.themeResources) {
Map themeResourcesResult = run service: 'getVisualThemeResources', with: ['visualThemeId': globalContext.visualThemeId]
globalContext.themeResources = themeResourcesResult.themeResources
if (globalContext.layoutSettings) {
globalContext.layoutSettings.putAll(themeResourcesResult.themeResources)
} else {
globalContext.layoutSettings = themeResourcesResult.themeResources
}
}
context.globalContext = globalContext