Author: truong.le
Date: 2010-01-14 20:49:36 -0500 (Thu, 14 Jan 2010)
New Revision: 1306
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
Log:
GTNPORTAL-419: Always show language of old portal when create new portal
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2010-01-14
21:34:16 UTC (rev 1305)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2010-01-15
01:49:36 UTC (rev 1306)
@@ -161,6 +161,11 @@
invokeGetBindingBean(editPortal);
((UIFormStringInput)getChild(UIFormInputSet.class).getChildById(FIELD_NAME)).setValue(getPortalOwner());
+
+
+ LocaleConfigService localeConfigService =
getApplicationComponent(LocaleConfigService.class);
+ LocaleConfig localeConfig =
localeConfigService.getLocaleConfig(editPortal.getLocale());
+ this.<UIFormInputSet>
getChildById("PortalSetting").<UIFormSelectBox>getChildById(FIELD_LOCALE).setValue(localeConfig.getLanguage());
setActions(new String[]{"Save", "Close"});
}
@@ -178,16 +183,17 @@
UIPortal uiPortal = Util.getUIPortal();
LocaleConfigService localeConfigService =
getApplicationComponent(LocaleConfigService.class);
Collection<?> listLocaleConfig = localeConfigService.getLocalConfigs();
+ LocaleConfig defaultLocale = localeConfigService.getDefaultLocaleConfig();
+ String defaultLanguage = defaultLocale.getLanguage();
Locale currentLocate = Util.getPortalRequestContext().getLocale();
Iterator<?> iterator = listLocaleConfig.iterator();
while (iterator.hasNext())
{
LocaleConfig localeConfig = (LocaleConfig)iterator.next();
- Locale locale = localeConfig.getLocale();
SelectItemOption<String> option =
new
SelectItemOption<String>(localeConfig.getLocale().getDisplayName(currentLocate),
localeConfig
.getLanguage());
- if (locale.getLanguage().equalsIgnoreCase(uiPortal.getLocale()))
+ if(defaultLanguage.equals(localeConfig.getLanguage()))
{
option.setSelected(true);
}
Show replies by date