editPortal.setModifiable(acl.hasEditPermission(pConfig));
} else {
editPortal.setModifiable(false);
}
LocaleConfigService localeConfigService = uiPortalApp.getApplicationComponent(LocaleConfigService.class);
LocaleConfig localeConfig = localeConfigService.getLocaleConfig(portalConfig.getLocale());
if (localeConfig == null) {
localeConfig = localeConfigService.getDefaultLocaleConfig();
}
// TODO dang.tung - change layout when portal get language from UIPortal
// (user and browser not support)
// ----------------------------------------------------------------------------------------------------
String portalAppLanguage = prContext.getLocale().getLanguage();
OrganizationService orgService = getApplicationComponent(OrganizationService.class);
UserProfile userProfile = orgService.getUserProfileHandler().findUserProfileByName(remoteUser);
String userLanguage = userProfile.getUserInfoMap().get(Constants.USER_LANGUAGE);
String browserLanguage = prContext.getRequest().getLocale().getLanguage();
// in case: edit current portal, set skin and language for uiPortalApp
if (uiPortal == null) {
if (!portalAppLanguage.equals(userLanguage) && !portalAppLanguage.equals(browserLanguage)) {
prContext.setLocale(localeConfig.getLocale());
// editPortal.refreshNavigation(localeConfig.getLocale());
// uiPortalApp.localizeNavigations();
}
uiPortalApp.setSkin(editPortal.getSkin());
}